Skip to content

AI 问询页:同一次回答拆成多条没有正文的助手消息,步骤之间空白过大 #38457

Description

@baozhoutao

现象

在 AI 问询页(ai:chat)提一个需要多次调用工具的问题,比如「我有一个30万的数字化项目。立完项之后我要填什么表?」。回答里的步骤一段一段往下排,段与段之间空白很大,大约 55–60px,看起来像几轮不相干的问答,不像同一次回答里的几个步骤。

当时屏幕上从上到下是这样:

  • 1 步 在知识库中查找 ×2
  • (大段空白)
  • 1 步 查找相关记录
  • 计算方式
  • (大段空白)
  • 2 步 读取这条记录 · 查找相关记录
  • 计算方式

原因

这三段不是一条消息,而是三条各自独立的助手消息,每条都没有正文,只有步骤行(有的还带「计算方式」)。消息之间的间距是给「一问一答」分隔用的,现在落到了同一次回答的步骤之间:

  • ui/packages/plugin-chatbot/src/elements/conversation.tsx:43:ConversationContent 自带 gap-8(32px)
  • ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx:1998:外层又加了 space-y-4(16px)
  • ToolPhaseSummary 自身还有 mb-2

三项叠在一起,每段之间就差不多有 55–60px 的空白。

另外,「计算方式」(AnswerSourceBlock)是按消息出的,所以每条消息都重复出了一次。

建议

  • 同一次回答里、连着出现的几条没有正文的助手消息,显示时合成一组:组内的步骤行和「计算方式」按普通行距排,只有不同轮的问答之间才留大间距。
  • 合成一组后,「计算方式」在组内只出一处(可以把多个来源合到一起)。

验收

  • 上面这个问题再问一次,几段步骤之间的距离和一条消息内部的行距一样,不再有大段空白。
  • 不同轮的问答之间,间距保持现在的样子。
  • 同一次回答里,「计算方式」不重复出现。

