Repository navigation
feat(chat): waiting UX for slow/silent turns + tighter SSE keepalive - #3957
Merged
Merged
Conversation
…palive UX for the 'frozen then everything at once' streaming case: #1 Waiting state: the empty pre-first-chunk window showed only a silent 'Thinking…'. Add ThinkingState — a live elapsed clock next to the typing indicator and, after 20s, a 'taking longer than usual' hint + Cancel (wired to the existing stop()/cancel run). Uses useClockTick (singleton useSyncExternalStore interval) so the threshold flips without useEffect. #4 SSE keepalive 15s -> 10s: the tightest proxy idle timeout in the path is Istio's 15s; a 15s heartbeat lands ON that boundary, so a silent model gap (slow TTFB / between-step pauses — provider-agnostic, worse with proxied/ liteLLM) can race-lose and drop the socket mid-run. The client reconnects and the tail replays the whole in-flight run as one burst (the frozen-then- burst symptom). 10s keeps a ~5s margin. #2 (surface reasoning + tool steps) needs no code: reasoning already renders via ThoughtSummary and tool calls via the per-tool part components as soon as parts stream; the only blank window is pre-first-part, which #1 now covers. Verified: tsc + oxlint clean on changed files; sse-keepalive tests pass.
pedrofrxncx
enabled auto-merge (squash)
June 16, 2026 19:54
decocms Bot
pushed a commit
that referenced
this pull request
Jun 16, 2026
PR: #3957 feat(chat): waiting UX for slow/silent turns + tighter SSE keepalive Bump type: minor - decocms (apps/mesh/package.json): 3.28.3 -> 3.29.0
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.
UX follow-ups to the decopilot stream investigation (#3951 diagnostics, #3956 reorder fix). Targets the "thinking forever, then everything at once" report — which, per testing, happens with any model (just more often with proxied/liteLLM providers), so the cause is not model-specific buffering.
#1 — Waiting state for slow/silent turns
The pre-first-chunk window rendered only a silent
Thinking…. NewThinkingState:stop()→/cancel/:taskId).Uses
useClockTick(singletonuseSyncExternalStoreinterval) so the slow-threshold flips withoutuseEffect(per the repo's banned-hooks rules).#4 — SSE keepalive 15s → 10s
The tightest proxy idle timeout in the path is Istio's 15s. A 15s heartbeat lands on that boundary, so a silent model gap (slow time-to-first-token / between-step pauses — provider-agnostic, worse with liteLLM) can race-lose and get the socket cut mid-run. The client reconnects and the JetStream tail replays the whole in-flight run as one burst — exactly the "frozen then everything at once" symptom, and it explains why it's model-agnostic. 10s keeps a ~5s margin so a silent turn survives without a reconnect.
#2 — Reasoning + tool steps: already surfaced (no code)
Verified during the investigation: reasoning renders via
ThoughtSummary("Thinking…" while streaming) and tool calls via the per-tool part components, as soon as parts stream. The only blank window is pre-first-part — which #1 now fills. No redundant rendering added.Testing
tsc+oxlintclean on changed files;sse-keepalive.test.tspasses (6). UI change is render-only in the empty-loading branch.🤖 Generated with Claude Code
Summary by cubic
Improves chat streaming by adding a clear waiting state for slow/silent turns and tightens SSE keepalive to avoid disconnects that cause “frozen then all at once” responses.
New Features
Bug Fixes
Written for commit c8c7e8d. Summary will update on new commits.