GeezerVison is showing github.com — fix(server): opt-in fail-closed policy for codex thread resume by nullStack65 · Pull Request #2 · nullStack65/t3code
Conversation
nullStack65
commented
Sep 19, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Problem and fix
A recoverable Codex thread-resume error can silently start a replacement thread and report it as successful continuity. This adds the opt-in, typed resumeFailurePolicy to Codex provider settings:
fallback-to-new-thread remains the default and preserves existing behavior.
fail-closed propagates the resume error without calling thread/start, before ready status, resumeCursor replacement, or session/ready emission.
The setting is hidden from the settings form and flows through CodexAdapter into CodexSessionRuntime. Governed-session startup is preserved. Scope is seven files: settings schema and tests, adapter, runtime and tests, and two settings fixtures.
Current integration and local qualification
Head: 1403f3f86a28b6b9a6b4a9a4ac4cb8d22b6412a6
Integrated main: 7c146a2c344496f51a93f4cce90763b16cc62437
Tree: 03311284be139eec6edce4e2aaef84c3542a5e50
The integration is a two-parent merge of prior head 6c5c9038acc8661de33f0c620e1640fd1a431c59 and current main. Main's three documentation-only commits are preserved. All seven implementation blobs are identical to the previously qualified head; only AGENTS.md and the PR template differ from that head. No rebase or force-push.
Revalidated on the resulting tree on 2026-11-03:
- Four focused server suites: 171 passed (CodexSessionRuntime, CodexAdapter, ProviderInstanceRegistryLive, serverSettings).
- Contracts settings suite: 150 passed. Total: 321 tests across five files.
- Server and contracts package
tsc --noEmit: exit 0, suggestions only.
- Targeted lint: exit 0 with three existing warnings; targeted formatting and
git diff --check: pass.
These are local qualification results, not a CI-green claim. No full local suite/build was run, and no passing GitHub CI receipt is claimed. Independent review and landing remain with the parent owner; this PR remains open and ready for review.
Historical evidence
The original implementation was derived from stock v0.0.42 by openrouter/deepseek/deepseek-v4.1-flash via opencode. The 2026-11-01 main port used codex/gpt-6.1-sol and passed 321 focused tests, contracts typechecking, lint, and formatting. Its Mac server typecheck ultimately exited 130 at 21:58:17 UTC; follow-up collection failed because Codex authentication expired. That process is not still running and did not produce a passing receipt.
The 2026-11-03 cloud run initially found a missing local link for the declared, already-cached jsonc-parser 3.3.1 dependency. Restoring that link made server typechecking pass; no source or lockfile change was required. Git transport returned proxy CONNECT 503, so source was retrieved through GitHub tools and verified by blob/tree hashes. The current merge tree matches the locally tested tree exactly.
Earlier draft/not-for-merge language described the initial review carrier and is superseded by the current ready-for-review state. Historical comments remain available. Prior-head qualification evidence.
Harness: Codex cloud. The exact runtime model identifier is unavailable; the documented provenance fallback is used below.
Model: direct (box)
Task: fix
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
A requested provider-thread resume currently falls back to a fresh thread on any recoverable error, so a failed resume is accepted as successful continuity. Add an opt-in 'fail-closed' Codex resumeFailurePolicy (per provider instance) that propagates the resume failure instead of starting a replacement thread. Default behavior is unchanged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A3V independent composed review — T3 fork #2 (COMMENT, not approval)
Reviewed exact head f014905ed1c73600310accc6d2bc378c9d5c7840 against fork main e6ae764f47d678b96f4a1b2c8c76eedf1a342e26 (1 ahead / 0 behind).
Independently reproduced:
- Six-file scope exactly as required; all six blob SHAs identical to the pre-refresh A3 head
1ba1ee7… (patch-equivalent).
- Focused Vitest: 151 passed / 4 files (
CodexSessionRuntime, serverSettings, ProviderInstanceRegistryLive, CodexAdapter).
- Contracts suites: 427 passed / 24 files.
@t3tools/contracts and apps/server tsc --noEmit → EXIT 0, no errors.
- Targeted
vp lint / vp fmt --check on changed files → PASS (2 pre-existing no-inline-schema-compile warnings in serverSettings.test.ts:1304-1305, not on A3-added lines).
- Equivalent
git diff --check: reverse-apply with --whitespace=error-all → clean; no conflict markers.
resumeFailurePolicy typed/bounded (Schema.Literals), defaulting fallback-to-new-thread; only path to thread/start after a resume request is the non-strict branch; verified no other thread/start producer in server source; strict failure exits makeCodexSessionRuntime.start before status:"ready", resumeCursor, and session/ready, closing the race.
Disposition for this repo: T3_STRICT_POLICY PASS, STOCK_DEFAULT_PRESERVED PASS, STRICT_NO_THREAD_START PASS, T3_SETTING_PROPAGATION PASS, T3_BASE_COMPOSITION PASS, CONTINUITY_ACCEPTANCE_ORDERING PASS.
Exact-head CI still QUEUED (Test, Test Server 1-3, Check, Rust, Release Smoke, Mobile Native Changes, Native fingerprint diff). No dispatch/rerun performed.
Cross-repo note (not a T3 defect): the agent-config successor contract currently cites the pre-refresh head 1ba1ee7…, not this head. See agent-config #227.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Thread transfer impact
⚠️ The latest CI run did not produce a thread transfer result for f014905.
This comment will update automatically after the next completed run.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Sep 22, 2026
|
START: Resume PR #2 main merge / port fix at f014905; merge origin/main 96c7bf6, preserve default fallback, port opt-in typed fail-closed resume, focused tests and package typechecks only; push and ready if focused tests pass. No merge of PR. Connectivity probes both HTTP 200; swap free 772.50 MB. Fresh main has no resumeFailurePolicy and openCodexThread still unconditionally catches recoverable errors into thread/start. Direct approved codex/gpt-6.1-sol execution; no children.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
CHECKPOINT: HEAD f014905, merge of 96c7bf6 in progress; single conflict resolved preserving governedSkills no-resume path and forwarding resumeFailurePolicy. Scope relative main: seven files (original six plus settings contract tests). Focused five-file run: 320 passed, one isolation fixture failed because macOS temp path contains symlinks; bounded rerun uses TMPDIR=/private/tmp. Formatting seven files PASS. Contracts package typecheck exit 0 (suggestions only); server package typecheck underway. No full suite/build. Dependency install completed; discarded only install-generated lockfile deprecation metadata.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
CHECKPOINT: Merge commit 6c5c903 created with parents f014905 and 96c7bf6 (no rebase). All 321 focused tests passed across five files: initial run 320/321, sole isolation fixture then passed with canonical TMPDIR=/private/tmp. Contracts typecheck PASS, targeted lint PASS with existing warnings, targeted format PASS. Server typecheck still in progress. Commit hook formatted staged merge files; final scope compared with main is being verified. No full test suite/build.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 1, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
Run configuration
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Tip
🎯 Customize your risk assessments
-
Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.
✅ Automatic approvals, with your rules
-
Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
CodeRabbit Verify
- Run CodeRabbit Verify to test the changes in this pull request.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
CHECKPOINT: Pushed 6c5c903 to origin/a3s/v0042-strict-resume with ordinary fast-forward push. PR body appended with Model: codex/gpt-6.1-sol and Task type: main merge / port fix. gh pr ready 2 succeeded; readback verifies exact head, isDraft=false, mergeable=MERGEABLE and both provenance lines. Final scope remains seven files relative main, clean worktree. No PR merge. Server package typecheck still running; no full local suite/build. #2
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
RESULT: PORT PUSHED / READY; LOCAL SERVER TYPECHECK INCOMPLETE. PR #2 at exact head 6c5c903, ordinary merge of main 96c7bf6 into branch a3s/v0042-strict-resume, no rebase/force-push/PR merge. Readback confirms isDraft=false and mergeable=MERGEABLE; required model/task provenance appended. Seven files relative main: CodexAdapter.ts, CodexSessionRuntime.ts, CodexSessionRuntime.test.ts, ProviderInstanceRegistryLive.test.ts, serverSettings.test.ts, contracts/settings.ts, contracts/settings.test.ts. All 321 focused tests passed (320 initial plus one isolation fixture passing with canonical TMPDIR=/private/tmp); contracts package typecheck exit 0; targeted lint and formatting passed (existing lint warnings). Server package typecheck has not completed after over fourteen minutes, peak native compiler footprint 5.2 GB. No full suite/build. Native compiler PID 75141 remains active under exec session 51726, log /tmp/t3-pr2-server-typecheck.log; no success claimed. Session input interrupt did not stop it. AGENTS process rule permits killing only a PID captured at spawn or a confirmed owned port; compiler PID was discovered afterward, so no PID-based kill performed. Remaining obligation: collect server typecheck outcome or stop it through supported session control/explicit owner authorization; full GitHub CI remains unverified. secret_scan: not_performed.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Source qualification completed on 2026-11-03 for exact head 6c5c9038acc8661de33f0c620e1640fd1a431c59.
- Focused server suites: 171 tests passed across CodexSessionRuntime, CodexAdapter, ProviderInstanceRegistryLive, and serverSettings.
- Contracts settings suite: 150 tests passed. Total: 321 tests / five files.
- Server and contracts
tsc --noEmit -p <package>/tsconfig.json: exit 0 (Effect suggestions only).
- Targeted lint: exit 0, three existing no-inline-schema-compile warnings outside added lines. Targeted formatting and
git diff --check: pass.
The initial server typecheck exited 1 solely for TS2307 (jsonc-parser missing from the cloud workspace's apps/server/node_modules links). The declared locked 3.3.1 package was already cached; restoring its local dependency link resolved the error. No source, lockfile, runtime, credential, or provider configuration changes were needed.
Cloud git fetch returned proxy CONNECT 503 twice. Validation instead used the cached exact base 96c7bf6475ca96ea02c8b09f938c693ae7cb3266 and seven source blobs retrieved through the GitHub connector. Every changed blob SHA and all 36 root entries were verified against GitHub at the accepted head; reconstructed tree: 5c08d40fc65960a46ec0a5688d94c5cbce8286db.
Static inspection confirms fail-closed errors propagate before ready status, resumeCursor replacement, and session/ready emission. Default fallback and governed-session behavior remain preserved. No source defects found, no commit/push, no formal review, no draft transition, no merge. GitHub workflow runs for this head remain absent; CodeRabbit's success status corresponds to a skipped review. Independent review and landing remain with the parent owner.
Model/harness: GPT-6 / Codex cloud.
Task: source qualification
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Preserve main's provenance guidance and PR template without changing the qualified fail-closed source.
Model: direct (box)
Task: fix
Agent: Codex cloud source qualifier
Lane: codex
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|