Activity

  1. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    triage#1 · sunhaolin · session_017xRBcSxvUE3fDrox79CL9t

    Triage: lands in ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx (the message loop's spacing and the per-message AnswerSourceBlock), elements/conversation.tsx (gap-8), chat/toolSummary.tsx and AnswerSource.tsx · area:ux · domain:ui · Bug · p2 · pm:queue · size M. Rationale: one answer is split into several body-less assistant messages. Each is spaced like a separate turn (~55–60 px), and 「计算方式」 repeats inside one answer. The answer is right but looks like several replies, which is "looks wrong", so area:ux. Grouping them in the existing renderer needs no new interface, so it is a Bug at p2 by the UX rule. The renderer is shared, so the drawer changes too. At claim, check whether the split itself is a stream or hydration artefact (a root cause elsewhere). Overlap check against #37874, which also touches ChatbotEnhanced.tsx.

    Recorded 2026-11-29T03:52Z.

  2. added
    domain:ui
    pm:queue
    priority:p2
    on Nov 29, 2026
  3. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#5 · os-project-manager · session_01FEkQ5pH8MaBBP5T2dVcTHL
    Claim: PM loop round 3 · 2026-11-29T06:53Z
    Session: session_01FEkQ5pH8MaBBP5T2dVcTHL
    Account: os-project-manager
    Branch: claude/issue-38457-chat-steps-one-group
    Worktree: objectstack-issue-38457
    Domain: domain:ui
    Seat: repo:objectstack#5
    Area: o5-ux
    File surface: ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx (the message loop's spacing and per-message AnswerSourceBlock), ui/packages/plugin-chatbot/src/elements/conversation.tsx (gap-8), ui/packages/plugin-chatbot/src/chat/toolSummary.tsx, ui/packages/plugin-chatbot/src/AnswerSource.tsx, new test files named for the card under ui/packages/plugin-chatbot/src/, .changeset/38457-*.md. Stop on breach; explain in the report.
    Container & model: S, mode:subagent, model: opus (dispatch-gates --tier on the surface: "no path-derived mandate" ⇒ default), effort: medium
    Clause-②: no
    Metadata-protocol: none
    Responsibility: unknown — the os-dev report names the commit that split one answer into several body-less messages, if measurable
    Thread-read: 7250314915
    Premise: holds on main dccf836 — ConversationContent gap-8 (elements/conversation.tsx:43), outer space-y-4 (ChatbotEnhanced.tsx:697, moved from :1998), AnswerSourceBlock per message (:919)
    Prior rulings read: ToolPhaseSummary, AnswerSourceBlock, ConversationContent, assistant message grouping → 0 hits; none; thread: triage 7250314915
    Serial constraints cleared: seat 3's #37874 released 7251808187 with no code left (PR #38004 merged), so the earlier ChatbotEnhanced.tsx overlap is gone; check-handover --inflight on the surface: clear; overlap-check before every push
    Pre-claim lane: area:ux · domain:ui (path ui/packages/plugin-chatbot) · Bug · p2
    Pre-claim deps: none named

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

    @objectstack-fleet
    Contributor

    repo:objectstack#5 · os-project-manager · session_01FEkQ5pH8MaBBP5T2dVcTHL
    os-dev-report

    {
      "issue": 38457,
      "status": "done",
      "branch": "claude/issue-38457-chat-steps-one-group",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38530",
      "session": "session_01FEkQ5pH8MaBBP5T2dVcTHL",
      "premise_still_valid": true,
      "summary": "Render-time grouping in ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx: runs of 2+ adjacent finished assistant turns with no body (no prose or only the (called ...) placeholder, no chart/question/citations/draft review) render as one conversation child (data-testid assistant-step-group, flex-col gap-2 = MessageContent's in-message spacing) with ONE AnswerSourceBlock under the last step carrying all steps' sources in call order (AnswerSourceBlock already takes a list, so merging drops nothing). A user turn or a prose turn ends a run, so the turn gap between separate Q&A is unchanged; the loop body moved verbatim into a renderMessage closure apart from its source list. Measured producer: the store persists one assistant row per step (AI service, outside this repo) and app-shell toUIMessages maps one row to one message, the same shape the objectui#10899 hydrated-step test documents; no single splitting commit in this tree (Responsibility: not measurable here). I did not merge at hydration: the card asks for render grouping of body-less messages only, and merging rows would also join prose rows and collapse step rows into one summary, a different visible result. Only ChatbotEnhanced.tsx, a new card-named test and the changeset changed; conversation.tsx, toolSummary.tsx and AnswerSource.tsx are untouched.",
      "tests": "At head 2a6f16a7: pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-chatbot/ -> Test Files 83 passed (83), Tests 775 passed (775); pnpm --filter @object-ui/plugin-chatbot type-check -> exit 0 (os-verify-lock VERDICT command-exit 0). New pin file src/__tests__/ChatbotEnhanced.stepGroup-38457.test.tsx: 3 passed (group of 3 body-less steps = one group, 2 conversation children, gap-2, one answer-source block with sections [crm_project, crm_form]; CONTROL separate turns -> no group, 4 children, 2 blocks; CONTROL prose turn ends the run). Ablations through scripts/ablation-replace.mjs (src import, no dist leg needed): (1) 'if (run.length > 1) segments.push' -> 'if (false) segments.push', blob 01861fd0->22149602, result 1 failed / 2 passed (group pin red); (2) merged last-step sources -> per-message answerSourcesOf(message), blob 01861fd0->59bc3ad7, result 1 failed / 2 passed; restore proven: hash-object = HEAD blob 01861fd0, git diff HEAD empty. Dependency closure built first: pnpm --filter '@object-ui/plugin-chatbot^...' build, VERDICT command-exit 0 (the first test run failed to resolve @objectstack/spec/system before that build).",
      "gates": "Local: node scripts/pm/dispatch-gates.mjs --commands at 2a6f16a7 derived 38; all 38 ran with exit 0 recorded before any pipe; --ran reconciliation: 38 derived, 38 run, 0 NOT-MEASURED (a DERIVED zero, every line carries an exit code). Inside the 38: pnpm --dir ui exec vitest run scripts/ -> Test Files 172 passed, 2 skipped; Tests 5159 passed, 2 skipped. Outside the derivation: pnpm check:changeset-fixed exit 0 (its roster is under .changeset); (cd ui) pnpm check:new-line-citations -> 0 new citation(s), exit 0; overlap-check VERDICT clean exit 0. CI check-runs on PR #38530: NOT MEASURED, reason: report delivered at open, CI convergence is the PM's.",
      "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "2 — fleet-write relay pr_create (POST /repos/objectstack-ai/objectstack/pulls draft, then POST /issues/38530/assignees [os-project-manager]); post-stamped os-dev-report comment on issues/38457. git push is not counted (not a REST write).",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed — the final prose answer after a step group is still its own conversation child, so the turn-sized gap remains between the last step and the answer text; the card limits grouping to body-less messages (PR Acceptance notes)",
        "carrier: none · noted, not filed — not verified in a browser: the AI chat page needs a live AI service and a model, neither present in this container; layout pinned in jsdom only"
      ]
    }
  6. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#5 · os-project-manager · session_01FEkQ5pH8MaBBP5T2dVcTHL
    Delivered 2026-11-29T08:29Z: PR #38530 merged into main 2026-11-29T08:27Z (L1-b ACCEPT 7252847713, landing 7252856301). The card closed on Fixes #38457; this strips the stale pm:dispatched claim. The live re-ask in a browser stays NOT MEASURED (no AI service in the container).

  7. removed
    pm:dispatched
    on Nov 29, 2026
  8. added a commit that references this issue on Dec 1, 2026
    d1a06a3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area:uxdomain:uipriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions