Repository navigation
feat(plugin-chatbot): the question card takes the composer's place when the AI ends its turn on a question - #38004
Conversation
Claude-Session: https://claude.ai/code/session_01L9qibyUpyff7pHe7vkFgA8 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibyUpyff7pHe7vkFgA8 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin d48dd333cd4e412e121011205814e624dc38d798 && git checkout d48dd333cd4e412e121011205814e624dc38d798
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin b5809b323afc1467175a5fecc460aae16f1b49ee 3a20ecde478fe0712ecbdc1c141d2b1492c20a74 && git checkout -B drift-repro b5809b323afc1467175a5fecc460aae16f1b49ee && git merge --no-ff 3a20ecde478fe0712ecbdc1c141d2b1492c20a74
node scripts/docs-audit/affected-docs.mjs --json b5809b323afc1467175a5fecc460aae16f1b49ee
|
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i Contract review brief — PR #38004 @
|
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i Contract reviewServed-tier: Read, not reviewed: Check-runs on this head when read: 66 in total, 22 success, 9 skipped, 0 failed, 35 still in progress. Success so far: Check Changeset, Governed Surface Queue Guard, PR-body guards, Spec property liveness, Type Check · source gates, Lint · ESLint, Build Docs, Check Documentation Links. Not concluded: Test Core (10 shards), Test UI (16 shards), Build Core, Type Check · workspace, Type Check UI, Lint UI, Build & E2E UI, Live E2E UI and four Lint and Type Check families. This record judges the diff by reading; it answers for no gate that has not concluded, and those conclusions are still owed before the PR is queued. The PR is a draft. ① Derived judgments
② Semver level
The three packages the diff moves are the three the changesets name. No narrowing, so no BREAKING banner and no ADR-0087 disposition is owed. ③ Boundary flags
④ Design judgmentNo must-fix, no should-fix.
Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i L1-c, the seat's L1 thread · 2026-11-27T15:45Z 席位核对 — L1 @
|
…-ctejy8 Brings in #37970 (C4), which also changes ui/packages/app-shell/src/console/ai/ChatPane.tsx; auto-merged with no conflict. Claude-Session: https://claude.ai/code/session_01L9qibyUpyff7pHe7vkFgA8 Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i Contract reviewServed-tier: Delta review, merge only, of the record at Read, not reviewed: Check-runs on this head when read: 37 in total, 5 success, 9 skipped, 0 failed, 23 still in progress. Not concluded: Check Changeset, Spec property liveness, Build Core, Build Docs, Build UI Deps, every Type Check family, every Lint family, Live E2E UI, and the two shard planners, so no Test Core or Test UI shard exists yet. This record judges the merge by reading; it answers for no gate that has not concluded, and those conclusions are still owed before the PR is queued. The PR is a draft. ① Derived judgments
② Semver levelUnchanged: ③ Boundary flags
④ Design judgmentNo must-fix, no should-fix.
Nits carried from the earlier record, unchanged and still open as accepted deviations: N1 (the Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-tesla · session_01L9qibvMMgnKA797JY46H9i L1-c, the seat's L1 thread · 2026-11-27T16:52Z 席位核对 — L1 delta @
|
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Landing · 2026-11-27T16:53Z · zone
|
Requested by Tesla · project thread
Refs #37874 (items 1-8)
Clause-②: yes (widening) — widened:
parseAskQuestionEnvelopeaccepts a legacyask_whichreading up to 60 characters andASK_QUESTION_LIMITSgainslegacyReadingMaxLength;ChatbotEnhancedPropsgains the optionalconversationId; plugin-chatbot exportsQUESTION_SKIP_STORAGE_PREFIX;QuestionCardQuestion/QuestionCardOptionkeep their names and are now the spec envelope types.Metadata-protocol: none
维护者速读
What changes
Spec (
packages/spec/src/ai/ask-question.zod.ts). Per the E1 route on the card (carrier note 7219023636), a legacyask_whichreading has its own limit,ASK_QUESTION_LIMITS.legacyReadingMaxLength = 60, instead of the envelope's 24-character label, so most of today'sask_whichquestions read as a card. The option rules (no duplicate, no blank, at most one recommended) are now onerefineOptionsshared by the envelope and the legacy arm. A legacy result with an emptyreplyis refused, which makes thereplydescribe true for both arms (L2 N1 on Q1). The newaskedenvelope keeps its 24-character label.Wiring (
ui/packages/plugin-chatbot).chat/pendingQuestion.ts:findQuestionsfinds every question the conversation holds (one envelope per segment between user messages, and the segment's last shown text equals itsreply), over both shapes a tool-ended turn arrives in: one streamed message, or the tool message plus the text message of a reloaded conversation.findPendingQuestionadds the conditions for the card: the stream has ended, nothing streams, not read-only, no queued typed message, the question is in the last segment, not skipped, and no undecided write approval in the same segment.chat/composerGate.tsx: the composer's place, held by the card or the composer. The composer is never unmounted: it ishiddenandinertwhile the card holds the place, so a draft, attachments and the uncontrolled textarea survive, and focus that was in it returns to it.ChatbotEnhanced.tsx: one click sends the option label throughonSendMessage. The card stays mounted while closed, so a refused send that rolls the bubble back reopens it with the choice still made. Skip writes the question'stoolCallIdunderobjectstack:ai-chat-question-skip:plus the new optionalconversationIdprop (chat/questionSkip.ts, every storage access in try/catch). The thread draws the question from its envelope (chat/questionMessage.tsx): pending shows the question alone, past shows a collapsed "AI asks: QUESTION" that expands to its options. Regenerate is hidden on a pending question; Copy still copies the full reply.QuestionCard.tsx: per the Q2a alias note,QuestionCardQuestionandQuestionCardOptionkeep their exported names and are aliased toAskQuestionParsed/AskQuestionOptionParsed; long labels wrap.Console (
ui/packages/app-shell).ChatPanepasses its conversation id, andpurgeChatCachesclears the skip prefix on sign-out with the rest of the chat cache.Checklist and docs. One platform-checklist item,
ai.chat-question-card. The plugin-chatbot docs page and the package README gain a paragraph on the card. The README is outside the claimed file surface (reported to the seat). Regenerated: theask-questionspec reference and the strictness-ledger AI counts.Files to read first, by risk:
ui/packages/plugin-chatbot/src/chat/pendingQuestion.ts: the segment rule and the pending conditions decide when the card replaces the composer.ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx: theansweredQuestionstate that keeps the card after a send, and the gate aroundPromptInput.packages/spec/src/ai/ask-question.zod.ts: the legacy arm and its 60-character limit.Tests
packages/spec/src/ai/ask-question.test.ts: the legacy limit at 60 and 61 characters, the envelope still at 24, trimmed duplicates, blank reading, long question, empty reply.ui/packages/plugin-chatbot/src/__tests__/pendingQuestion-37874.test.ts: both turn shapes, the envelope and the legacy result, and every condition that holds the card back (streaming, other final text, a later message, two questions in one batch, a user or HITL message after it, a queued message, an undecided approval, a skip, read-only, a failed tool).ui/packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.questionCard-37874.test.tsx: through the rendered component, the gate (composer mounted, hidden, inert), a draft surviving the card and a skip, a one-click answer, a refused send reopening the card with the choice made, a queued message winning over the card, read-only, skip persistence per conversation, the pending and past message, Regenerate hidden and Copy kept.ui/packages/app-shell/src/hooks/__tests__/useChatConversation.test.tsx: sign-out clears the skip key.Acceptance notes
Release:on landing names what is left.ui/packages/app-shell/src/console/ai/ChatPane.tsxis also touched by feat(app-shell): Ask AI opens a new conversation after the user's own close, and the drawer header names the conversation #37970 (one added prop here). Whichever lands second merges main before queueing.chatbot.questionCard.*, so no locale pack is touched.Two-minute check:
pnpm --dir ui exec vitest run packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.questionCard-37874.test.tsx, expect 16 passing tests.Verification
Head
19d67fd4b3, branched from57ab08760c(origin/main).dispatch-gates --ranreports 113 derived, 113 run, 0 NOT-MEASURED, every line with its exit code, all exit 0. Two gates first answered exit 3 (prerequisite not built:check:skill-exampleswantedclient-reactdist,check:dual-build-cjs-loadswanted built packages); afterpnpm --filter @objectstack/client-react buildand the battery's own package build, both re-ran under the verify lock and exited 0.ask-question.test.ts19/19; UI vitest over plugin-chatbot, the app-shelluseChatConversationtest andconsole/ai: 111 files, 1006 tests passed.check:generatedclean after--fixregenerated the two spec artifacts.overlap-check --pr=37970VERDICT clean; the one shared file isChatPane.tsx.Ablations (one-off, restored; `git diff HEAD` empty after each)
pendingQuestion.ts: drop thequeuedcondition. 2 tests turn red (the unit "typed message is queued" case and the component "message queued during the turn" case), 31 pass.composerGate.tsx:inert={held}toinert={false}. 1 test turns red (the composer is no longer inert), 15 pass.ask-question.zod.ts: a legacy reading held to the 24-character label instead of 60. 1 test turns red ("holds a reading to its own limit"), 18 pass.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01L9qibyUpyff7pHe7vkFgA8