fix(tui): raise streaming watchdog threshold to 120s and suppress false-positive warning#69026
fix(tui): raise streaming watchdog threshold to 120s and suppress false-positive warning#69026jpruit20 wants to merge 1 commit into
Conversation
…se-positive warning
The TUI streaming watchdog was set to 30 seconds, which triggers
false-positive 'no stream updates' warnings during healthy long-running
agent turns (tool calls, sub-agent work, code generation, browser
automation). The alarming message ('backend may have dropped this run')
caused unnecessary user confusion.
Changes:
- Raise DEFAULT_STREAMING_WATCHDOG_MS from 30s to 120s
- Suppress the user-visible chatLog.addSystem() warning
- Internal reset behavior is fully preserved (activeChatRunId cleared,
activityStatus set to idle, render requested)
- The override context.streamingWatchdogMs still works for custom values
- Update tests to match suppressed message behavior
Greptile SummaryThis PR raises the streaming watchdog timeout from 30 s to 120 s and suppresses the user-visible warning entirely, keeping only the internal state reset (clearing The internal mechanics are sound, but completely removing the user-facing message means a genuine silent connection drop after 120 s will also produce no feedback — users will only see the status quietly change to Confidence Score: 5/5Safe to merge; the change is intentional and technically correct, with properly updated tests. All remaining feedback is P2 (UX/product preference around message suppression vs. softer messaging). No correctness, data-integrity, or security issues introduced. src/tui/tui-event-handlers.ts — watchdog silent-reset UX tradeoff worth discussing before shipping. Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/tui/tui-event-handlers.ts
Line: 106-110
Comment:
**Silent reset trades one UX problem for another**
When the watchdog fires after a genuine connection drop (not just a long tool call), the status silently flips from `streaming` → `idle` with zero indication to the user. They won't know whether their request completed normally or was dropped, and they have no prompt to resync. A softer, lower-anxiety message (e.g., `"Agent turn is taking longer than expected — send a new message if you'd like to resync."`) would avoid the false-positive alarm tone while still surfacing the event. Alternatively, a debug-level log (if the codebase has a logger) would at least preserve diagnosability without any user noise.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(tui): raise streaming watchdog thres..." | Re-trigger Greptile |
| /* Watchdog fires silently — the internal reset (clearing activeChatRunId, | ||
| setting status idle) still happens, but the user-visible warning is | ||
| suppressed to avoid false-positive noise during long-running agent | ||
| turns (tool calls, sub-agent work, code generation). The user can | ||
| always send a new message to resync if something is truly stuck. */ |
There was a problem hiding this comment.
Silent reset trades one UX problem for another
When the watchdog fires after a genuine connection drop (not just a long tool call), the status silently flips from streaming → idle with zero indication to the user. They won't know whether their request completed normally or was dropped, and they have no prompt to resync. A softer, lower-anxiety message (e.g., "Agent turn is taking longer than expected — send a new message if you'd like to resync.") would avoid the false-positive alarm tone while still surfacing the event. Alternatively, a debug-level log (if the codebase has a logger) would at least preserve diagnosability without any user noise.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/tui/tui-event-handlers.ts
Line: 106-110
Comment:
**Silent reset trades one UX problem for another**
When the watchdog fires after a genuine connection drop (not just a long tool call), the status silently flips from `streaming` → `idle` with zero indication to the user. They won't know whether their request completed normally or was dropped, and they have no prompt to resync. A softer, lower-anxiety message (e.g., `"Agent turn is taking longer than expected — send a new message if you'd like to resync."`) would avoid the false-positive alarm tone while still surfacing the event. Alternatively, a debug-level log (if the codebase has a logger) would at least preserve diagnosability without any user noise.
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: current main already replaced the alarming watchdog wording and added proof-of-life/reconnect recovery, while the remaining timeout, dedupe, and quiet-run UX work is tracked by narrower open watchdog items. The branch’s unique silent-reset approach would remove useful feedback for genuine silent drops. So I’m closing this here and keeping the remaining discussion on the canonical linked item. Review detailsBest possible solution: Keep the visible low-anxiety watchdog cue, preserve the shipped proof-of-life and reconnect recovery, and route timeout control or notice dismissal through the narrower canonical watchdog issues and PRs. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible. The existing fake-timer harness demonstrates the watchdog path by sending a delta, advancing beyond Is this the best way to solve the issue? No. Suppressing the notice entirely is not the best fix because the watchdog also covers genuine silent drops, while current main already softened the wording and related open work tracks threshold/config and dismissible-notice behavior. Security review: Security review cleared: The diff only changes TUI watchdog TypeScript and tests, with no dependency, workflow, secret, package, or artifact-handling changes. What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against c3e5d85ce1df. |
The streaming watchdog renders 'This response is taking longer than expected. Send another message to continue.' after 30s without a chat delta. If a delta or final then arrives — common for runs that are slow but not stuck — the notice stays in the log alongside the recovered response and contradicts what the user sees. Track the notice by runId in the chat log via a new `addPendingSystem` + `dismissPendingSystem` pair (mirroring the existing pendingUsers pattern) and dismiss it from `handleChatEvent` whenever any further chat event for that run is processed. The watchdog's internal cleanup (`activeChatRunId` reset, status idle, history reload) is unchanged. Refs #67052, #69081 (closed). Prior attempt #69026 raised the threshold and suppressed the notice entirely; this is the narrower fix that keeps the warning useful for genuinely stuck runs.
The streaming watchdog renders 'This response is taking longer than expected. Send another message to continue.' after 30s without a chat delta. If a delta or final then arrives — common for runs that are slow but not stuck — the notice stays in the log alongside the recovered response and contradicts what the user sees. Track the notice by runId in the chat log via a new `addPendingSystem` + `dismissPendingSystem` pair (mirroring the existing pendingUsers pattern) and dismiss it from `handleChatEvent` whenever any further chat event for that run is processed. The watchdog's internal cleanup (`activeChatRunId` reset, status idle, history reload) is unchanged. Refs #67052, #69081 (closed). Prior attempt #69026 raised the threshold and suppressed the notice entirely; this is the narrower fix that keeps the warning useful for genuinely stuck runs.
The streaming watchdog renders 'This response is taking longer than expected. Send another message to continue.' after 30s without a chat delta. If a delta or final then arrives — common for runs that are slow but not stuck — the notice stays in the log alongside the recovered response and contradicts what the user sees. Track the notice by runId in the chat log via a new `addPendingSystem` + `dismissPendingSystem` pair (mirroring the existing pendingUsers pattern) and dismiss it from `handleChatEvent` whenever any further chat event for that run is processed. The watchdog's internal cleanup (`activeChatRunId` reset, status idle, history reload) is unchanged. Refs #67052, #69081 (closed). Prior attempt #69026 raised the threshold and suppressed the notice entirely; this is the narrower fix that keeps the warning useful for genuinely stuck runs.
The streaming watchdog renders 'This response is taking longer than expected. Send another message to continue.' after 30s without a chat delta. If a delta or final then arrives — common for runs that are slow but not stuck — the notice stays in the log alongside the recovered response and contradicts what the user sees. Track the notice by runId in the chat log via a new `addPendingSystem` + `dismissPendingSystem` pair (mirroring the existing pendingUsers pattern) and dismiss it from `handleChatEvent` whenever any further chat event for that run is processed. The watchdog's internal cleanup (`activeChatRunId` reset, status idle, history reload) is unchanged. Refs #67052, #69081 (closed). Prior attempt #69026 raised the threshold and suppressed the notice entirely; this is the narrower fix that keeps the warning useful for genuinely stuck runs.
) * fix(tui): dismiss watchdog notice when response actually arrives The streaming watchdog renders 'This response is taking longer than expected. Send another message to continue.' after 30s without a chat delta. If a delta or final then arrives — common for runs that are slow but not stuck — the notice stays in the log alongside the recovered response and contradicts what the user sees. Track the notice by runId in the chat log via a new `addPendingSystem` + `dismissPendingSystem` pair (mirroring the existing pendingUsers pattern) and dismiss it from `handleChatEvent` whenever any further chat event for that run is processed. The watchdog's internal cleanup (`activeChatRunId` reset, status idle, history reload) is unchanged. Refs #67052, #69081 (closed). Prior attempt #69026 raised the threshold and suppressed the notice entirely; this is the narrower fix that keeps the warning useful for genuinely stuck runs. * fix(tui): adapt pending notice to repeatable system entries --------- Co-authored-by: Peter Steinberger <[email protected]>
…nclaw#77375) * fix(tui): dismiss watchdog notice when response actually arrives The streaming watchdog renders 'This response is taking longer than expected. Send another message to continue.' after 30s without a chat delta. If a delta or final then arrives — common for runs that are slow but not stuck — the notice stays in the log alongside the recovered response and contradicts what the user sees. Track the notice by runId in the chat log via a new `addPendingSystem` + `dismissPendingSystem` pair (mirroring the existing pendingUsers pattern) and dismiss it from `handleChatEvent` whenever any further chat event for that run is processed. The watchdog's internal cleanup (`activeChatRunId` reset, status idle, history reload) is unchanged. Refs openclaw#67052, openclaw#69081 (closed). Prior attempt openclaw#69026 raised the threshold and suppressed the notice entirely; this is the narrower fix that keeps the warning useful for genuinely stuck runs. * fix(tui): adapt pending notice to repeatable system entries --------- Co-authored-by: Peter Steinberger <[email protected]>
…nclaw#77375) * fix(tui): dismiss watchdog notice when response actually arrives The streaming watchdog renders 'This response is taking longer than expected. Send another message to continue.' after 30s without a chat delta. If a delta or final then arrives — common for runs that are slow but not stuck — the notice stays in the log alongside the recovered response and contradicts what the user sees. Track the notice by runId in the chat log via a new `addPendingSystem` + `dismissPendingSystem` pair (mirroring the existing pendingUsers pattern) and dismiss it from `handleChatEvent` whenever any further chat event for that run is processed. The watchdog's internal cleanup (`activeChatRunId` reset, status idle, history reload) is unchanged. Refs openclaw#67052, openclaw#69081 (closed). Prior attempt openclaw#69026 raised the threshold and suppressed the notice entirely; this is the narrower fix that keeps the warning useful for genuinely stuck runs. * fix(tui): adapt pending notice to repeatable system entries --------- Co-authored-by: Peter Steinberger <[email protected]>
…nclaw#77375) * fix(tui): dismiss watchdog notice when response actually arrives The streaming watchdog renders 'This response is taking longer than expected. Send another message to continue.' after 30s without a chat delta. If a delta or final then arrives — common for runs that are slow but not stuck — the notice stays in the log alongside the recovered response and contradicts what the user sees. Track the notice by runId in the chat log via a new `addPendingSystem` + `dismissPendingSystem` pair (mirroring the existing pendingUsers pattern) and dismiss it from `handleChatEvent` whenever any further chat event for that run is processed. The watchdog's internal cleanup (`activeChatRunId` reset, status idle, history reload) is unchanged. Refs openclaw#67052, openclaw#69081 (closed). Prior attempt openclaw#69026 raised the threshold and suppressed the notice entirely; this is the narrower fix that keeps the warning useful for genuinely stuck runs. * fix(tui): adapt pending notice to repeatable system entries --------- Co-authored-by: Peter Steinberger <[email protected]>
…nclaw#77375) * fix(tui): dismiss watchdog notice when response actually arrives The streaming watchdog renders 'This response is taking longer than expected. Send another message to continue.' after 30s without a chat delta. If a delta or final then arrives — common for runs that are slow but not stuck — the notice stays in the log alongside the recovered response and contradicts what the user sees. Track the notice by runId in the chat log via a new `addPendingSystem` + `dismissPendingSystem` pair (mirroring the existing pendingUsers pattern) and dismiss it from `handleChatEvent` whenever any further chat event for that run is processed. The watchdog's internal cleanup (`activeChatRunId` reset, status idle, history reload) is unchanged. Refs openclaw#67052, openclaw#69081 (closed). Prior attempt openclaw#69026 raised the threshold and suppressed the notice entirely; this is the narrower fix that keeps the warning useful for genuinely stuck runs. * fix(tui): adapt pending notice to repeatable system entries --------- Co-authored-by: Peter Steinberger <[email protected]>
…nclaw#77375) * fix(tui): dismiss watchdog notice when response actually arrives The streaming watchdog renders 'This response is taking longer than expected. Send another message to continue.' after 30s without a chat delta. If a delta or final then arrives — common for runs that are slow but not stuck — the notice stays in the log alongside the recovered response and contradicts what the user sees. Track the notice by runId in the chat log via a new `addPendingSystem` + `dismissPendingSystem` pair (mirroring the existing pendingUsers pattern) and dismiss it from `handleChatEvent` whenever any further chat event for that run is processed. The watchdog's internal cleanup (`activeChatRunId` reset, status idle, history reload) is unchanged. Refs openclaw#67052, openclaw#69081 (closed). Prior attempt openclaw#69026 raised the threshold and suppressed the notice entirely; this is the narrower fix that keeps the warning useful for genuinely stuck runs. * fix(tui): adapt pending notice to repeatable system entries --------- Co-authored-by: Peter Steinberger <[email protected]>
…nclaw#77375) * fix(tui): dismiss watchdog notice when response actually arrives The streaming watchdog renders 'This response is taking longer than expected. Send another message to continue.' after 30s without a chat delta. If a delta or final then arrives — common for runs that are slow but not stuck — the notice stays in the log alongside the recovered response and contradicts what the user sees. Track the notice by runId in the chat log via a new `addPendingSystem` + `dismissPendingSystem` pair (mirroring the existing pendingUsers pattern) and dismiss it from `handleChatEvent` whenever any further chat event for that run is processed. The watchdog's internal cleanup (`activeChatRunId` reset, status idle, history reload) is unchanged. Refs openclaw#67052, openclaw#69081 (closed). Prior attempt openclaw#69026 raised the threshold and suppressed the notice entirely; this is the narrower fix that keeps the warning useful for genuinely stuck runs. * fix(tui): adapt pending notice to repeatable system entries --------- Co-authored-by: Peter Steinberger <[email protected]>
…nclaw#77375) * fix(tui): dismiss watchdog notice when response actually arrives The streaming watchdog renders 'This response is taking longer than expected. Send another message to continue.' after 30s without a chat delta. If a delta or final then arrives — common for runs that are slow but not stuck — the notice stays in the log alongside the recovered response and contradicts what the user sees. Track the notice by runId in the chat log via a new `addPendingSystem` + `dismissPendingSystem` pair (mirroring the existing pendingUsers pattern) and dismiss it from `handleChatEvent` whenever any further chat event for that run is processed. The watchdog's internal cleanup (`activeChatRunId` reset, status idle, history reload) is unchanged. Refs openclaw#67052, openclaw#69081 (closed). Prior attempt openclaw#69026 raised the threshold and suppressed the notice entirely; this is the narrower fix that keeps the warning useful for genuinely stuck runs. * fix(tui): adapt pending notice to repeatable system entries --------- Co-authored-by: Peter Steinberger <[email protected]>
…nclaw#77375) * fix(tui): dismiss watchdog notice when response actually arrives The streaming watchdog renders 'This response is taking longer than expected. Send another message to continue.' after 30s without a chat delta. If a delta or final then arrives — common for runs that are slow but not stuck — the notice stays in the log alongside the recovered response and contradicts what the user sees. Track the notice by runId in the chat log via a new `addPendingSystem` + `dismissPendingSystem` pair (mirroring the existing pendingUsers pattern) and dismiss it from `handleChatEvent` whenever any further chat event for that run is processed. The watchdog's internal cleanup (`activeChatRunId` reset, status idle, history reload) is unchanged. Refs openclaw#67052, openclaw#69081 (closed). Prior attempt openclaw#69026 raised the threshold and suppressed the notice entirely; this is the narrower fix that keeps the warning useful for genuinely stuck runs. * fix(tui): adapt pending notice to repeatable system entries --------- Co-authored-by: Peter Steinberger <[email protected]>
…nclaw#77375) * fix(tui): dismiss watchdog notice when response actually arrives The streaming watchdog renders 'This response is taking longer than expected. Send another message to continue.' after 30s without a chat delta. If a delta or final then arrives — common for runs that are slow but not stuck — the notice stays in the log alongside the recovered response and contradicts what the user sees. Track the notice by runId in the chat log via a new `addPendingSystem` + `dismissPendingSystem` pair (mirroring the existing pendingUsers pattern) and dismiss it from `handleChatEvent` whenever any further chat event for that run is processed. The watchdog's internal cleanup (`activeChatRunId` reset, status idle, history reload) is unchanged. Refs openclaw#67052, openclaw#69081 (closed). Prior attempt openclaw#69026 raised the threshold and suppressed the notice entirely; this is the narrower fix that keeps the warning useful for genuinely stuck runs. * fix(tui): adapt pending notice to repeatable system entries --------- Co-authored-by: Peter Steinberger <[email protected]>
…nclaw#77375) * fix(tui): dismiss watchdog notice when response actually arrives The streaming watchdog renders 'This response is taking longer than expected. Send another message to continue.' after 30s without a chat delta. If a delta or final then arrives — common for runs that are slow but not stuck — the notice stays in the log alongside the recovered response and contradicts what the user sees. Track the notice by runId in the chat log via a new `addPendingSystem` + `dismissPendingSystem` pair (mirroring the existing pendingUsers pattern) and dismiss it from `handleChatEvent` whenever any further chat event for that run is processed. The watchdog's internal cleanup (`activeChatRunId` reset, status idle, history reload) is unchanged. Refs openclaw#67052, openclaw#69081 (closed). Prior attempt openclaw#69026 raised the threshold and suppressed the notice entirely; this is the narrower fix that keeps the warning useful for genuinely stuck runs. * fix(tui): adapt pending notice to repeatable system entries --------- Co-authored-by: Peter Steinberger <[email protected]>
…nclaw#77375) * fix(tui): dismiss watchdog notice when response actually arrives The streaming watchdog renders 'This response is taking longer than expected. Send another message to continue.' after 30s without a chat delta. If a delta or final then arrives — common for runs that are slow but not stuck — the notice stays in the log alongside the recovered response and contradicts what the user sees. Track the notice by runId in the chat log via a new `addPendingSystem` + `dismissPendingSystem` pair (mirroring the existing pendingUsers pattern) and dismiss it from `handleChatEvent` whenever any further chat event for that run is processed. The watchdog's internal cleanup (`activeChatRunId` reset, status idle, history reload) is unchanged. Refs openclaw#67052, openclaw#69081 (closed). Prior attempt openclaw#69026 raised the threshold and suppressed the notice entirely; this is the narrower fix that keeps the warning useful for genuinely stuck runs. * fix(tui): adapt pending notice to repeatable system entries --------- Co-authored-by: Peter Steinberger <[email protected]>
Problem
The TUI streaming watchdog is set to 30 seconds, which triggers false-positive warnings during healthy long-running agent turns:
This fires regularly during:
The alarming "backend may have dropped this run" message causes unnecessary user confusion.
Changes
src/tui/tui-event-handlers.tsDEFAULT_STREAMING_WATCHDOG_MSchanged from30_000(30s) →120_000(120s)chatLog.addSystem()call replaced with a comment — warning suppressed entirelyWhat's preserved
activeChatRunIdcleared,activityStatusset toidle,tui.requestRender()calledcontext.streamingWatchdogMsoverride still works for custom valuesstreamingWatchdogMs: 0still disables the watchdog entirelysrc/tui/tui-event-handlers.test.tsRationale
The watchdog's internal reset (clearing stale run state, returning status to idle) is valuable. But the user-facing warning creates more confusion than it solves — users can always send a new message to resync if something is truly stuck, and the 120s threshold means the reset only fires for genuinely stalled connections rather than healthy long operations.