fix(codex): retry child model lookup after empty rollout #15285
main fromrefs/pull/15285/head·opened View on GitHubCodex can discover a child thread before its rollout metadata is readable. The existing lookup gave up after that transient failure, leaving the child model unknown.
Retry the existing read-first metadata lookup at most twice, 250 ms apart, only for Codex internal errors identifying an empty rollout. Keep the five-second total deadline, full model selection metadata, and newer settings/reroute precedence. Interrupted, failed, and cancelled children stop further lookup work.
Maintainer takeover of #15285, crediting @niko-itswld. Contributor history is preserved; current main was merged. The original six added test cases were reduced to three; existing race and lifecycle cases now cover retry cancellation without duplicate fixtures.
Validation:
- Before the fix: two regression failures, 27 passing controls against current main.
- After: 172 adapter tests and six Codex orchestrator replay integrations pass.
- Scoped server typecheck, lint, formatting, and whitespace checks pass; two existing unused-declaration lint warnings remain.
- Independent Opus and Sol reviews: one full round, no code blockers. Opus independently reran all 172 adapter tests; Sol inspected the source and validation logs.
Headless Linux replay verification only. Live Codex account behavior and macOS, Windows, iOS, Android, and Electron were not verified. No frontend or contract changes. The coordinator owns CI handoff and landing; this PR remains unmerged.
Models/harness: GPT-6 Astra (tests), GPT-6.1 Sol (implementation), Claude Opus 5.5 and GPT-6 Sol (independent reviews), through Codex and Claude in T3 Code.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
juliusmarminge added labelsmacroscope-review
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
- Review profile: CHILL
- Plan: Advanced
- Run ID:
ea136aba-8fcb-4e93-9885-548c9be1eced
📥 Commits
-
Reviewing files that changed from the base of the PR and between 19a97058dc1b539f273e12367c08ad407faac755 and 03c92e7ad31ba6ec1ba18d4f84b4f71a4b9cbab4.
📒 Files selected for processing (2)
-
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.testkit.tsapps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts
🚧 Files skipped from review as they are similar to previous changes (1)
-
- apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
📝 Walkthrough
-
The Codex adapter now retries selected empty-rollout errors during missing child-model lookups. It skips lookups when model metadata is known or the child task is interrupted, failed, or cancelled. Replay tests cover retry limits, unrelated errors, metadata races, and interruption.
Changes: Subagent model lookup
Layer / File(s) Summary Guarded retry and metadata handling
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts,apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.testkit.ts,apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.tsThe adapter skips lookup when the model is known or the task is terminal. It retries matching empty-rollout errors up to two times, 250 ms apart, and logs remaining errors. The replay callback now types its request error. Tests cover retries, race cases, and interruption. Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers:
juliusmarminge
### Architecture SummaryMerge Risk: ⚪ Minimal · up to
03c92-
The bounded retry handles the modeled empty-rollout failure; no actionable merge-blocking risk remains in the reviewed changes.
Architecture risk: 🔵 Low · up to
03c92The change affects 1 system.
Changed systems:
apps/serverArchitecture concerns No architecture-level concerns identified.
Review details
-
Systems and components
- observed — apps/server (service) was modified; 3 changed files map to changed impact.
Before / after behavior
- observed — Modified behavior in apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts: Adds the
CodexErrorsimport used by the child-metadata lookup test cases. - observed — Modified behavior in apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts: Narrows the replay harness’s optional child-metadata callback error type from unrestricted
unknowntoCodexAppServerRequestError. - observed — Modified behavior in apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts: Adds child model lookup tests for transient empty-rollout errors, persistent empty-rollout failures, and unrelated errors. The cases assert recovery after one failure, a three-attempt limit for persistent failures, and no retry for unrelated errors; they also verify the reported model and that retries do not continue afterward.
- observed — Modified behavior in apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts: Expands the metadata-race cases to cover both
thread/settings/updatedandmodel/rerouted, with each tested against stale and failed older lookups.
Pre-merge checks:
4 · 1-
Failed checks: 1 warningCheck name Status Explanation Resolution Linked Issues check Issue #15250asks T3 to show the child model when metadata becomes available and not leave it permanently unknown after a temporary lookup failure.CodexAdapterV2.tsretries the matching empty-rollo…Add a later metadata re-read trigger or equivalent recovery path so the child model can update if metadata becomes available after the initial retry window. Preserve the behavior that unknown child settings do not inherit the parent model. Passed checks: 4 passed-
Check name Status Explanation Out of Scope Changes check The whole-PR diff changes the Codex V2 adapter, its replay test helper, and focused adapter tests. The retry implementation, typed test callback, regression tests, and docstrings all support the #1525…Docstring Coverage Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. Title check The title is concise, specific, and accurately summarizes the main change: retrying Codex child model lookup after an empty rollout. Description check The description explains the problem, change, scope, verification results, limitations, and implementation context. It provides detailed focused test results and identifies unverified platforms. The s… Full details: Out of Scope Changes check
-
Explanation
The whole-PR diff changes the Codex V2 adapter, its replay test helper, and focused adapter tests. The retry implementation, typed test callback, regression tests, and docstrings all support the
#15250metadata-recovery objective. No unrelated changes are present in the whole-PR diff.
Full details: Description check
-
Explanation
The description explains the problem, change, scope, verification results, limitations, and implementation context. It provides detailed focused test results and identifies unverified platforms. The scope section references the maintained PR, although it does not include an explicit approval comment.
-
Full details: Linked Issues check
-
Explanation
Issue
#15250asks T3 to show the child model when metadata becomes available and not leave it permanently unknown after a temporary lookup failure.CodexAdapterV2.tsretries the matching empty-rollout error twice, and tests cover recovery, metadata precedence, interruption, and retry limits. The adapter then stops after three failed requests. The persistent-error test confirms that it makes no later lookup, so metadata that becomes available after that window still leaves the model unknown. The adapter does not fall back to the parent model.Resolution
Add a later metadata re-read trigger or equivalent recovery path so the child model can update if metadata becomes available after the initial retry window. Preserve the behavior that unknown child settings do not inherit the parent model.
-
- Fix all pre-merge checks with AI
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
juliusmarminge assignedjuliusmarminge
Taking over this one as maintainer for batch codex-06. I will preserve contributor history, keep bounded empty-rollout retries compatible with the current metadata lookup, and reduce regression coverage to the behavior needed. Landing stays with the coordinator.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
niko-itswld(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Approvability#
Verdict: Approved at
c6118bcMacroscope's review found this PR approvable — This is a narrowly scoped Codex reliability fix that retries only a specific transient empty-rollout lookup failure, preserves the existing timeout and precedence behavior, and adds targeted regression coverage. It introduces no schema, deployment, security-sensitive, default, or static-analysis changes.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).