Skip to content

Expired ChatGPT credentials return InternalError instead of AuthRequired #495

Description

@ruixingshi

When a ChatGPT login expires, the adapter reports an internal error instead of telling the ACP client that the user needs to sign in again.
The user sees an error such as:

Your access token could not be refreshed because you have since logged out or signed in to another account. Please sign in again.

Codex identifies this as codexErrorInfo: "unauthorized", but the adapter returns InternalError (-32603) when the session still has authConfigured: true.
As a result, ACP clients that use the standard AuthRequired error to offer a login flow just display the error and cannot guide the user through signing in again.

Expected behavior
For expired ChatGPT credentials that require a new login, return the standard ACP AuthRequired error (-32000), even if authentication was previously configured.
Having an account saved does not necessarily mean its credentials are still valid. This should work for standard ACP clients without requiring a client-specific extension.

Verification
Reproduced on version 1.11.0 using a targeted test that injects the reported unauthorized error into a session with authConfigured: true. A live expired-login scenario has not yet been tested end to end.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions