Skip to content

fix(agents): honor configured CLI resume timeouts#90912

Merged
vincentkoc merged 7 commits into
openclaw:mainfrom
ai-hpc:ai-hpc/90764-embedded-timeout
Jun 11, 2026
Merged

fix(agents): honor configured CLI resume timeouts#90912
vincentkoc merged 7 commits into
openclaw:mainfrom
ai-hpc:ai-hpc/90764-embedded-timeout

Conversation

@ai-hpc

@ai-hpc ai-hpc commented Jun 6, 2026

Copy link
Copy Markdown
Member

Summary

  • Honor configured agent/default timeouts when resolving the no-output watchdog for resumed CLI-backed embedded runs.
  • Plumb the existing explicit run-timeout signal through CLI dispatch so per-run timeouts keep the same behavior as cron.
  • Keep inherited user resumed sessions on the existing 180s watchdog ceiling when no timeout intent is configured.

Real behavior proof

behavior: A resumed CLI-backed embedded run with a deliberate 600s timeout should not keep the default 180s no-output ceiling. The watchdog should scale from the configured run timeout, while ordinary inherited user resumes keep the existing 180s guard.

environment: Local source checkout rebased on 0a08625d79, Node v22.22.2, pnpm 11.2.2, branch ai-hpc/90764-embedded-timeout.

steps:

  1. Checked current github/main source in src/agents/cli-runner/reliability.ts: resumed CLI runs only switch to fresh watchdog defaults when trigger === "cron", so user-triggered resumed runs stay on CLI_RESUME_WATCHDOG_DEFAULTS.maxMs = 180000.
  2. Applied the fix and ran a resolver probe for a 600s resumed CLI run.
  3. Added dispatch-level coverage proving timeout: "600" reaches runAgentAttempt as runTimeoutOverrideMs: 600000.
  4. Ran focused CLI reliability tests, the touched agent-command dispatch test, the attempt-execution CLI test, and the core type gate.

evidence:

{
  "inherited": 180000,
  "configured": 480000,
  "explicitRun": 480000,
  "cron": 480000
}

observedResult: After the fix, configured/default and explicit per-run 600s resumed CLI runs resolve the no-output watchdog to 480s. A plain inherited user resume still resolves to 180s, preserving the default guard.

notTested: I did not replay the direct custom-api Anthropic run from #90764. This PR covers the confirmed CLI-backed resumed-session watchdog branch only. I also did not run a live long-running CLI provider session because the resolver path and CLI reliability tests cover the timeout calculation without waiting 180s.

Verification

  • OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test src/agents/cli-runner.reliability.test.ts
  • OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test src/agents/cli-runner.reliability.test.ts -- -t resolveCliNoOutputTimeoutMs
  • OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test src/agents/agent-command.live-model-switch.test.ts -- -t "passes explicit timeout overrides"
  • OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test src/agents/agent-command.live-model-switch.test.ts
  • OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test src/agents/command/attempt-execution.cli.test.ts
  • pnpm tsgo:core:test
  • OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 pnpm check:changed --base github/main --head HEAD

Related: #90764

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S labels Jun 6, 2026
@clawsweeper

clawsweeper Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 10, 2026, 9:58 AM ET / 13:58 UTC.

Summary
The PR propagates explicit CLI run-timeout intent and configured agent timeout presence into resumed-run watchdog selection while preserving the 180-second ceiling for inherited user resumes.

PR surface: Source +30, Tests +53. Total +83 across 8 files.

Reproducibility: yes. at source level: current main applies the 180-second resumed watchdog despite deliberate longer timeout intent, and the focused resolver path clearly demonstrates that mismatch. The broader custom Anthropic scenario has not been reproduced.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

Maintainer options:

  1. Land the scoped CLI fix (recommended)
    Accept the longer configured watchdog window for resumed CLI runs and keep the broader linked report open until its non-CLI path is independently verified.
  2. Preserve the fixed resume ceiling
    Pause or close this PR if maintainers want the 180-second no-output limit to override deliberate longer run timeouts for all user-triggered resumed CLI sessions.

Next step before merge

  • [P2] No concrete mechanical defect needs repair; a maintainer should explicitly accept or reject the longer stalled-process retention window and then land or close this member-authored PR.

Security
Cleared: The focused patch only changes internal timeout propagation, watchdog selection, and tests; it introduces no dependency, workflow, permission, secret, or supply-chain changes.

