Skip to content

Codex Desktop keeps stale app connector link after reauth-required 401 until codex_apps cache is cleared #24675

Open

Description

@boundsj

Summary

Codex Desktop on macOS kept using a stale app connector link after a Linear connector started returning 401 Reauthentication required. Restarting Codex and removing/re-adding the Linear plugin did not fix it. Moving aside the local Codex app/tool discovery cache forced regeneration and made the connector work again.

Environment

  • Codex Doctor: v0.134.0
  • Platform: macOS arm64
  • Connector: Linear installed as a Codex Desktop app/plugin connector
  • Linear was not configured as a CLI MCP server, so codex mcp list did not show Linear

Symptoms

A read-only Linear connector tool call failed with:

401: "Server returned 401: 'Reauthentication required'"

Restarting Codex Desktop did not help.
Removing and re-adding the Linear plugin did not help.

What Fixed It

Moving aside the local Codex app/tool discovery cache caused Codex to regenerate connector tool metadata. After that, the same read-only Linear tool call succeeded.

The relevant local cache files were under:

~/.codex/cache/codex_apps_tools/*.json
~/.codex/cache/codex_app_directory/*.json

Before cache regeneration, the Linear tool metadata referenced one opaque link_* connector link. After cache regeneration, it referenced a different opaque link_* connector link, and calls succeeded.

Expected Behavior

When an app connector returns 401 Reauthentication required, Codex Desktop should either:

  • invalidate/regenerate the cached connector tool metadata automatically,
  • expose a reconnect/reauth action in the plugin/app UI, or
  • clear the relevant app connector cache when the plugin is removed/re-added.

Actual Behavior

The stale connector link survived:

  • full Codex Desktop restart,
  • Linear plugin remove/re-add,
  • and retrying the same connector call.

The only working recovery was manually clearing/moving aside the app/tool discovery cache.

Workaround

Move aside the app/tool discovery cache and restart/retry Codex Desktop:

mkdir -p ~/.codex/cache/app-connector-cache-backup
mv ~/.codex/cache/codex_apps_tools/*.json ~/.codex/cache/app-connector-cache-backup/ 2>/dev/null || true
mv ~/.codex/cache/codex_app_directory/*.json ~/.codex/cache/app-connector-cache-backup/ 2>/dev/null || true

This appears to force Codex to fetch fresh connector metadata.

Notes

This may be related to broader Desktop/app connector auth-refresh behavior, but the specific issue here is that stale codex_apps discovery metadata retained an invalid connector link even after restart and plugin reinstall.

Activity

  1. added
    bugSomething isn't working
    appIssues related to the Codex desktop app
    authIssues related to authentication and accounts
    app-serverIssues involving app server protocol or interfaces
    on May 27, 2026
  2. github-actions commented on May 27, 2026

    @github-actions
    Contributor
  3. jfima commented on May 28, 2026

    @jfima

    I confirm this is real crap, it really annoys me, thank you for already reporting this bug

  4. jfima commented on May 28, 2026

    @jfima

    I’m seeing what looks like the same issue with the Linear Codex app/plugin.

    Setup:

    • Codex Desktop
    • Plugin: linear@openai-curated
    • Installed plugin root: ~/.codex/plugins/cache/openai-curated/linear/c6c214fd
    • Linear app id: asdk_app_69a089a326dc8191b32a3f2553f5be2c

    Symptoms:

    • The Linear tools are discovered and available in the session.

    • Calling mcp__codex_apps__linear._list_teams returns:

      401: "Server returned 401: 'Reauthentication required'"

    • Removing and reinstalling the plugin works locally:

      codex plugin remove linear@openai-curated
      codex plugin add linear@openai-curated

      but it does not fix auth.

    I tried the cache workaround:

    • moved the JSON files from:
      • ~/.codex/cache/codex_apps_tools/
      • ~/.codex/cache/codex_app_directory/
    • restarted the Codex app-server daemon
    • fully restarted Codex Desktop
    • opened a new session / rediscovered tools

    The cache files were regenerated, but Linear still fails with the same 401.

    Important detail: the regenerated cache still contains the same Linear link id:

    link_69ebf2fff8cc8191a42ae4b585c191f6

    And the regenerated app directory still reports Linear as:

    isAccessible: false

    So in my case, clearing the local codex_apps cache does not create a fresh usable auth/link state. It seems the stale or broken Linear app authorization is persisted server-side, or the app remains inaccessible even after local cache regeneration.

    The ChatGPT app page for Linear only shows Connect, but the connect flow does not successfully restore access for Codex Desktop.

  5. rubyisbeautiful commented on May 28, 2026

    @rubyisbeautiful

    The same behavior happens with Microsoft Teams plugin, but the workaround suggested by @boundsj did not fix it. Using Codex desktop app, version 26.519.81530 (3178) on Mac OS.

  6. scottbaggett commented on May 28, 2026

    @scottbaggett

    I can confirm this is also happening to me on Version 26.519.81530 (3178) MacOS. @boundsj workaround also does not work for me.

  7. breukr commented on May 29, 2026

    @breukr

    Also happening to me, workaround doesn't work unfortunately.

  8. czpython commented on May 31, 2026

    @czpython

    This is a major blocker as I reference linear on practically all prompts.
    The workaround above didn't work for me, what does work is to just use mcp for now:

    codex plugin remove linear@openai-curated
    codex mcp add linear --url https://mcp.linear.app/mcp
    

    and this prompt on ~/.codex/AGENTS.md

    ## Linear
    
    Use only the external Linear MCP tools in the `mcp__linear__.*` namespace for all Linear work.
    
    Do not use bundled Codex Apps Linear tools, including:
    - `codex_apps.linear_*`
    - `mcp__codex_apps__linear.*`
    
    If `mcp__linear__.*` tools are not available in the current session, stop and report that Linear MCP is unavailable. Do not fall back to Codex Apps Linear.
    
  9. elliottscott774 commented on May 31, 2026

    @elliottscott774

    Can confirm that @czpython's workaround worked for me. Removing the plugin, installing the Linear MCP server, and updating AGENTS.md allowed Codex to connect to Linear successfully.

    One issue I ran into: Codex would repeatedly fail to find the Linear MCP server and stop execution. Changing:

    mcp__linear__.*

    to:

    mcp__linear.*

    resolved the issue, and Codex now finds the server consistently.

    Versions

    • Codex: 26.527.31326
    • codex-cli: 0.135.0
  10. elvc commented on May 31, 2026

    @elvc

    I can confirm the exact same behavior and the workaround doesn't work unfortunately.

  11. randygrok commented on May 31, 2026

    @randygrok

    Same here

  12. grnbtqdbyx-create commented on May 31, 2026

    @grnbtqdbyx-create
  13. mohit0749 commented on Jun 2, 2026

    @mohit0749

    same here

  14. s5unanow commented on Jun 3, 2026

    @s5unanow

    Same issue

  15. cubesnyc commented on Jun 3, 2026

    @cubesnyc

    same issue

  16. pardhaponugoti commented on Jun 3, 2026

    @pardhaponugoti

    Running into the same issue myself, and the workaround does not work

  17. mericksters13 commented on Jun 3, 2026

    @mericksters13

    I am encountering the same issue, any updates from the team yet?

  18. elvc commented on Jun 3, 2026

    @elvc

    I wonder if the team is aware at all. Might need to tag maintainers or send /feedback

  19. MRL-00 commented on Jun 4, 2026

    @MRL-00

    The Linear team are aware, I have let them know on x.com. But I believe this issue exists on the ChatGPT/Codex side.
    https://x.com/nzmrldev/status/2062062441283076192?s=20

  20. abexiong commented on Jun 4, 2026

    @abexiong

    I was able to fix this same issue. Got Linear reconnected with Codex.
    Below is what I did.

    (NOTE: you'll need to insert your computer name in two of the places)
    If you copy and paste the following into codex and ask it to adjust it to your situation, that will be more precise to your situation.


    I found the important difference from the GitHub issue: in that report, the fix worked when Codex regenerated a different link_* connector ID. On your machine, after the cache reset and restart, Codex regenerated the same Linear link ID again. So the local cache reset happened, but Codex is still being handed the same bad Linear connection record.

    Source: #24675

    The next thing to try is a harder reset:

    In Codex, disconnect Linear.
    Fully quit Codex with Cmd+Q.
    In Linear’s website, revoke/remove the OpenAI/Codex authorized app, not just disconnect in Codex.

    In Terminal, remove the local Linear plugin and extra cache:
    cp ~/.codex/config.toml ~/.codex/config.toml.linear-debug.bak
    /Users/yourcomputername/Desktop/Codex.app/Contents/Resources/codex plugin remove linear@openai-curated
    mkdir -p ~/.codex/cache/app-connector-cache-backup-20260604-linear-hard-reset
    mv ~/.codex/cache/codex_apps_tools/.json ~/.codex/cache/app-connector-cache-backup-20260604-linear-hard-reset/ 2>/dev/null || true
    mv ~/.codex/cache/codex_app_directory/
    .json ~/.codex/cache/app-connector-cache-backup-20260604-linear-hard-reset/ 2>/dev/null || true
    mv ~/.codex/cache/codex_apps_server_info/*.json ~/.codex/cache/app-connector-cache-backup-20260604-linear-hard-reset/ 2>/dev/null || true

    Reopen Codex.

    Reinstall Linear:
    /Users/yourcomputername/Desktop/Codex.app/Contents/Resources/codex plugin add linear@openai-curated
    Connect Linear again from Codex.
    Use Try in chat and ask it to search for (a Linear file name).
    One extra clue: Codex lists both Linear and Linear (Legacy) in the app directory. When reconnecting, choose the normal Linear app, the one that says “Plan and build products,” not Legacy.

    codex doctor says your core Codex auth/network are fine, so this is specifically a Linear app-connector auth/link problem, not your whole Codex login.

    Let me know if this works for you.

  21. elvc commented on Jun 4, 2026

    @elvc

    Just updated the Codex desktop app and reconnect/re-auth the official linear plugin. It is working for me now. I guess they just fixed it.

  22. itsjavi commented on Jun 8, 2026

    @itsjavi

    Not working for me even after reconnecting/re-auth in the latest Codex version. I tried everything and the only solution that worked was to turn off the plugin and use the MCP server directly as mentioned @czpython with the fix of @elliottscott774

  23. mahtabnejad90 commented on Jun 10, 2026

    @mahtabnejad90

    This is still an issue on app version Version 26.608.12217 • Released Jun 9, 2026

    Error code: INVALID_ARGUMENT; Error: RuntimeException: Error calling MCP tool: [TextContent(type='text', text='{"error":"auth_revoked","message":"Session expired. Please re-authenticate.","status":401}', annotations=None, meta=None)]
    
  24. christielenn commented on Jun 15, 2026

    @christielenn

    This is still a problem in the most recent Codex version 26.609.41114

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

    appIssues related to the Codex desktop appapp-serverIssues involving app server protocol or interfacesauthIssues related to authentication and accountsbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions