Skip to content

feat: don't close program when out of credits or when API key is missing #115

Closed

Description

@jayshrivastava

Current behavior

Program exits with an error when OPENAI_API_KEY is missing, when I have insufficient_quota, rate_limit_exceeded or when my org isn't verified to use certain models. This happens after my first prompt.

Desired

It would be nice to keep the program open and print an error to the user when this happens.

Activity

  1. tibo-openai commented on Apr 16, 2025

    @tibo-openai
    Collaborator

    I believe there is an error printed and then the program exits? What would be the benefit of keeping codex running after hitting a fatal error that prevents it from doing anything useful in this case?

  2. jayshrivastava commented on Apr 16, 2025

    @jayshrivastava
    Author

    Would the program would lose the work that it started if it hits insufficient_quota in the middle of execution?

  3. jayshrivastava commented on Apr 16, 2025

    @jayshrivastava
    Author

    It think it does. I just a rate_limit_exceeded and I couldn't continue bc the program exited.

  4. vonwerderc commented on Apr 16, 2025

    @vonwerderc

    Yes, if there was a way to not lose all the progress when you hit the rate limit, that would be great. I had a few issues with that this afternoon.

  5. tibo-openai commented on Apr 16, 2025

    @tibo-openai
    Collaborator

    We've pushed improvements for when rate limits are encountered. More to come.

  6. jonchurch commented on Apr 16, 2025

    @jonchurch
    Contributor

    You often run out of credits when deep down a rabbit hole, so being able to present a link to the user to go fill up their balance and then continue is a good UX.

    Otherwise you lose all the context you've built up and have to start from scratch, which is a "walk away from using the product" moment at least for that sesssion.

    I run into this screen many times in Claude code bc I load like $25 at a time, and the url prompt to go pay them more money works every single time.

  7. codex-maintainers commented on Aug 7, 2025

    @codex-maintainers

    Thanks for the feedback! Please try again on the latest version of Codex CLI. If the issue persists, feel free to open a new issue or contribute to the codex-rs/ implementation.

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 working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions