assistant: remove debug UI and reasoning-token streaming#1488
Conversation
Removes the optional debug UI from the Kiln Assistant (the PUBLIC_SHOW_TOOL_CALL_DETAILS env flag and its alternate render branch that dumped raw tool input/output JSON and a "(debug mode)" title), keeping only the production "simplified" view. Also drops the per-thinking-token reasoning stream: the reasoning ChatMessagePart type and its stream handlers are removed, and session restore no longer reconstructs reasoning parts. The "assistant is working" affordance (streaming cursor, animated icon, ChatStatusSteps activity indicator, tool-execution framing) and output-token streaming are preserved. Deletes the now-dead chat_step_group.svelte (unused). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KwfR9HM3b8Z9gs2PvJz5xA
WalkthroughRemoves reasoning/thinking content support from the chat UI. The ChangesRemove reasoning support from chat UI
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request removes the "reasoning" message parts and the debug mode (previously controlled by the PUBLIC_SHOW_TOOL_CALL_DETAILS environment variable) from the assistant chat UI. This includes deleting reasoning-related event handlers, state, and UI components, leaving only the simplified view for chat messages and tool calls. A review comment identifies a redundant definition of the segments variable in chat.svelte that can be safely removed to avoid unnecessary recalculation.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| {#if message.role === "assistant"} | ||
| {@const segments = groupPartsForSimplifiedView( | ||
| message.parts ?? [], | ||
| )} | ||
| {@const lastSegIsText = |
There was a problem hiding this comment.
The segments variable is already defined in the parent scope ({#if message.parts && message.parts.length > 0}) on line 478. Redefining and recalculating it here is redundant and inefficient, especially since Svelte templates re-evaluate these expressions on updates. You can safely remove this duplicate @const definition and reuse the parent scope's segments variable.
{#if message.role === "assistant"}
{@const lastSegIsText =
📊 Coverage ReportOverall Coverage: 92% Diff: origin/leonard/kil-692-assistant-auto-mode...HEADNo lines with coverage information in this diff.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/web_ui/src/lib/chat/streaming_chat.ts (1)
225-254: Confirm unknown stream events are safely ignored; consider adding explicit test coverage.Unknown event types are handled safely via the conditional guard at line 258-261 (
if (handler) { ... }), so unrecognized events result in no-op behavior rather than throwing. This prevents frontend/backend deploy skew from interrupting the stream. However, no explicit test case currently verifies this behavior for unknown or unhandled event types (e.g., legacyreasoning-*events); adding one would document the intended rollout safety.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/web_ui/src/lib/chat/streaming_chat.ts` around lines 225 - 254, Add explicit test coverage to verify that unknown or unhandled stream event types are safely ignored without throwing errors. Create a test case that simulates sending an unknown event type (for example, a legacy "reasoning-*" event) through the streaming handler mechanism and confirm that the conditional guard check (if handler exists before calling it) causes the unknown event to result in a no-op rather than an error or exception. This documents the intended rollout safety behavior that prevents frontend/backend deploy skew from interrupting the stream.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@app/web_ui/src/lib/chat/streaming_chat.ts`:
- Around line 225-254: Add explicit test coverage to verify that unknown or
unhandled stream event types are safely ignored without throwing errors. Create
a test case that simulates sending an unknown event type (for example, a legacy
"reasoning-*" event) through the streaming handler mechanism and confirm that
the conditional guard check (if handler exists before calling it) causes the
unknown event to result in a no-op rather than an error or exception. This
documents the intended rollout safety behavior that prevents frontend/backend
deploy skew from interrupting the stream.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 42b42364-a9f9-41ed-9baa-932a1b578f9e
📒 Files selected for processing (7)
app/web_ui/.env.exampleapp/web_ui/src/lib/chat/session_messages.test.tsapp/web_ui/src/lib/chat/session_messages.tsapp/web_ui/src/lib/chat/streaming_chat.tsapp/web_ui/src/routes/(app)/assistant/+page.svelteapp/web_ui/src/routes/(app)/assistant/chat.svelteapp/web_ui/src/routes/(app)/assistant/chat_step_group.svelte
💤 Files with no reviewable changes (3)
- app/web_ui/src/lib/chat/session_messages.ts
- app/web_ui/.env.example
- app/web_ui/src/routes/(app)/assistant/chat_step_group.svelte
Removes the optional debug UI from the Kiln Assistant and the per-thinking-token reasoning stream, keeping the production experience intact. Stacked on top of #1451 (auto-mode).
What's removed
chat.svelte— thePUBLIC_SHOW_TOOL_CALL_DETAILSenv flag, the alternate view that dumped raw tool input/output JSON in<pre>blocks, the(debug mode)page title, and the related dead helpers/collapse consumers. Only the production "simplified" view remains.reasoningChatMessageParttype and all reasoning stream handlers instreaming_chat.ts; session restore (session_messages.ts) no longer rebuilds reasoning parts. (The backend now drops reasoning events entirely — see the companion kiln_server PR.)chat_step_group.svelte— dead component (imported nowhere) that only existed for the reasoning-render pattern.PUBLIC_SHOW_TOOL_CALL_DETAILSentry in.env.example.What's preserved
text-delta).ChatStatusStepsactivity indicator +kiln-tool-execution-*framing.Verification
svelte-check: 0 errors.vitestsuite: 1118 passed.session_messages.test.tsnow assertsreasoning_contentis ignored on restore.🤖 Generated with Claude Code
https://claude.ai/code/session_01KwfR9HM3b8Z9gs2PvJz5xA