This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
fix(plugin-chatbot): a confirm-gate preview is not the commit that settles the card before it (#8343) - #8374
Merged
Conversation
…ttles the card before it (#8343) `builtPlanIds` decided a proposed plan had been built from the tool NAME alone (`tool.toolName === 'apply_blueprint'`). On an iteration turn where the user did not say the magic phrase, `apply_blueprint` hits its own confirm gate and returns `{status:'awaiting_confirmation'}` — it built nothing and is itself waiting for the user. That still marked the earlier `propose_blueprint` card 已搭建 and collapsed its "Build it" button into an inert badge; the `apply_blueprint` card has no button of its own, so the turn was left with no confirm affordance at all while the assistant's prose asked the user to confirm one. A build now only counts when the invocation is not a confirm-gate preview (`!isProposalResult(tool.result)`), the same fact the tool header already reads to say "Awaiting Approval". A still-running apply (no result yet) keeps counting, so the #432 guard against re-triggering an in-flight build is unchanged. `confirmedChangeIds` carried the same defect one level down — measured, contrary to what the issue reported: it inferred "this later call committed" from the ABSENCE of a rich `proposedChanges` card, and that detector additionally needs >=1 parseable change row, so a later same-tool call that WAS a preview but produced no card (an empty `changes: []`) silently settled the pending card. It reads the preview fact directly now too. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 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 free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Refs #8343.
The dead end
builtPlanIdsdecided a proposed plan had been built from the tool NAME alone:On an iteration turn where the user did not say the magic phrase ("直接搭建" / "just build it"),
apply_blueprinthits its own confirm gate (cloudblueprint-tools.ts,createApplyBlueprintHandler) and returns:{"status":"awaiting_confirmation","message":"A confirm card for this blueprint was just shown to the user — STOP and let them review it. …"}It built nothing and is itself waiting for the user. That still marked the earlier
propose_blueprintcard 已搭建, collapsing its "Build it" button into an inert badge — and theapply_blueprintcard carries no button of its own. So the turn was left with no confirm affordance at all while the assistant's prose asked the user to confirm one. The only way forward was guessing "确认" into the composer.The fix
A build only counts when the invocation is not a confirm-gate preview — the same fact
getToolStatealready reads to say "Awaiting Approval":A still-running
apply_blueprint(no result yet) keeps counting, so the objectui#432 guard against a second "Build it" re-triggering an in-flight build is unchanged — pinned by its own test.Also:
confirmedChangeIdshad the same defect (contrary to the issue)The issue reported the sibling memo as already the right shape. Measured, it is not. It inferred "this later call committed" from the ABSENCE of a rich
proposedChangescard, anddetectProposedChangesadditionally requiresstatus === 'changes_proposed'and ≥1 parseable change row. So a later same-tool call that WAS a preview but produced no card (an emptychanges: []— reachable from the cloud gate'schanges: describeEditOps(args)path) silently settled the pending 确认修改 card. It reads the preview fact directly now too.Both memos are now one condition apart from
resolveProposalCardState's stated principle: "what actually happened" over "what was asked for".Tests
packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.awaitingConfirmBuild-8343.test.tsx— the real two-turn wire envelopes fed through the real mapper (uiMessagesToChatMessages), so the whole detector chain runs as it does in the console. Six cases: the two regressions, plus positive controls that the card still collapses to 已搭建 / 已确认 on a real commit and on an in-flight build.Ablation (both conditions removed, then restored)
Removed:
Restored:
Whole package:
Test Files 40 passed (40) · Tests 467 passed (467).packages/app-shell/:Test Files 647 passed (647) · Tests 6234 passed | 1 skipped.eslinton the changed files: 0 errors.Not in this PR
The issue's tail note — the assistant says "请确认下方方案卡片" while the card renders above the prose. Grepped both repos: no such literal exists in objectui, and none in cloud either. It is the model's own improvised direction word; the nearest instruction that shapes that sentence is
packages/service-ai-studio/src/skills/solution-design-skill.ts:26(cloud), which prescribes the one-line lead-in but says nothing about direction. Fixing it means constraining that prompt in cloud, not this repo.🤖 Generated with Claude Code