Review details

Best possible solution:

Land the narrow timeout-intent correction if maintainers accept configured run timeouts as authoritative for resumed CLI watchdog scaling, while keeping the broader linked issue open for independent reproduction of its custom-provider path.

Do we have a high-confidence way to reproduce the issue?

Yes at source level: current main applies the 180-second resumed watchdog despite deliberate longer timeout intent, and the focused resolver path clearly demonstrates that mismatch. The broader custom Anthropic scenario has not been reproduced.

Is this the best way to solve the issue?

Yes for the confirmed CLI-backed path: carrying explicit timeout intent is narrower and more maintainable than inferring intent from resolved values, and it preserves backend overrides and inherited resume behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: reasoning high; reviewed against bb6e47729cf8.

Label changes

Label justifications:

  • P2: This is a focused reliability correction for a bounded resumed CLI agent path with limited blast radius.
  • merge-risk: 🚨 availability: Merging intentionally extends how long configured resumed CLI runs may remain silent before process termination.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author has repository member status, and the write-access exception permits the focused resolver output and local tests to serve as recorded proof without an external-contributor live-proof gate.
Evidence reviewed

PR surface:

Source +30, Tests +53. Total +83 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 6 38 8 +30
Tests 2 54 1 +53
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 92 9 +83

What I checked:

Likely related people:

  • Vincent Koc: Current-main blame and file history associate the CLI watchdog helper and its fresh/resume bounds with this contributor's commit. (role: introduced behavior; confidence: high; commits: 52bc2a12bc8c; files: src/agents/cli-runner/reliability.ts, src/agents/cli-watchdog-defaults.ts, src/agents/cli-runner/execute.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jun 6, 2026
@ai-hpc
ai-hpc force-pushed the ai-hpc/90764-embedded-timeout branch from 4ccca30 to 86df1c3 Compare June 6, 2026 12:41
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 6, 2026
@ai-hpc
ai-hpc force-pushed the ai-hpc/90764-embedded-timeout branch from 86df1c3 to 5069567 Compare June 10, 2026 12:49
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 10, 2026
@ai-hpc
ai-hpc force-pushed the ai-hpc/90764-embedded-timeout branch 3 times, most recently from bb915da to a10c9c1 Compare June 11, 2026 00:08
@vincentkoc vincentkoc self-assigned this Jun 11, 2026
@vincentkoc
vincentkoc force-pushed the ai-hpc/90764-embedded-timeout branch from a10c9c1 to b7b061f Compare June 11, 2026 01:05
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer verification complete.

The original change had the right intent but timeout provenance was incomplete across normal channel runs, queued follow-ups, heartbeats, and CLI-backed subagents. I moved the decision to the shared CLI boundary, carried explicit reply timeout provenance through the queue/fallback paths, and preserved the shorter inherited resume watchdog for subagents.

  • Focused proof: node scripts/run-vitest.mjs src/agents/agent-command.live-model-switch.test.ts src/agents/cli-runner.reliability.test.ts src/auto-reply/reply/agent-runner-execution.test.ts src/auto-reply/reply/followup-runner.test.ts — 354 passed.
  • Fresh autoreview after all fixes: clean; no accepted/actionable findings.

Best-fix judgment: landable. The final shape distinguishes deliberate/configured run timeouts from inherited defaults at the shared CLI owner boundary instead of guessing from the final numeric timeout.

@vincentkoc
vincentkoc merged commit 0328ca5 into openclaw:main Jun 11, 2026
22 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 11, 2026
* fix(agents): honor configured CLI resume timeouts

* fix(agents): pass explicit CLI timeout overrides

* fix(agents): preserve timeout provenance

* test(agents): cover configured timeout provenance

* fix(agents): resolve CLI timeout provenance centrally

* fix(agents): carry reply timeout provenance

* fix(agents): forward CLI run lane

---------

Co-authored-by: Vincent Koc <[email protected]>
badgerbees pushed a commit to badgerbees/openclaw that referenced this pull request Jul 8, 2026
* fix(agents): honor configured CLI resume timeouts

* fix(agents): pass explicit CLI timeout overrides

* fix(agents): preserve timeout provenance

* test(agents): cover configured timeout provenance

* fix(agents): resolve CLI timeout provenance centrally

* fix(agents): carry reply timeout provenance

* fix(agents): forward CLI run lane

---------

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants