Skip to content

feat(chat): waiting UX for slow/silent turns + tighter SSE keepalive - #3957

Merged
pedrofrxncx merged 1 commit into
mainfrom
feat/decopilot-stream-ux-slow-model
Jun 16, 2026
Merged

pedrofrxncx merged 1 commit into
mainfrom
feat/decopilot-stream-ux-slow-model

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Jun 16, 2026 •

Copy link
Copy Markdown
Collaborator

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…. New ThinkingState:

  • live elapsed clock next to the typing indicator,
  • after 20s, a "taking longer than usual" hint + Cancel (wired to the existing stop() → /cancel/:taskId).

Uses useClockTick (singleton useSyncExternalStore interval) so the slow-threshold flips without useEffect (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 + oxlint clean on changed files; sse-keepalive.test.ts passes (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

    • Added a pre-first-chunk waiting UI with a live elapsed timer and a Cancel option after 20s.
    • Uses a shared clock tick to update the timer without per-component intervals.
  • Bug Fixes

    • Reduced SSE keepalive from 15s to 10s to stay under Istio’s 15s idle timeout, preventing mid-run disconnects and burst replays.

Written for commit c8c7e8d. Summary will update on new commits.

Review in cubic

…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
pedrofrxncx enabled auto-merge (squash) June 16, 2026 19:54
@pedrofrxncx
pedrofrxncx merged commit 8cc079e into main Jun 16, 2026
15 checks passed
@pedrofrxncx
pedrofrxncx deleted the feat/decopilot-stream-ux-slow-model branch June 16, 2026 19:58
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant