Delete the runtime's codex-shaped recovery regexes and account-restart set (WS4 L2) - #2236
Closed
SawyerHood wants to merge 1 commit into
Conversation
…t set (WS4 L2) The typed provider/recovery hint (L1) covers every path these matched: sessionArchived replaces CODEX_ARCHIVED_SESSION_ERROR_PATTERN, the codex bridge's own rename ladder replaces CODEX_EMPTY_ROLLOUT_RENAME_ERROR_PATTERN and CODEX_RENAME_RETRY_DELAYS_MS, and the bridge's child rebuild plus the authRequired/rateLimited hints replace the account-restart set and restartCodexThreadForNextTurnIfNeeded. The ACP-gated NO_ACTIVE_TURN steer branch becomes the generic staleTurn branch; the ACP bridge attaches the hint to that one emission. Ratchet baseline 148 → 142. Co-Authored-By: Claude <noreply@anthropic.com>
Collaborator
Author
Coordinator review — WS4 layer 2 (#2236)PASS against Verified on the branch
Oracle (reported): typecheck 9/9; agent-runtime 450, provider-acp 196, provider-codex 201, host-daemon 555 green; parity acp-cursor 10/0; A4 307 threads, zero diffs.
|
SawyerHood
deleted the
bb/ws4-l2-delete-runtime-recovery-regexes-thr_qdx8ashimg
branch
August 21, 2026 21:41
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.
WS4 layer 2 of 7, stacked on #2235 (L1). Design:
ideal-state-provider-api.md§7 "Deleted from core" — the codex regexes, the account-restart set, and the rename retry.What was wrong
After L1 every condition the runtime used to recognize by matching codex prose arrives as a typed
provider/recoveryhint, so the regexes and the provider-id guards they justified were dead weight that still ran:CODEX_ARCHIVED_SESSION_ERROR_PATTERNgated the unarchive-and-retry beside the hint, the runtime retried renames a bridge had already retried, andshouldRestartCodexThreadAfterEventre-classified every terminal codex error by text to schedule a process restart the codex bridge now performs itself. The steer path still neededisAcpProviderIdto read the ACP bridge'sNO_ACTIVE_TURNas a stale steer.What changed
Deleted from
packages/agent-runtime/src/runtime.ts(each with its L1 counterpart):CODEX_ARCHIVED_SESSION_ERROR_PATTERN,isCodexArchivedSessionErrorsessionArchivedon the rejection (error.data.recovery);sendCommandnow switches on the hint aloneCODEX_EMPTY_ROLLOUT_RENAME_ERROR_PATTERN,CODEX_RENAME_RETRY_DELAYS_MS,sendRenameWithRolloutRetries,SendRenameWithRolloutRetriesArgssendMaintenanceRequestWithRetries); the runtime sendsthread/name/setonceCODEX_ACCOUNT_RESTART_PROVIDER_ERROR_CATEGORIES,CODEX_ACCOUNT_RESTART_PROVIDER_ERROR_TEXT_PATTERN,shouldRestartCodexThreadAfterEvent,restartCodexThreadForNextTurnIfNeeded,codexThreadsRequiringAccountRestartrebuildBeforeNextTurnReason) and raisesauthRequired/rateLimited; the genericrestartRecommendedaction stays for bridges that cannot self-healisAcpProviderId(pid) && code === NO_ACTIVE_TURNsteer branchstaleTurnbranchisAcpProviderId,ProviderErrorCategory,BRIDGE_JSON_RPC_ERRORSRestartCodexThreadForNextTurnArgsis renamedRestartThreadBridgeArgs(it now only servesrestartThreadBridgeIfRecommended). TheCODEX_PROVIDER_IDguards that remain (resolveProviderProcessKey,isThreadScopedCodexProcess, the pre-experiment idle-reap gate) belong to the per-thread process lane and go in L3.Single-site exception in
plugins/provider-acp/src/bridge/bridge.ts(coordinator-approved): theturn/steerNO_ACTIVE_TURNrejection now carriesdata: { recovery: { kind: "staleTurn", retryable: false } }. Nothing else in that plugin changes; the error code stays for the wire.Ratchet:
scripts/provider-literal-baseline.json148 → 142 (runtime.ts12 → 6).Not a wire change: no
HOST_DAEMON_PROTOCOL_VERSIONbump (nothing between server and daemon moved) and noPROVIDER_BRIDGE_PROTOCOL_VERSIONbump (the ACPdatais the optional field L1 added).How you verified
Tests:
retries a Codex rename while its new rollout file is still empty,stops retrying a Codex rename once its rollout stays empty(replaced bydoes not retry a rename: the bridge owns the not-ready-rollout ladder, onethread/name/seton the wire), and the two account-restart tests inruntime.process-lifecycle.test.ts(their counterparts:bridge.recovery.test.tsin the codex plugin and therestartRecommendedcases inruntime.recovery.test.ts).maps a bridge no-active-turn error to a stale steernow sends thestaleTurnhint (the ACP bridge's shape) and is no longer provider-gated.runtime.recovery.test.tsruns under provider idfake, so it already proved the typed path with the text gates unable to fire; it is unchanged and green.Oracle (
--concurrency 4): typecheck 9/9; tests agent-runtime 450, provider-acp 196, provider-codex 201, scripted-echo 1, host-daemon 555 — green. Parity acp-cursor 10 passed / 1 skipped, zero diffs (thedatarides an error response, never an event). A4: 307 threads, 93,534 rows, zero diffs. Ratchet--base origin/main: 142 ≤ 148, baseline written.Part of the provider-plugin migration (WS4). L3 collapses the codex per-thread process lane.