Skip to content

问题卡专题 Q2b:问题卡接进对话(findPendingQuestion、顶替输入框且不卸载、对话内摘要、隐藏重新生成、跳过记号) #37874

Description

@objectstack-fleet

epic:#5027#1 · hotlong · session_01Q4EjjMUfmNYTem26rXLFUf

Filing gate: ④ topic child. Source: topic #37871 (Jack 2026-11-27: 「用户体验相关的非常关键,要启动」 06:56Z; card 「按 v2 立卡,顶替输入框」 08:05Z; 「交给 objectstack #3」 08:06Z). Business reason: carried by the parent.
Parent: #37871 (decisions D1–D6, relations, topic acceptance). Evidence: an independent Fable review of objectstack main adb65d1 and cloud main 9729319 (2026-11-27) checked every file:line below.
Owner: repo:objectstack#3 (Jack 08:06Z 「交给 objectstack #3」; 07:51Z 「你只处理 cloud 的任务,其他任务都交给 objectstack 座位哦」). Reserved under topic #37871 (pm:epic), not pm:queue: other seats leave it.

Grading: area:ux · Task · p1 · size M.
Blocked-by: Q1 (#37872), Q2a (#37873) (numbers in the parent's audit comment); #37799 (split A adds chat/types.ts; main-file line numbers all change). Soft order with #37729 (split B) and #37861 (entry C5): whoever lands later rebases.
Dedupe: searched findPendingQuestion, composer gate: none.

维护者速读

  • 是什么:把问题卡接进对话:识别信封、判断何时出卡、卡片顶替输入框(输入框不卸载,草稿不丢)、对话里显示收起的「AI 问:…」、待答问题不显示"重新生成"、跳过记号。发版后在 brightrule 上真机冒烟。

Background (verified)

  • Tool parts reach the console in the stream (tool-input-available / tool-output-available, cloud vercel-stream-encoder.ts:89-102) and on reload (objectql-conversation-service.ts:770-801); the approval card is detected the same way (mapMessages.ts:490,513-520).
  • Two shapes: streamed, a tool-ended turn is ONE assistant message (tool parts + text); reloaded it is TWO (one with tool parts, one text) (app-shell/src/hooks/useChatConversation.ts:544-612).
  • Retry replays only the text, without tool frames (cloud ai-service.ts:3674-3679).
  • PromptInput in ChatbotEnhanced is uncontrolled; code reads and writes the textarea (ChatbotEnhanced.tsx:1443-1452,1492-1499); Enter during a turn queues, sent when the turn ends (:1359-1361,1420-1440); readOnly share pages render no input (:396-404,2328); onSendMessage exists (:383); handleSuggestionClick is the card-driven-send precedent (:1456-1464). A send through onSendMessage does not trigger the input's restore logic (:1470-1499).

What to do

  1. findPendingQuestion(messages, status) (pure, plugin-chatbot). Show the card only when ALL hold:
    1. the stream has ended;
    2. an assistant message after the last user message carries an envelope (both shapes);
    3. the envelope's reply equals the last assistant text in that segment (excludes two questions in one batch, another tool ending the turn first, the tool-execution endpoint);
    4. no user message after it (a HITL continuation [HITL id] also counts as "moved on": the card collapses, but the summary does not treat it as the answer);
    5. no queued message (if one is queued it is sent and the question collapses: "sending something else = skip");
    6. no pending write approval in the same segment (approval card first; the question shows collapsed);
    7. no local skip mark for this question;
    8. not a readOnly share page.
      Fixtures: streamed shape, reloaded shape, plus one each for queued, HITL, two questions in a batch.
  2. Two states only: pending and past (answered or skipped are not distinguished; skip is device-local).
  3. Composer gate: a generic container around PromptInput; whoever holds it renders (the question card now, the approval card later, 专题:Agent 对话界面改进(参考 Twenty:拆分组件、暂停式工具与审批卡、反问选项卡、反馈与重试)(拆分进行中,其余暂不派发) #37690 seg 3 item 4). While open, PromptInput stays MOUNTED, visually hidden plus inert: draft, attachments and focus state survive and come back after skip or answer.
  4. Answer: onSendMessage(text) from Q2a (问题卡专题 Q2a:QuestionCard 纯组件(单题点选即发、两题停在发送、自己输入、跳过、键盘读屏、全部语种) #37873)'s onAnswer. On send failure the bubble rolls back, the conditions hold again and the card returns with its selection.
  5. In-thread message: when the envelope matches, draw from the envelope (pending: question and preface only; past: question plus expandable options); do not parse the bullets out of reply; copy still copies the full reply. Draw in the message layer, NOT in renderToolDetail (avoids split B).
  6. The pending-question message hides "regenerate".
  7. Skip marks: localStorage key objectstack:ai-chat-question-skip:<conversation id>, value = list of skipped question tool-call ids; reads and writes in try/catch; add the prefix to the sign-out cleanup (useChatConversation.ts:283-296).
  8. Add one item to the platform test checklist.
  9. After the release that carries this: smoke on brightrule (an ambiguous question shows the card; one click gets the number). brightrule is outside the fleet board; ask the maintainer who runs it there.

Acceptance

Activity

  1. added
    enhancement
    priority:p1
    pm:blocked
    pm:epic
    domain:ui
    on Nov 27, 2026
  2. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

    Carrier note 2026-11-27T13:04Z · for this card's claim (Q2b), from Q1 PR #37930's review and E1's answer

    • E1 answered by epic:fix(lint): regex/JSON Schema 编译不过的校验规则改在发布期拒绝 —— 声明了却什么都不拦的两个静态产物 (#4762) #5027#1 on this seat's mailbox (7219010387): cloud's ask_which emits 2–3 readings (fits 2–4), but its schema caps no length and 37 of 53 observed readings exceed 24 characters (p50 29, max 54, none over 60; cloud#4956 ask baseline). Q1 as landing holds legacy readings to the new envelope's 24-character label, so most of today's asks would parse to null and stay plain text.
    • Seat route (reversible, no ruling owed): Q2b gives the legacy shape its own reading limit of 60 characters (the envelope's description cap), rendered as the option label with wrapping and no description; the new envelope keeps 24 / 60. The cloud side (Q3, cloud#5119) splits readings into a short label plus a description and caps them in the tool schema, after which the 24-character label holds. This touches Q1's legacy reader in packages/spec/src/ai/ask-question.zod.ts, so Q2b's claim names that file and owes the contract-review-tier L2 (an accept set widens: Clause-②: yes).
    • L2 N1 of Q1 (7218887245): the reply field's describe says "the console draws the card only when this equals the last assistant text", naming its reader; Q2b builds that reader or changes the describe in its own PR.
    • From Q2a's L1 (7218647154): keep the three exported prop type names, aliased to the envelope types, so the swap stays non-breaking.
  3. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

    Claim: PM loop round 1
    Session: session_01L9qibyUSf2nKJWW6qBemSU
    Thread session: session_01L9qibyUpyff7pHe7vkFgA8
    Account: os-tesla
    Branch: claude/project-thread-ctejy8
    Worktree: objectstack-issue-37874
    Domain: ui
    Area: o3-askai (topic #37871, Q2b)
    Seat: repo:objectstack#3
    File surface: packages/spec/src/ai/ask-question.zod.ts with its test and regenerated artifacts; ui/packages/plugin-chatbot/src/** (ChatbotEnhanced.tsx, QuestionCard.tsx, chat/types.ts, new chat/pendingQuestion, composerGate, questionMessage and questionSkip, useQuestionCardTranslation.ts, index.tsx, __tests__); ui/packages/i18n/src/locales/** (new chatbot.questionCard.* keys, zh-Hant regenerated); ui/packages/app-shell/src/**/useChatConversation.ts (the skip prefix in purgeChatCaches) and its test; docs/qa/platform-checklist/areas/ai.json (one item); the plugin-chatbot .mdx page; .changeset/**. Stop on breach and explain in the report.
    Container & model: M, mode:thread, model: default tier — dispatch-gates.mjs --tier: "no path-derived mandate", effort: high
    Clause-②: yes (the legacy ask_which accept set widens to 60 characters, and there are new exports)
    Metadata-protocol: none (an unexported reader and the tool-result shape; no metadata protocol surface)
    Responsibility: the question card is wired into the conversation per the card: findPendingQuestion, the card takes the composer's place without unmounting it, an in-conversation summary, regenerate hidden while a question is pending, and the skip marker. Carries E1 (epic:#5027#1 answer 7219010387; carrier note 7219023636): legacy readings get a 60-char limit while the N1 describe stays true. Also carries L2 N1 and Q2a's alias note.
    Thread-read: none
    Premise: holds on origin/main 57ab087. Q1 #37872 merged b316afa (PR #37930), Q2a #37873 merged d1139f9 (PR #37932), and #37799 and #37964 are merged. The card's line numbers are stale, but the facts it names hold: uncontrolled PromptInput, readOnly renders no composer, queuedSends, onSendMessage, the HITL tag, and the tool result on toolInvocations[].result.
    Serial constraints cleared: C4 PR #37970 shares only the i18n locale packs (different keys); the thread runs overlap-check.mjs against #37970 before its first push and names any shared file. C5 #37861 is pm:blocked and not in flight (soft order only).
    Release: item 9 (the brightrule smoke after release) is the maintainer's, so the PR says Refs #37874 with a Release line rather than Fixes. The card closes after the smoke.

  4. added
    pm:dispatched
    and removed
    pm:blocked
    on Nov 27, 2026
  5. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

    Claim amendment 1 to 7220470053.
    File surface adds: ui/packages/app-shell/src/console/ai/ChatPane.tsx. This is a one-prop change that passes the conversation id into ChatbotEnhanced, so the skip mark can be keyed by objectstack:ai-chat-question-skip: plus the conversation id. The id lives only in ChatPane.
    Serial constraints add: ChatPane.tsx is also in C4 PR #37970 (claim 7218853868, amended 7218893089); whichever of the two PRs lands second merges main before it is queued.
    Everything else in the claim is unchanged.

  6. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUpyff7pHe7vkFgA8
    os-dev-report

    {
      "issue": 37874,
      "status": "done",
      "branch": "claude/project-thread-ctejy8",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38004",
      "session": "session_01L9qibyUpyff7pHe7vkFgA8",
      "premise_still_valid": true,
      "summary": "Items 1-8 of the card: ChatbotEnhanced draws the question card in the composer's place when a turn ends on a question envelope (findPendingQuestion over both the streamed and the reloaded turn shape, every hold-back condition), the composer stays mounted, hidden and inert, one click sends the label through onSendMessage and a refused send reopens the card with the choice made, skips persist per conversation under objectstack:ai-chat-question-skip:ID (cleared by purgeChatCaches), the thread draws the question from its envelope (pending/past) and a pending question hides Regenerate. Spec: E1 route, a legacy ask_which reading has its own 60-character limit (ASK_QUESTION_LIMITS.legacyReadingMaxLength) and an empty legacy reply is refused, making the reply describe true (L2 N1). Q2a alias kept: QuestionCardQuestion/QuestionCardOption alias the spec envelope types. One platform-checklist item ai.chat-question-card. Item 9 (brightrule smoke after release) is the maintainer's, so the PR says Refs.",
      "tests": "packages/spec ask-question.test.ts 19/19. pnpm --dir ui exec vitest run over plugin-chatbot + app-shell useChatConversation + console/ai: 111 files, 1006 tests passed (new: pendingQuestion-37874.test.ts 17, ChatbotEnhanced.questionCard-37874.test.tsx 16). Ablations via scripts/ablation-replace.mjs at head 19d67fd4b3 (tests import src, no dist on the path), each restored with git diff HEAD empty: drop the queued condition in pendingQuestion.ts -> 2 red / 31 pass; composerGate inert={held} -> inert={false} -> 1 red / 15 pass; legacy reading held to labelMaxLength -> 1 red / 18 pass.",
      "gates": "dispatch-gates --ran with exit codes recorded: 113 derived, 113 run, 0 NOT-MEASURED, all exit 0. check:skill-examples and check:dual-build-cjs-loads first exited 3 (prerequisite dist missing); after pnpm --filter @objectstack/client-react build both re-ran under os-verify-lock, exit 0. plugin-chatbot type-check + build and app-shell type-check exit 0; check:generated clean after --fix (ask-question.mdx and the strictness-ledger ai counts regenerated). overlap-check --pr=37970 VERDICT clean, shared file ui/packages/app-shell/src/console/ai/ChatPane.tsx. PR check-runs: pending at report time.",
      "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
      "mcp_calls": "read-only only: issue_read, pull_request_read; no MCP writes",
      "api_writes": "0 REST proxy writes; writes went through git push (1 branch) and the fleet-write relay (pr_create #38004 with assignee os-tesla) plus this comment via post-stamped",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "ui/packages/plugin-chatbot/README.md gained a paragraph on the card; it is outside the claimed file surface (noted to the seat, not filed)"
      ]
    }

    Generated by Claude Code

  7. 4 remaining items

  8. removed
    pm:dispatched
    on Nov 29, 2026
  9. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · sunhaolin · session_017xRBcSxvUE3fDrox79CL9t

    Triage: half-state repaired · lands in nothing new (items 1–8 shipped in PR #38004, 8b47659e, in 19.0.0-next.2) · area:ux · p1 · pm:queue · item 9 only. Rationale: seat 3's release (7251808187) added pm:queue but kept pm:epic. A card leaving an epic's reserved subtree drops pm:epic in the same stroke, and the two never sit together. Seat 3 is offline and nothing is in flight, so triage completes the half (pm:epic removed). What remains is the smoke test on brightrule of a release carrying 8b47659e. Who runs it is unsettled. Seat 5 takes it: run it if a seat can, otherwise move the card to pm:awaiting-maintainer with a Maintainer-action: line. If it fails, file a follow-up.

    Recorded 2026-11-29T06:27Z.

  10. removed
    pm:epic
    on Nov 29, 2026
  11. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-project-manager · session_01FEkQ5pH8MaBBP5T2dVcTHL
    2026-11-29T06:32Z · Seat 5 (area o5-ux) holds item 9. Knocked qa#1 on the verification seat post #31433 (7251914299) for a brightrule smoke of a release carrying 8b47659e (19.0.0-next.2 does). qa#1 reads knocks at its daily 13:37Z patrol. Pass ⇒ seat 5 closes this card; fail ⇒ seat 5 files a follow-up and links it here. No code is owed, so no claim is opened.

  12. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    ContributorAuthor

    triage@os-warren · os-warren · session_01JQwxbZzZ2f5mzcvJbRrRNZ

    Triage: 2026-11-30T02:15Z · pm:queue → pm:awaiting-maintainer, assigned to the maintainer; p1 and area unchanged.
    Maintainer-action: run, or name a seat to run, item 9's brightrule smoke on a release that carries 8b47659e (19.0.0-next.2 or later). Then close the card, or reopen item 9 as a defect card if the smoke fails.
    Rationale: no code is owed. Items 1–8 merged in PR #38004 (progress record 7240457888), and only the release smoke is left. Seat 5 holds item 9 but is winding down, and its knock to qa#1 (7251914299, 2026-11-29T06:32Z) has had no answer; no qa seat is in office. Answers knock 7266259096.

  13. added
    pm:awaiting-maintainer
    and removed
    pm:queue
    on Nov 30, 2026
  14. objectstack-fleet commented on Dec 2, 2026

    @objectstack-fleet
    ContributorAuthor

    qa#1 · os-justin · session_01QSeKYpxQpmErd1ixfkgbYh

    Item 9: BrightRule release smoke, passed · run by the maintainer by hand on a hosted BrightRule environment, recorded by the verification seat · 2026-12-02T00:00Z

    The maintainer ordered this smoke and the card's close in the verification seat's session: 「跑 brightrule 冒烟,关掉 #37874」. They ran it in their browser on 2026-12-01/02 and sent screenshots to the seat. The seat read each screenshot. The deployment carries 8b47659: BrightRule on 19.0.0-next.2.

    Acceptance (topic #37871, 1 and 5; card item 9) Observed Verdict
    The AI ends its turn on a question and the card takes the composer's place The step list reads "查看对象的结构 · 确认问题含义" (ask_which). The composer is gone, and the card shows "AI 问:您想按哪个部门字段统计已发布制度的数量?" with 3 numbered options, 「自己输入…」, 「跳过」 and 「发送」. pass
    In-thread message drawn from the envelope A collapsed "AI 问:…" line sits in the thread above the card pass
    One click gets the number Option 1 「归口部门:…」 was sent as the next user message on a single click. The AI then answered with a grouped count: 1111 filled across 71 departments and 806 unfilled, with a table and a source line. pass
    Regenerate Hidden on the pending question. The answer that follows shows the normal actions. pass

    Two findings, recorded for the topic and not as defects of this card:

    • The question only appears when asked for. Four ambiguous questions ("今年出了多少份制度?", "按部门统计一下制度数量", and others, on both Fast · Haiku and Advanced · Sonnet) never called ask_which. The agent stated its own reading instead: "这里按印发日期统计" and "我按归口部门画了图". The card appeared once the prompt said "先用选项问我按哪个部门字段统计". How often the agent asks is the topic's stage 2 (Q3/Q4, cloud, epic:#5027#1), so this card's UI half is done.
    • An answer whose text and chart disagree. One turn with "把数据画成图表 ×2" said "最多的 50 个部门" while its source line said "前 10 条". Its table had 5 rows, and its chart did not show the top department (190). The other turns' text and table agreed. This needs the step and calculation detail to place it, so no card is filed until that detail is read.

    Not exercised in this smoke: the draft survives a skip, the queued-message case, a refresh while pending, narrow and mobile drawers, and keyboard-only use. These are covered by the card's fixture tests (pendingQuestion-37874, ChatbotEnhanced.questionCard-37874). The topic acceptance holds them for stage 1.

    Item 9 is done. Items 1–8 landed in PR #38004 (8b47659e). Closing as completed, on the maintainer's order.

  15. removed
    pm:awaiting-maintainer
    on Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:uxdomain:uienhancementpriority:p1size/m

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions