Repository navigation
feat(ux): long-turn visibility + default-on stream hang safety net - #1758
Conversation
Long-running turns looked frozen ("are you still working?") and a dropped
network stream could hang for the full 5-minute QueryGuard idle timeout.
Three focused changes:
- Spinner: show the elapsed-time counter at 5s instead of 30s (split the
timer gate from the token-count gate). The timer is wall-clock derived,
so it keeps ticking during long tool calls — proof of life even when no
tokens stream.
- Spinner: surface the currently-executing tool name in the status line
(reusing the spinnerSuffix channel; stop-hook progress still wins). A
long subagent/typecheck now reads "(↓ Bash · 1m 20s)" instead of a bare
spinner.
- claude.ts: enable the stream idle-timeout watchdog by default, matching
the always-on read-timeout already used by the OpenAI/Codex shims. A
silently dropped Anthropic-family stream now aborts and falls back to a
non-streaming retry within STREAM_IDLE_TIMEOUT_MS (90s) instead of
hanging to 5 minutes. Opt out with CLAUDE_DISABLE_STREAM_WATCHDOG=1.
Testing: tsc --noEmit clean; bugfixes.test.ts (31) and src/services/api
(835) pass; bun run smoke builds + runs.
Co-Authored-By: OpenClaude <openclaude@gitlawb.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (11)src/**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
src/components/**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{ts,tsx,js,jsx,py,json,md}📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
**/*.{ts,tsx,js,jsx,py}📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
**⚙️ CodeRabbit configuration file
Files:
**/*⚙️ CodeRabbit configuration file
Files:
{src/commands/**/*.ts,src/services/**/*.ts,src/entrypoints/**/*.ts}📄 CodeRabbit inference engine (AGENTS.md)
Files:
{src/services/**/*.ts,src/utils/**/*.ts}📄 CodeRabbit inference engine (AGENTS.md)
Files:
{src/integrations/**/*.ts,src/services/**/*.ts}📄 CodeRabbit inference engine (AGENTS.md)
Files:
{src/services/api/**,src/integrations/**,src/utils/model/**,src/utils/provider*.ts,src/commands/provider/**}⚙️ CodeRabbit configuration file
Files:
🔇 Additional comments (3)
📝 WalkthroughWalkthroughThree independent changes: ChangesSpinner display improvements
Stream watchdog default change
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 7✅ Passed checks (7 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…wigpine#1758) Long-running turns looked frozen ("are you still working?") and a dropped network stream could hang for the full 5-minute QueryGuard idle timeout. Three focused changes: - Spinner: show the elapsed-time counter at 5s instead of 30s (split the timer gate from the token-count gate). The timer is wall-clock derived, so it keeps ticking during long tool calls — proof of life even when no tokens stream. - Spinner: surface the currently-executing tool name in the status line (reusing the spinnerSuffix channel; stop-hook progress still wins). A long subagent/typecheck now reads "(↓ Bash · 1m 20s)" instead of a bare spinner. - claude.ts: enable the stream idle-timeout watchdog by default, matching the always-on read-timeout already used by the OpenAI/Codex shims. A silently dropped Anthropic-family stream now aborts and falls back to a non-streaming retry within STREAM_IDLE_TIMEOUT_MS (90s) instead of hanging to 5 minutes. Opt out with CLAUDE_DISABLE_STREAM_WATCHDOG=1. Testing: tsc --noEmit clean; bugfixes.test.ts (31) and src/services/api (835) pass; bun run smoke builds + runs. Co-authored-by: OpenClaude <openclaude@gitlawb.com> (cherry picked from commit 4dee44a) (cherry picked from commit c742a18bb3dd89120aa11b6d8602feef61b0e9a7)
Summary
Long-running turns looked frozen — a multi-minute turn (e.g. a long subagent or
typecheck) showed a bare spinner, prompting "are you still working?" — and a
silently dropped network stream could hang for the full 5-minute QueryGuard idle
timeout. Three focused changes close those gaps.
SpinnerAnimationRow.tsx): split the singlewantsTimerAndTokensgate intowantsTimer(SHOW_TIMER_AFTER_MS = 5_000) andwantsTokens(SHOW_TOKENS_AFTER_MS = 30_000). The timer is wall-clock derived,so it keeps ticking during long tool calls where no tokens stream — proof of life.
REPL.tsx): newactiveToolSpinnerSuffixmemo derives the first in-progress tool from the last assistant message ∩
inProgressToolUseIDsand surfaces it via the existingspinnerSuffixchannel(stop-hook progress still takes precedence). A long tool now reads
(↓ Bash · 1m 20s)instead of a bare spinner. No new prop plumbing.claude.ts): the watchdog alreadyexisted but was gated behind
CLAUDE_ENABLE_STREAM_WATCHDOG. Flipped to default-on(matching the always-on
readWithTimeoutin the OpenAI/Codex shims). A droppedAnthropic-family stream now aborts and falls back to a non-streaming retry within
STREAM_IDLE_TIMEOUT_MSinstead of hanging to 5 minutes.Impact
users. Default timeout kept conservative at 90s (covers Anthropic/Bedrock/
Vertex, which send SSE pings). On fire it throws → existing non-streaming retry
fallback. Opt out with
CLAUDE_DISABLE_STREAM_WATCHDOG=1; tune withCLAUDE_STREAM_IDLE_TIMEOUT_MS.Testing
bun run typecheck(tsc --noEmit) — cleanbun test src/__tests__/bugfixes.test.ts— 31 pass (incl. stream-idle assertions)bun test src/services/api— 835 passbun run smoke— bundle builds +--versionrunsNotes
Follow-ups deliberately deferred:
plumbing from the API layer to the REPL). Token-streaming stalls already show a
red spinner at 3s via
useStalledAnimation, but it's suppressed while tools run.REPL.tsxshowStreamingText).Summary by CodeRabbit
Release Notes
New Features
Chores