Uh oh!
There was an error while loading. Please reload this page.
fix(plugin-chatbot): ask-decline shows a live pending indicator + earlier handoff card (#2458) - #2496
Merged
Merged
Conversation
…lier handoff card (#2458) When the `ask` agent declines a build-shaped request, the ~20s wait before the "Open in Builder →" card is the LLM's time-to-tool-call. During it the chat could show dead air: a blank bubble, or the static "执行过程" activity note when the backend streamed a `(called …)` tool-call placeholder mid-stream. `ChatbotEnhanced` now renders the existing `ThinkingDots` indicator whenever a streaming assistant turn has nothing VISIBLE yet — whitespace-only content, a `(called …)` placeholder, or reasoning hidden in `summary` mode. The static "执行过程" note is kept only for FINISHED (re-hydrated) tool-call-only turns (#772 preserved). The `builderHandoff` card already renders at `output-available` with no prose gate, so it surfaces the instant the tool result lands; the typing cursor now only paints beside real streaming prose. Tests: card renders while streaming before prose; live dots (not 执行过程) for a mid-stream placeholder; 执行过程 note preserved for a finished placeholder turn. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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 freeto 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.
What & why
Item #3 of #2458 — the ask-decline latency feel. When the
askagent declines a build-shaped request, the ~20s before the "Open in Builder →" card is dominated by the LLM's time-to-tool-call (gpt-4, react planning). During that wait the chat could show dead air:(called suggest_builder)tool-call placeholder mid-stream.Investigation
AiChatPage) drives the live stream throughuseObjectChat→mapMessages, defaultprocessVisibility="summary".ask-agent.ts) is instructed to callsuggest_builderfirst, then one short sentence — so the wait is LLM tool-call latency, not prose. The card can't render sooner; the win is the pending indicator.builderHandoffcard (ChatbotEnhanced) already renders ontool.builderHandoffwith no gate on prose / stream completion — so it surfaces atoutput-available, before the trailing sentence. Confirmed and now locked with a test.Changes (
ChatbotEnhanced.tsx)isEmptyAssistantStreamingas "streaming turn with nothing visible yet": no real prose (whitespace-only and(called …)placeholders don't count), no rendered tool row (summary chip / detailed card), no shown reasoning (only surfaced indebug), no build/design panel → renders the existingThinkingDotsindicator (mirrors the existing streaming affordance, per the ticket).#772behaviour preserved, verified by a test.Goal 3 (prose need)
The ask agent already emits just "one short sentence" for a decline (cloud
ask-agent.ts) — already minimal. No prompt change made; touching the P4 handoff contract was explicitly out of scope.Tests
packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.test.tsx(86 pass):output-availablewhile streaming, before prose arrives;(called …)placeholder;Browser proof
Rendered the real
ChatbotEnhanced(from source, console-defaultsummarymode) through the exact ask-decline stream phases (a livegpt-4rig is needed to reproduce the 20s wall-clock; the harness reproduces each phase deterministically):(called …)placeholder → live thinking indicator (Assistant is responding), no blank, no 执行过程.suggest_builder→output-available, still streaming, no prose → full "Open in Builder →" card (prompt + actionable button).Follow-up (out of scope, flagged separately)
hydratedMessagesToChatMessages(app-shellAiChatPage) liftsdraftReview/proposedPlanon reload but notbuilderHandoff/proposedChanges, so a reloaded ask-decline loses the card. Spawned as a separate task.🤖 Generated with Claude Code