fix(app-shell): make AI-build "开始搭建" send a gate-matching approval#2023
Merged
Conversation
The proposed-plan card's confirm button ("开始搭建") sent the Chinese
message "就按这个方案搭建吧。", which the cloud confirm gate's APPROVAL_RE
(service-ai-studio confirm-gate.ts) does NOT recognize as approval — it
anchors Chinese approval on 确认 / 直接搭建. So clicking sent a message the
agent re-proposed on instead of building, and the button looked inert
(typing a "确认…" reply worked, which is the tell).
Align both zh approve messages with the gate (确认-anchored):
planApproveMessage "就按这个方案搭建吧。" → "确认,开始搭建。"
planApproveDefaultsMessage "就按你的合理假设直接搭建,…" → "确认搭建,未决问题按你的合理假设和默认处理。"
across the two hosts that wire them (i18n zh locale used by AiChatPage,
and ConsoleFloatingChatbot's inline zh locale). English already matched
("build it as proposed" / "build it with your best"). Adds an i18n test
that pins both messages to the gate's 确认 anchor so a future reword can't
silently re-break the button.
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 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.
Problem
In the AI build "proposed plan" card (shown after the agent calls
propose_blueprint), the 开始搭建 button was inert — clicking it did nothing: no build started. Typing a "确认…" reply in the chat worked, which was the tell.Root cause
The button does send a chat message (
onClick → handlePlanApprove → onSendMessage), but in Chinese it sent就按这个方案搭建吧。, which the cloud confirm gate'sAPPROVAL_RE(service-ai-studio/confirm-gate.ts) does not recognize as approval — the gate anchors Chinese approval on确认/直接搭建. So the agent re-proposed instead of building, and the button looked dead. The English messages already matched (build it as proposed/build it with your best); only the Chinese ones were stale relative to the (now broadened, cloud #620) gate.Fix
Align both zh approve messages with the gate (确认-anchored), in the two hosts that wire them:
planApproveMessage就按这个方案搭建吧。确认,开始搭建。planApproveDefaultsMessage就按你的合理假设直接搭建,…确认搭建,未决问题按你的合理假设和默认处理。packages/i18n/src/locales/zh.ts(used byAiChatPage)packages/app-shell/src/layout/ConsoleFloatingChatbot.tsx(inline zh locale)Plus an i18n test pinning both messages to the gate's
确认anchor so a future reword can't silently re-break the button. Guard comments at both sites document the cross-repo coupling.Verification
@object-ui/i18n(new strings + gate-anchor guard) and@object-ui/plugin-chatbot(ChatbotEnhancedbutton→onSendMessagewiring) green.userApprovedThisTurnagainst the real objectui strings — new zh messages → approved; old zh → rejected (reproduces the bug); plain build requests stay rejected (gate stays narrow).run-stack.sh --with-ui --seed: clicking 开始搭建 in the browser sent确认,开始搭建。(DB-confirmed) → agent ranapply_blueprint→ created a real app + objects + views. Button no longer inert.Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
🤖 Generated with Claude Code