Repository navigation
Conversation
Track started searches until their completion and close remaining search items and execution nodes with a non-success terminal status. Preserve completed searches. Implemented with OpenAI GPT-6 via the Codex harness.
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Unfinished Codex web searches now receive a terminal status when their turn ends instead of remaining marked as running. The change is confined to search-status reporting and does not alter external search execution or product defaults. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Problem
Fixes #22248.
If Codex emits
item/started(webSearch)but no correspondingitem/completed, a terminal turn leaves the search item and its execution node stored asrunning, without a completion timestamp. A deliberately omitted native notification reproduces this on the current branch base; the original October 3 incident's missing frames still leave its cause unknown.Change
Track unfinished searches in their native turn context and remove them when their own completion arrives. At turn termination, close the remaining search items and nodes using
cancelledfor an otherwise completed turn, or the turn'sfailed/interruptedstatus. Preserve their identity, query, start time, and ordinal, and leave completed searches unchanged. A completed turn does not imply that an unobserved search succeeded.Scope and approval
This is a focused fix for an inconsistent provider lifecycle state, submitted under the small, obvious bug-fix exception. It extends the existing terminal cleanup and test table, with no settings, model-facing text, client UI, or T3 wire-contract changes. Web, desktop, mobile, and remote connections use the same server projections; only the Codex adapter changes. Historical stored rows are not migrated or repaired.
Verification
Windows, Node.js 26.12.1, checkout-local locked dependencies, source base
df13391fb1b321b810cfab0e721ca858c65b931f.apps/server,vp test run src/orchestration-v2/Adapters/CodexAdapterV2.test.ts -t 'settles unfinished': 4 search cases failed, 3 existing compaction cases passed. Searches emitted only[running]instead of[running, cancelled/failed/interrupted].apps/server,vp test run --passWithNoTests src/orchestration-v2/Adapters/CodexAdapterV2.test.ts src/provider/AgentContextBudget.test.ts: 151 passed, 2 files. The unchanged owning-package config avoids the previously reproduced root-workspace Vitest startup stall in this Windows checkout.The mandatory
vp run check:changed --concurrency 1was attempted and stopped after hanging in its pre-check Windows junction scan, tracked by #32023. The wrapper did not pass. Every selected step was derived fromscripts/check-changed.tsand.github/scripts/ci-changes.cjsfor this two-file diff, then run individually with identical scope/settings:--checkt3,@t3tools/evals,@t3tools/scriptsNo unused-patch, React compiler, doc-reader, or Node test step was selected. No cache or test configuration was altered, no check was weakened, and no repo-wide test suite was run.
Exact equivalent commands from the repository root
The selected Vitest command and owning-package directory are given above.
Integrated application verification: the production CLI and authenticated MCP/HTTP called the real server, orchestrator, persistence, Codex adapter, client and protocol decoder. The external Codex boundary was a deterministic JSONL subprocess; its model id was fixture metadata and made no model/API requests. Baseline and fixed phases each used a fresh disposable home, provider home, workspace and SQLite database. For Stop, the driver awaited the persisted running search, issued
t3_thread_interruptover MCP, observed the nativeturn/interruptrequest, and compared the completed search's stored payload byte-for-byte before and after.Commands used by the external driver (temporary paths and ids elided):
Sanitized runtime transcript, read from persisted run/item/node projections:
Limitations: no live Codex CLI/model, naturally occurring missing notification, client UI, or historical-data repair was tested or claimed. The fixture establishes the application behavior for the specified protocol sequence; it does not identify the cause of the historical report. Raw server logs and disposable authentication material are excluded from this evidence.
Implemented with OpenAI GPT-6 via the Codex harness.