port: cross-instance MCP OAuth locks (upstream 24f9c2a08)#186
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports upstream t3code commit 24f9c2a (pingdotgg#4104) into gits.
What
Shares the
mcp-oauth-locksdirectory across concurrent Codex shadow homes by symlinking it into the shared home, replacing any Codex-created local lock dir found there.mcp-oauth-lockstoKNOWN_SHARED_DIRECTORIES.REPLACEABLE_SHARED_RUNTIME_DIRECTORIESand teachesensureSymlinkto 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 singleCodexShadowHomeError, so the port adapts to that model. File path is unchanged from upstream.Tests (adapted from upstream)
mcp-oauth-lockslinks to the shared home.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 typecheckclean,vitestCodexHomeLayout 7/7 pass,oxfmt --checkclean.