Conversation
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.
Summary
Ports #9806 onto
t3code/codex-turn-mapping.A V2 provider session removed its session-map entry before scope cleanup finished, so a replacement
opencould start a new process while the old one still owned credentials and resources — and a hung cleanup silently unblocked reuse.opens and runtime thread attachments (ensureThread/resumeThread/forkThread/startTurn) for its recorded threads are blocked.close/detach/closeInstancecalls join the same cleanupDeferredrather than racing it; adetachthat loses its session to a concurrent close joins the pending cleanup instead of reporting success over still-running work.errorprojection state without claiming the process stopped; successful cleanup clears the block, failed cleanup keeps blocking until restart.Post-review hardening vs. #9806: the runtime attachment gate runs outside
observeActivity(which swallows bookkeeping failures) and outsidestartTurn's busy/idle catch (a rejected attach must not decrement the peer's busy count).Test plan
vp test run src/orchestration-v2/ProviderSessionManager.test.ts— 53/53 (timeout, replacement blocking after close/detach/closeInstance, retry-joins, late success, cleanup-failure persistence, shared peer credentials, attach-vs-close race, detach-mid-close race, runtime attachment gate, busy-peer guard)vp lint/vp fmt/ package typecheck clean on changed filesSWE-2 (Devin) via T3 Code / Cursor harness.
Coordination trace: T3 thread
063442b9-45e8-4f0e-bc47-edea523ce7d0; campaign saphid/t3code-personal#298; original implementation #9806.