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

Open 💬 23 comments Opened May 27, 2026 by boundsj
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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.

View original on GitHub ↗

23 Comments

github-actions[bot] contributor · 1 month ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #23606
  • #23866
  • #24397

Powered by Codex Action

jfima · 1 month ago

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

jfima · 1 month ago

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.

rubyisbeautiful · 1 month ago

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.

scottbaggett · 1 month ago

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

sambreuker · 1 month ago

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

czpython · 1 month ago

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.
elliottscott774 · 1 month ago

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
elvc · 1 month ago

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

randygrok · 1 month ago

Same here

grnbtqdbyx-create · 1 month ago

I added a small evidence packer for this connector auth-cache / stale-link class in trace-to-skill@0.1.63:

npx trace-to-skill@0.1.63 demo connector-auth-cache
npx trace-to-skill@0.1.63 codex-report ./runs --output openai-codex-connector-auth-cache.md

It is not a fix; it just helps affected reports include the fields that seem useful in this thread: Codex app/CLI version, connector/plugin name and id, installed plugin root, exact Codex Apps tool name such as mcp__codex_apps__linear.*, 401/reauth text, link_* id before/after reconnect or cache regeneration, isAccessible state, redacted codex_apps_tools and codex_app_directory metadata, restart/remove/re-add/cache-clear attempts, ChatGPT app page state, and whether an external MCP workaround succeeds.

Release: https://github.com/grnbtqdbyx-create/trace-to-skill/releases/tag/v0.1.63

mohit0749 · 1 month ago

same here

s5unanow · 1 month ago

Same issue

cubesnyc · 1 month ago

same issue

pardhaponugoti · 1 month ago

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

mericksters13 · 1 month ago

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

elvc · 1 month ago

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

MRL-00 · 1 month ago

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

abexiong · 1 month ago

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: openai/codex#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.

elvc · 1 month ago

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.

itsjavi · 1 month ago

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

mahtabnejad90 · 1 month ago

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)]
christielenn · 1 month ago

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