Repository navigation
fix: let silent Code Mode commands reach their own timeout - #200670
Merged
Merged
Conversation
Bind the admitted run hook context when cataloging already wrapped tools, preserving the execution owner deadline for silent nested commands. Keep reply watchdog policy unchanged. Add a guest bridge regression proving the 900-second window and delivery of the host timeout at 1800 seconds.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Contributor
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
steipete
enabled auto-merge (squash)
November 17, 2026 15:42
steipete
disabled auto-merge
November 17, 2026 15:47
Contributor
Author
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 18, 2026
Bind the admitted run hook context when cataloging already wrapped tools, preserving the execution owner deadline for silent nested commands. Keep reply watchdog policy unchanged. Add a guest bridge regression proving the 900-second window and delivery of the host timeout at 1800 seconds.
RomneyDa
pushed a commit
that referenced
this pull request
Nov 19, 2026
Bind the admitted run hook context when cataloging already wrapped tools, preserving the execution owner deadline for silent nested commands. Keep reply watchdog policy unchanged. Add a guest bridge regression proving the 900-second window and delivery of the host timeout at 1800 seconds. (cherry picked from commit eb768cb) Co-authored-by: RomneyDa <[email protected]> Release adaptation: none; source change applies to the pinned beta baseline. Follow-up disposition: bounded pinned-main same-path audit recorded in the lane report; cross-lane changes remain parent-owned. (cherry picked from commit bd9b08ccbf6338bb667e6f1d5081dc69e888c2f3)
RomneyDa
added a commit
that referenced
this pull request
Nov 19, 2026
Release adaptation: fix the missing existing wrapper import in the #200670 regression so the release proof exercises the intended deadline behavior. Upstream eb768cb also omits this import. Follow-up disposition: test-only correction; no additional runtime owner or policy. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 67b0c109103b41228e6fd8070e05a0b27bf421dd)
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.
Related: #200601, #200647.
What Problem This Solves
In release a117ca5 on November 17, eleven sandboxed Code Mode turns were aborted after 15 minutes without activity. A silent sandbox exec could still be within its default 1,800-second timeout when the reply watchdog terminated the whole turn; three consecutive retries reproduced the same outcome.
User Impact
In-process Code Mode host calls retain the tool execution owner's deadline, allowing a silent command to finish or return its own timeout to guest code. No configuration or watchdog thresholds change.
The worker path still lacks per-tool deadline transport. Its Gateway projection uses the enclosing execution deadline; completing that path requires a protocol schema change, deliberately excluded from this PR.
Why This Change Was Made
Catalog preparation now rebinds the admitted run context through the existing hook rewrap operation, including tools that already have a hook wrapper. It preserves the original hook context and wrapper metadata while giving the nested invocation its watchdog owner.
Deadline ownership and scope
Direct exec already publishes the supervisor's enforced process deadline at
src/agents/bash-tools.exec-runtime.ts:699. Direct admission supplies the watchdog attempt throughsrc/agents/harness/tool-authority.runtime.ts:308–314; the tool hook consumes it atsrc/agents/agent-tools.before-tool-call.wrapper.ts:253–255. The liveness owner binds the live deadline getter tobeginToolatsrc/infra/diagnostic-tool-execution-liveness.ts:56–62. The existing watchdog honors that deadline plus its quiet allowance atsrc/sessions/session-controller.watchdog.ts:588–595; there is no blanket 15-minute cap.For in-process Code Mode,
src/agents/embedded-agent-runner/run/attempt-tool-prepare.ts:461–463captures the explicit watchdog owner. Before this change,src/agents/tool-search-catalog.ts:195–196skipped already wrapped tools, discarding that context. When the guest bridge dispatched without the original ambient caller frame, the host exec's deadline carrier had no watchdog record, leaving the outer Code Mode exec to expire at 900 seconds. The fix is at this existing catalog boundary; it adds no parallel deadline tracker. Accepted existing edge: once a failed host call settles, the existing semantic-stall policy resumes; this patch does not add an allowance for delayed guest/model settlement.The worker catalog executor added by #200601 forwards host name/callId start/end events at
src/worker/embedded-agent-live.runtime.ts:369–389.packages/gateway-protocol/src/schema/worker-admission.ts:358–382is a closed tool-event schema without a deadline field, andsrc/gateway/worker-environments/worker-turn-run-owner.ts:231–236projects the whole execution deadline. Those files and the schema remain unchanged.The abandoned-call lane (#200647) owns cancellation in
src/worker/worker-gateway-tools.ts. The file-queue abort lane owns the keyed queue, file mutation queue and sandbox read/fs adapters. This PR touches none of their files and is rebased on the landed worker cancellation change.Simplification: reuse the existing context rewrap rather than adding deadline state or changing watchdog policy. Against the base: +5 net production lines, +65 test lines, +5 documentation lines. The test growth is one regression through the actual guest bridge and subscribed executor, covering a boundary existing exec-liveness tests did not exercise.
Evidence
One fake-timer regression runs a guest
callValueagainst a silent host exec-like tool with a real 1,800-second timer and published execution deadline. The base aborts withReply operation stalled/no_activityat the quiet-tool window. With the fix, the turn survives 900 seconds, the tool's own timeout reaches the guest, and guest code continues successfully.pnpm test src/agents/code-mode.bridge.lifecycle.test.ts --maxWorkers=1 -- -t 'preserves a silent host exec deadline'— red on base, green with the fix.pnpm test src/agents/code-mode.bridge.lifecycle.test.ts src/agents/tool-search.test.ts src/agents/tool-search-catalog-reuse.test.ts src/agents/agent-tools.prefix-stability.test.ts src/agents/bash-tools.exec-liveness.test.ts --maxWorkers=1— 5 files, 99 tests passed.git diff --checkpassed.pnpm buildpassed.235e38488bf2cac52d29ffde71c7e066b69f1649, P0–P2: scoped-clean, no accepted/actionable findings. The subsequent rebase preserves the patch; CI verifies the published head.CI run 44115757625 has an unrelated failure in
checks-node-changed-1:code-mode-swarm.test.ts/ “reuses a registered collector for the same invocation without double-spawn.” The exact case also fails locally with this PR’s production change removed: the spawn fixture receives an undefined replay key at lines 684–686. Its swarm/runtime/spawn/validation sources are unchanged, and the fixture supplies no hook context, so the modified catalog branch is not selected. This is recorded as an inherited failure; no CI rerun or unrelated repair is claimed.Release-note context: prevent silent in-process Code Mode exec calls from losing the reply before their own timeout.