Repository navigation
fix(codex): let collector waits finish their full timeout - #130939
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Head The production owner remains byte-identical to the earlier actual 600-second collector/SQLite proof: it returned structured pending state after 600043 ms, before the existing 630000 ms watchdog. That is runtime-boundary proof, not a live Codex model/app-server E2E session. The repair removes the executor's duplicate timeout decision; generic budgets remain owned by the resolver. Production LOC is neutral; tests net +6. Direct upstream inspection at The latest ClawSweeper entry is a review-start acknowledgement with no published findings or rank-up moves. Native review artifacts are refreshed for the new head; proceeding through required preparation and merge checks. |
|
Merged via squash.
|
…30939) * fix(codex): let collector waits finish their full timeout * test(codex): consolidate timeout argument cases
Closes #130938
Related: #111605 (the merged swarm-wait budget change).
What Problem This Solves
Fixes an issue where users waiting for collector subagents through the Codex harness receive a tool RPC timeout when requesting the supported 600-second wait. Instead of receiving the normal result listing unfinished children, the wait is aborted at its own deadline.
Why This Change Was Made
The timeout resolver already gives
agents_waita 630-second outer budget, including completion grace, but the executor reapplied the generic 600-second cap. This change removes that duplicate decision and uses the resolver's prepared budget in both normal Codex attempts and side questions.Generic tools retain their existing 600-second maximum. Cancellation, result projection, and timer cleanup remain unchanged. There are no configuration, protocol, dependency, persistence, or plugin SDK changes. Production LOC: +3/-3 (net zero); tests: +133/-127 (net +6).
User Impact
Codex collector waits can use the documented full 600-second budget and return the structured pending-child result. Other tools keep their existing timeout policies. This restores the documented swarm wait behavior without introducing a new setting or extending the collector's own wait limit.
Evidence
Before the fix, the regression cases returning a collector result at 600,000 ms and 605,000 ms both failed: the executor returned
success: falsewithOpenClaw dynamic tool call timed out after 600000ms while running tool agents_wait.The existingsessions_sendsetup-delay case passed. After the fix, all cases pass; additional tests enforce the generic 600-second cap, the collector's 630-second outer cap, and timer cleanup.CI on the first PR head exposed the repository max-lines limit (1,031 counted lines, maximum 1,000). Consolidating six existing timeout-argument cases into a typed table preserves every case name, input, and expected result, reduces the file to 997 counted lines, and passes the same repository lint configuration. The cleanup changes tests only; no suppression or weaker assertion was added.
After that test-only cleanup, all 288 tests passed across six files in 29.32 seconds. Scoped formatting and
git diff --checkpassed. A fresh isolated Codex autoreview considered the cleanup together with the complete final PR patch and found no issues at its P0-only threshold; it confirmed all six cases preserve their relevant inputs and assertions. The full typed-lint wrapper was also attempted, but failed before linting while preparing plugin SDK declarations because the existing shared dependency versions lackmarkdown-itStateInline andpi-tuiTuiMainScreen exports. Dependencies were not installed or reconciled in the worktree. Exact-head hosted CI remains required.A separate real-clock runtime proof completed at 600,043 ms, between
2026-08-27T08:06:01.043Zand2026-08-27T08:16:01.088Z. It registered a queued collector and required task row through canonical APIs in disposable SQLite state, then ran the actual Codex dynamic bridge, resolver, executor, and collector. It returned{"completed":[],"pending":["<run-id>"]}successfully; the 630,000 ms watchdog did not fire, and both durable rows remained queued. No fake timers or registry mocks were used. This was runtime boundary proof, not a live model or Codex app-server session. It ran on the earlier QA candidate based onac71743ca44a1927ddf8bcd3b32d71b60e27c0ac; the production patch is byte-identical to this patch; subsequent changes only consolidate the test cases. The timeout owner, normal caller, and collector remain unchanged in the newer baseline; side-question drift is an unrelatedrequestOptions()correction.Timeout policy remains with the resolver; cancellation, ordering, and cleanup are unchanged. No full build, current-head typecheck, or green hosted CI result is claimed here.
extensions/codex/src/app-server/dynamic-tool-execution.ts:503: resolves generic caps and collector completion grace before dispatch.extensions/codex/src/app-server/dynamic-tool-execution.ts:258: executor now uses the resolved budget without reclamping it.extensions/codex/src/app-server/run-attempt-server-requests.ts:209,238: resolves the budget, then invokes the executor.extensions/codex/src/app-server/side-question.ts:602,615: uses the same resolver and executor.src/agents/tools/agents-wait-tool.ts:211,286: returns current pending/completed state at its own bounded deadline.extensions/codex/src/app-server/client.ts:42,895: separate 660-second request timeout remains above the 630-second collector budget.dynamic-tool-execution.test.ts,dynamic-tool-execution.owner-timeout.test.ts,dynamic-tools.test.ts,run-attempt.dynamic-tools.test.ts,side-question.test.ts, andagents-wait-tool.test.ts.openai/codexat694edc23b22b4696400dc47663ecacd437623870:codex-rs/core/src/tools/handlers/dynamic.rs:137,216,227waits for and projects the host response;codex-rs/app-server/src/dynamic_tools.rs:18,38forwards it. No upstream requirement imposes this duplicate cap.The best fix is to preserve the single timeout-policy owner. Raising the generic executor cap would duplicate policy again and potentially widen unrelated tool limits; adding a tool-name exception in the executor would repeat the resolver's responsibility. Neither is needed.
Provenance: the older executor clamp traces to
a4c2e7f5cf1b42cc27e1d0f1573fe75c9d591875(Peter Steinberger, 2026-05-27). The conflicting collector grace was introduced in #111605, “improve(swarm): close out wait, phase, and worker follow-ups,” merged as7d4dccf959789331bc12cad908376ba12a3955edon 2026-07-20. Live GitHub metadata identifies @steipete as both that PR's author and merger. The bug is the incomplete interaction between these two policies, not the collector implementation.AI-assisted. Bounded Gitcrawl and live GitHub searches found no matching open duplicate at verification time. The open neighboring PRs #120077 (collector structured-output exposure) and #119056 (restart replay fencing) address different invariants and do not touch this timeout owner.