Skip to content

CLI does not handle expired tokens gracefully #1483

@jenna-winkler

Description

@jenna-winkler

Description

I set my default server in the CLI to https://agentstack-server-agenttestbed-prod.apps.fmaas-backend.fmaas.res.ibm.com which requires auth.

The CLI authorization token expires very quickly. When I return to the CLI after some time, any command I run fails with a confusing 401 Unauthorized error: 💥 HTTPStatusError: Client error '401 Unauthorized': Token validation failed

There is no guidance that the token has expired or how to fix it. When I run agentstack server login and re-select the server it fails again.

I eventually figured out that I have to manually log out then log back in, re-entering the server URL, to continue using the CLI.

Expected behavior

The CLI should automatically detect when the authorization token has expired and prompt me to re-authenticate without requiring a manual logout and login.

Screenshot

Image

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

In dev

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions