feat(tui,cli-runner): expose streamingWatchdogMs config + bump watchdog defaults#79997
Conversation
…og defaults F16 — TUI streaming-watchdog wiring: - Adds `cli.tui.streamingWatchdogMs` config field (zod-validated, optional). - `runTui` now reads this value and passes it to `createEventHandlers`, closing the gap where `context.streamingWatchdogMs` was a consumer-side knob with no producer-side wiring. - Raises the in-code default from 30s to 600000ms (10 minutes). The 30s default tripped on long-reasoning models, slow tool runs, and SSE keepalive gaps; the 10m value matches the empirically validated downstream patch. - Adds `resolveTuiStreamingWatchdogMs(config)` helper + unit tests for config-shape edge cases (NaN, negative, Infinity, fractional, string). - Adds tui-event-handlers test verifying the new default fires at 10m (not 30s) when no override is supplied. F18 — CLI watchdog defaults: - Raises `CLI_FRESH_WATCHDOG_DEFAULTS.maxMs` from 600000 (10m) to 3600000 (60m). - Raises `CLI_RESUME_WATCHDOG_DEFAULTS.maxMs` from 180000 (3m) to 3600000 (60m). - Per-CLI-backend overrides at `cli.watchdog.fresh.maxMs` / `.resume.maxMs` continue to apply unchanged; this commit only moves the fallback ceiling so users without a per-backend override don't see false aborts on long but legitimate runs. Backward compatibility: - `cli.tui.streamingWatchdogMs` is optional; existing configs without it pick up the new 10m default rather than the prior 30s. - The CLI watchdog defaults change only affects callers that did NOT set their own per-backend ratio/min/max, where previously the computed `maxMs` ceiling was 600000/180000. - All existing tests for `resolveCliNoOutputTimeoutMs` continue to pass because their assertions (e.g. 480000 = 600000 * 0.8) sit below the new ceiling. Docs: - `docs/gateway/configuration-reference.md` documents the new `cli.tui.streamingWatchdogMs` field with default + disable semantics. Co-Authored-By: Forge <[email protected]>
|
Codex review: needs real behavior proof before merge. Reviewed July 3, 2026, 11:49 PM ET / 03:49 UTC. Summary PR surface: Source +35, Tests +80, Docs +9. Total +124 across 9 files. Reproducibility: yes. at source level. Current main accepts an internal Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Refresh the branch against current main, put the TUI knob under the existing top-level Do we have a high-confidence way to reproduce the issue? Yes, at source level. Current main accepts an internal Is this the best way to solve the issue? No as submitted. The TUI config idea is useful, but the maintainable fix should align with current top-level Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9d68f877ac3e. Label changesLabel justifications:
Evidence reviewedPR surface: Source +35, Tests +80, Docs +9. Total +124 across 9 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
@josephfelixbamba thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward. Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive. Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it. |
feat(tui,cli-runner): expose
streamingWatchdogMsconfig + bump watchdog defaultsTable of Contents
Summary
cli.tui.streamingWatchdogMsthroughrunTui()→createEventHandlers({ streamingWatchdogMs }). The consumer site atsrc/tui/tui-event-handlers.ts:80was already readingcontext.streamingWatchdogMsbut no caller ever set it, so the in-source default fired unconditionally.Motivation
Operators running OpenClaw against long-reasoning models (Anthropic extended thinking, OpenAI reasoning chains) and slow tool runs were seeing the TUI report
idleand surface the "This response is taking longer than expected. Send another message to continue." prompt mid-run, while the model was still thinking — because the 30s streaming-delta watchdog was both (a) too short for modern models and (b) had no config knob.The same operators were also seeing CLI runs aborted by the no-output watchdog at the 10-minute / 3-minute ceilings (fresh / resume). Per-backend overrides at
cli.watchdog.fresh.maxMswere already supported, but the in-source defaults left every operator who hadn't tuned per-backend exposed.This PR closes both gaps in one stroke: exposes the TUI streaming-watchdog as a first-class config knob, and lifts the CLI ceilings to a value (60m) that matches the longest legitimate run we've observed in production while still allowing per-backend overrides to dial it back.
Changes
src/tui/tui-event-handlers.tsDEFAULT_STREAMING_WATCHDOG_MS: 30_000 → 600_000 (with explanatory comment)src/tui/tui.tsresolveTuiStreamingWatchdogMs(config); wired into the existingcreateEventHandlers({...})call insiderunTuisrc/config/types.cli.tsCliTuiConfigtype with optionalstreamingWatchdogMs?: number; added underCliConfig.tuisrc/config/zod-schema.tscli.tui.streamingWatchdogMs: z.number().int().nonnegative().optional()src/agents/cli-watchdog-defaults.tsCLI_FRESH_WATCHDOG_DEFAULTS.maxMs: 600_000 → 3_600_000;CLI_RESUME_WATCHDOG_DEFAULTS.maxMs: 180_000 → 3_600_000src/tui/tui.test.tsresolveTuiStreamingWatchdogMs(unset, happy, zero, fractional, hostile inputs)src/tui/tui-event-handlers.test.tsdocs/gateway/configuration-reference.mdcli.tui.streamingWatchdogMsknob in the existing## CLIsectionTest plan
Manual verification:
openclaw configure→ setcli.tui.streamingWatchdogMs: 60000→ run a long-reasoning prompt → confirm the "taking longer" notice fires at 60s.cli.tui.streamingWatchdogMs: 0→ confirm the watchdog is disabled.Backward compatibility
cli.tui.streamingWatchdogMsis optional. Configs that don't set it pick up the new in-source default of 10 minutes (was 30 seconds). This is a user-facing default change, justified above; flagged in the changelog.CLI_*_WATCHDOG_DEFAULTS.maxMschanges only affect callers that did not set their own per-backendcli.watchdog.fresh.maxMs/.resume.maxMs. The existingresolveCliNoOutputTimeoutMstest atsrc/agents/cli-runner.reliability.test.ts:999still passes because its computed value (480000 = 600000 * 0.8) sits below both the old and new ceilings.