Skip to content

chatgpt-new: sign-in ends after an hour because every refresh returns invalid_grant #1422

Closed

Description

@justrach

Symptom. A chatgpt-new sign-in stops working about an hour after graff login chatgpt-new. The renewal is refused, and once the access token expires every request fails with invalid_token until you sign in again.

Error. OpenAI's token endpoint answers every grant_type=refresh_token request with:

HTTP/1.1 400 Bad Request

{"error": "invalid_grant"}

graff keeps that answer in the sign-in record as last_refresh_error.

Root cause. Upstream. graff sends the documented request (refreshed in src/oauth_chatgpt.zig on feat/chat-gpt-new): the issued client_id, the latest refresh_token and resource, never before earliest_refresh_at. OpenAI refuses it even for a never-used token inside the renewal window. T3 Code, pi and nolune send the same four fields.

Fix. Nothing to change in graff until OpenAI answers. Reported upstream with a reproduction: docs/upstream/openai-sign-in-refresh-invalid-grant.md. Workaround: run graff login chatgpt-new again.

Activity

  1. justrach commented on Oct 4, 2026

    @justrach
    OwnerAuthor

    Reported upstream with a reproduction using OpenAI's own devkit, which gets the same invalid_grant: openai/sign-in-with-chatgpt-devkit#5

  2. added
    bugSomething isn't working
    status:backlogWork item has not been started
    status:blockedWork item is blocked by dependency
    on Oct 5, 2026
  3. justrach commented on Nov 9, 2026

    @justrach
    OwnerAuthor

    Resolved on release/v0.302.74.51.

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

    bugSomething isn't workingpriority:p3Low prioritystatus:backlogWork item has not been startedstatus:blockedWork item is blocked by dependency

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions