Skip to content

port: cross-instance MCP OAuth locks (upstream 24f9c2a08)#186

Merged
Ecko95 merged 2 commits into
gitsfrom
port/mcp-oauth-locks
Jul 18, 2026
Merged

port: cross-instance MCP OAuth locks (upstream 24f9c2a08)#186
Ecko95 merged 2 commits into
gitsfrom
port/mcp-oauth-locks

Conversation

@Ecko95

@Ecko95 Ecko95 commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Ports upstream t3code commit 24f9c2a (pingdotgg#4104) into gits.

What

Shares the mcp-oauth-locks directory across concurrent Codex shadow homes by symlinking it into the shared home, replacing any Codex-created local lock dir found there.

  • Adds mcp-oauth-locks to KNOWN_SHARED_DIRECTORIES.
  • Adds REPLACEABLE_SHARED_RUNTIME_DIRECTORIES and teaches ensureSymlink to remove a Codex-created local runtime dir and re-link it to the shared home (other non-symlink entries still conflict as before).

Why

Target is 3-4 concurrent Codex/Claude tasks, which races OAuth. With the lock dir shared, all shadow homes contend on one file-store lock so auth serializes, and a stale local lock left by a crashed run cannot permanently block auth (it gets swept aside and re-linked).

Fork adaptation

Upstream uses granular CodexShadowHomeEntryConflictError / CodexShadowHomeFileSystemError; the fork collapsed these into a single CodexShadowHomeError, so the port adapts to that model. File path is unchanged from upstream.

Tests (adapted from upstream)

  • Existing materialize test now asserts mcp-oauth-locks links to the shared home.
  • New test: a Codex-created local lock dir (with file-store.lock) is replaced by a symlink to the shared locks, and the shared lock file survives — covering both serialization (shared lock dir) and stale-lock-does-not-block.

Verification: forced turbo run typecheck clean, vitest CodexHomeLayout 7/7 pass, oxfmt --check clean.

Share the mcp-oauth-locks directory across concurrent Codex shadow homes
by symlinking it into the shared home, replacing any Codex-created local
lock dir. All shadow homes then contend on one file-store lock so OAuth
serializes, and a stale local lock cannot permanently block auth.

Adapted from upstream to the fork's single-error CodexShadowHomeError model.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS labels Jul 18, 2026
@Ecko95
Ecko95 merged commit 61e3293 into gits Jul 18, 2026
8 checks passed
@Ecko95
Ecko95 deleted the port/mcp-oauth-locks branch July 18, 2026 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant