Skip to content

encouted 401 connection error #5701

Closed
Closed

Description

@zorurume

What version of Codex is running?

OpenAI Codex (v0.50.0)

What subscription do you have?

chtgpt PRO

Which model were you using?

GPT5

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What issue are you seeing?

I encountered repeated 401 Unauthorized errors when trying to use the Codex command-line tool on Windows. I tried uninstalling and reinstalling Codex via npm, cleaning caches, and checking environment variables, but the issue persisted—sometimes the codex command wasn’t even recognized after installation. I’m wondering: could these authentication or command-path problems be related to the fact that I was experimenting with using Codex to call itself—essentially trying to build a multi-agent system by having one Codex instance control another?

What steps can reproduce the bug?

Uploaded thread: 019a1f4e-65f0-75f3-9ff6-92f451ed4de7

What is the expected behavior?

No response

Additional information

No response

Activity

  1. added
    bug
    on Oct 26, 2025
  2. added
    windows-os
    on Oct 26, 2025
  3. etraut-openai commented on Oct 26, 2025

    @etraut-openai
    Contributor

    Thanks for the bug report. We're actively investigating similar reports from other users. This could be an issue with token refresh. Try logging out (codex logout or /logout slash command) and logging back in, and let us know if that fixes the issue for you.

  4. TheHett commented on Oct 27, 2025

    @TheHett

    @etraut-openai thansk, I got same trouble and logout / login hepls for me.

  5. TheHett commented on Oct 27, 2025

    @TheHett

    But the client should not doing retries when the 401 code is received.

  6. etraut-openai commented on Nov 15, 2025

    @etraut-openai
    Contributor

    Based on the symptoms, this was likely an authentication token refresh issue. We've since added code to better handle this condition, so I'm going to close. If you see something similar with the latest versions of the CLI, please open a new bug report.

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

    bugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions