Skip to content

chat:「继续查」按钮 — spec 加 resume 请求字段与 data-turn-end 部件,plugin-chatbot 在可续的最后一条回答下显示按钮 #38609

Description

@os-bob

Filing gate: ③ maintainer-directed, the spec and console half of objectstack-ai/cloud#5239. Source: maintainer. Verbatim, in that session: 「只是给一个继续按钮 应该是最通用的做法吧」 then 「立卡」.
Grading: area:ai · Feature · p2 · reach: the console ask chat, every turn that ends in a wrap-up on its limits · evidence: read (objectstack 696d02f5), independent design review; nothing built.
Reader: the seat working packages/spec/src/api/protocol.zod.ts / packages/spec/src/ai/ and ui/packages/plugin-chatbot.
Dedupe: resume turnId, continue button, data-turn-end → none open; related #37871 (question card, another end-of-turn part), #38048 (closed, the data-draft-review precedent this follows).

维护者速读

  • cloud#5239 让 ask 触顶后在服务端续跑同一轮(保留已读工具结果、给新预算)。前端要一个按钮,协议要两样东西。
  • 协议:chat 请求加 resume: { turnId };新增回合末部件 data-turn-end,内容为 { reason, wrapUp, resumable, resumesLeft, turnId };会话消息带上 turnEnd,刷新后按钮不丢。
  • 界面:只在最后一条助手消息且 resumable 时显示「继续查」。点击不新增用户气泡,流追加到同一轮。

Spec (lands first; cloud#5239 step 3 and the UI depend on it)

  • Chat request body: optional resume: { turnId: string } (packages/spec/src/api/protocol.zod.ts ~4585-4587).
  • New end-of-turn part schema data-turn-end, modelled on ai/draft-review.zod.ts:60.
  • AiConversationMessageSchema gains an optional turnEnd (protocol.zod.ts ~4644-4649).
  • Pin tests and generated baselines updated.

UI (ui/packages/plugin-chatbot, app-shell hydration)

  • Extract data-turn-end in mapMessages.ts (278-289, 594-606); render the button in ChatbotEnhanced.tsx (1004).
  • Send resume through useObjectChat.ts (withTurnId ~144-161, ~900-912); no user bubble; the stream appends to the same turn.
  • Hydration carries turnEnd (app-shell/src/console/ai/aiChatHydration.ts ~184, hooks/useChatConversation.ts ~515-655) so the button survives a refresh.
  • Hidden when not the last assistant message, when resumable is false or no resumes are left, or once the user has sent a new message. zh / en copy. E2E covers show, click, refresh, hide.

Done when

  • Spec merged and released in the pin cloud consumes.
  • UI merged with the e2e above, verified against cloud#5239's resume endpoint.

Not here

  • Server-side resume, turnEnd persistence and the ADR-0013 D3 amendment: cloud#5239.

Activity

  1. added
    priority:p2
    on Nov 29, 2026
  2. added theissue type on Nov 29, 2026
  3. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    Contributor

    triage#1 · zhuangjianguo · session_01QsR2jRH2X4frz9bBiZHNk4

    Triage: lands in packages/spec first (chat request resume: { turnId }, the data-turn-end part, turnEnd on conversation messages), then ui/packages/plugin-chatbot (the 继续查 button) · area:ai · domain:spec · Feature · p2 · pm:queue · size M. Rationale: maintainer-directed (filing gate ③, verbatim quoted), so pre-authorised; the spec half lands first and the cloud server half (cloud#5239) waits on it, so this card holds no cloud work and stays in this repository's lanes. The area:*, domain:* and state were missing; the grade stays as filed.

  4. added
    area:ai
    domain:spec
    pm:queue
    on Nov 29, 2026
  5. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu

    2026-11-30T04:40Z · Claim · zone o2-A (area:ai); the protocol.zod.ts hold behind #35529 is clear (#35529 closed), and no open PR touches the card's files at this read.

    Claim: PM loop round 1
    Session: session_01JQwxbXyLoBzNYY1U8SNPFu
    Account: os-warren
    Branch: new, from origin/main at 5ac1ee0bc8; the card thread's branch is named by a claim amendment on its first report
    Worktree: objectstack-issue-38609
    Domain: domain:spec
    Seat: repo:objectstack#2
    Area: o2-A (area:ai)
    File surface: packages/spec/src/api/protocol.zod.ts, one new or touched schema file under packages/spec/src/ai/, spec generated baselines and docs the gates regenerate, ui/packages/plugin-chatbot/src/** (mapMessages, ChatbotEnhanced, useObjectChat and their tests), ui/packages/app-shell/src/console/ai/aiChatHydration.ts, ui/packages/app-shell/src/hooks/useChatConversation.ts, changesets (stop on breach; explain in the report)
    Container & model: L, mode:thread, model: default (dispatch-gates --tier: no path-derived mandate; Clause ② SUSPECT surface — judged from content), effort: high
    Clause-②: yes — widens the published chat request (resume) and message (turnEnd, data-turn-end) schemas; a CONTRACT_REVIEW_TIER review is owed before the queue
    Metadata-protocol: none
    Responsibility: n/a — Feature
    Thread-read: none
    Premise: holds at 5ac1ee0bc8 — the chat request schema carries turnId (protocol.zod.ts:4597) and no resume request field; no data-turn-end / turnEnd exists in packages/spec/src or ui/packages/plugin-chatbot/src. The server that emits the part is not in this repository; the PR ships the schema and the UI, and names the emitting side in its report.
    Serial constraints cleared: #35529 (protocol.zod.ts) closed; overlap-check.mjs runs before every push.
    Pre-claim lane: packages/spec/** ⇒ domain:spec; ui/packages/** (file ownership only); area:ai, zone o2-A.
    Pre-claim deps: none open.
    Prior rulings read: triage 7258167601.

  6. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 30, 2026
  7. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu

    Dispatch order · #38609 (chat:「继续查」按钮 — spec resume 字段与 data-turn-end 部件) · zone o2-A (area:ai) · 2026-11-30T04:43Z

    Card #38609 is held by seat 2 (os-warren) by claim 7268992318. One card thread (mode:thread); the thread is the dev.

    • Branch: a new branch from origin/main; the thread names it to the seat on its first push, and the seat amends the claim.
    • Premise first, before any code: confirm on main that the chat request schema has turnId (packages/spec/src/api/protocol.zod.ts ~4597) and no resume request field, and that no data-turn-end part or turnEnd exists in spec or ui/packages/plugin-chatbot. Find which server emits the chat stream for the console (this repository or the cloud AI service) and name it. If the part cannot be shaped without a server half this repository does not hold, build the spec and UI halves, and file the server half as the card's remainder in the report — do not build outside the surface.
    • Build what the card's body lists: resume: { turnId } on the chat request, the data-turn-end part (modelled on ai/draft-review.zod.ts), optional turnEnd on AiConversationMessageSchema; the UI extracts it, shows the 继续查 button under the last resumable answer, sends resume with no user bubble, and hydration keeps the button across a refresh.
    • File surface: packages/spec/src/api/protocol.zod.ts, one schema file under packages/spec/src/ai/, the generated baselines and docs the spec gates regenerate, ui/packages/plugin-chatbot/src/** (and its tests), ui/packages/app-shell/src/console/ai/aiChatHydration.ts, ui/packages/app-shell/src/hooks/useChatConversation.ts, changesets.
    • Clause-②: yes (widens published schemas, additive and optional). A CONTRACT_REVIEW_TIER review is owed before the queue; the seat runs it.
    • Pins fail without the change; Clause-②: and Metadata-protocol: lines in the PR body and changeset, measured from the diff.
    • Do not: write a ## 席位核对 record, request reviewers, mark ready, enqueue.
    • Writes: PR create only via relay pr_create (draft, Fixes #38609 only if this PR completes the card, else Part of #38609); comments, labels and PR body only via relay write tools; report both counts.
    • Container & model: L, mode:thread, model: default (dispatch-gates.mjs --tier: no path-derived mandate), effort: high.
    • Report: the os-dev JSON report on this card, signed repo:objectstack#2 · os-warren · <the thread's session>; then one message to the seat-1 takeover thread with PR, head and key points.
  8. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu

    2026-11-30T04:57Z · Claim amendment to 7268992318: names the card thread's branch and admits three surface additions.

    Claim: PM loop round 1 (amendment of 7268992318)
    Session: session_01JQwxbXyLoBzNYY1U8SNPFu
    Thread session: session_01JQwxbYmVBS2cvoZWKGbx92
    Account: os-warren
    Branch: claude/project-thread-5o6334 (from origin/main at 5ac1ee0bc8)
    Worktree: objectstack-issue-38609
    Domain: domain:spec
    Seat: repo:objectstack#2
    Area: o2-A (area:ai)
    File surface: 7268992318's, with the schema file named packages/spec/src/ai/turn-end.zod.ts, plus three admitted additions: the new keys in every locale under ui/packages/i18n (key-parity test), one prop line in the console host ChatPane.tsx, and the ui/packages/plugin-chatbot README (ui/AGENTS.md rule 2)
    Container & model: L, mode:thread, model: default (dispatch-gates --tier: no path-derived mandate; Clause ② SUSPECT surface — judged from content), effort: high
    Clause-②: yes — widens the published chat request (resume) and message (turnEnd, data-turn-end) schemas; a CONTRACT_REVIEW_TIER review is owed before the queue
    Metadata-protocol: none
    Thread-read: none
    Premise: holds at 5ac1ee0bc8 (thread's read). The stream producer is the cloud AI service; its half is cloud#5239, and this PR is Part of #38609 unless that lands first.

  9. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#2 · os-warren · session_01JQwxbYmVBS2cvoZWKGbx92
    os-dev-report

    Written 2026-11-30T06:41Z. Head f4fbc45edcd6583d864d71f7d0b6f7a47cdae9b0.

    {
      "status": "done",
      "branch": "claude/project-thread-5o6334",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38698",
      "session": "session_01JQwxbYmVBS2cvoZWKGbx92",
      "premise_still_valid": true,
      "summary": "Spec: TurnEndSchema + TURN_END_PART_TYPE ('data-turn-end') in a new ai/turn-end.zod.ts (closed shape, modelled on draft-review.zod.ts), AiChatRequestSchema.resume { turnId } and AiConversationMessageSchema.turnEnd (nullable, optional). UI: plugin-chatbot reads the newest data-turn-end part through the schema, draws Continue under the conversation's last answer only when the turn end is resumable with resumesLeft > 0 (not streaming, not read-only, host handler present), and useObjectChat().resumeTurn sends resume with no user message so the rest streams into the same answer; the turn end is a kept data part so it survives API-mode store rebuild, the message cache and server history (toUIMessages writes the stored turnEnd back as the part). Premise verified at 5ac1ee0b: no resume, data-turn-end or turnEnd existed. The stream producer is the cloud AI service (agent routes + stream encoder); its half is objectstack-ai/cloud#5239, so the PR is Part of #38609.",
      "tests": "packages/spec/src/ai/turn-end.test.ts (new) green; spec package 914 files / 28919 tests passed, typecheck exit 0. plugin-chatbot continueTurn-38609.test.tsx 11 passed, incl. one test through the real AI SDK chat runtime with a stubbed stream (sent body = resume {turnId:'u1'}, messages [u1,a1], continuation lands in the same bubble, control hides). app-shell AiChatPage.turnEndReload-38609.test.tsx 3 passed (server history + cache fallback + CONTROL). UI suite: 337 files green after the zh-Hant regen. Ablations, each reverted: drop the resume body -> 2 failed; drop the toUIMessages turnEnd write-back -> 1 failed.",
      "gates": "Local: dispatch-gates.mjs --commands derived 119 commands; 114 exit 0, check:llms-txt exit 1 (stale count, fixed in 86b48147, re-run exit 0), NOT MEASURED exit 3 (environment): check-plugin-teardown-shape --self-test (shallow clone), spec check:skill-examples (prerequisite build), check:dual-build-cjs-loads (full build), check:type-check-debt (re-measure prerequisite) — CI covers each. ui check:doc-snippets is not in the derived list; run locally after the Lint · UI red: exit 0 (550/550 blocks). CI at f4fbc45edcd6583d864d71f7d0b6f7a47cdae9b0: every check-run completed, 63 success, 9 skipped, 0 failure (incl. Check Changeset, Type Check · source gates, Lint · CI, release & engine gates, Lint & Repo Gates, Lint · UI). Landing-sweep reds and root causes: (1) Check Changeset — authorable-surface shards moved, so Metadata-protocol: added + spec minor (changeset and PR body fixed); (2) Type Check · source gates — llms.txt schema counts stale; (3) Lint · CI, release & engine gates — the reload test reached ChatPane's dynamic plugin-grid import (test-source alias gate), now imports aiChatHydration directly; (4) Lint & Repo Gates — aggregate of the above; (5) Lint · UI at 86b48147 — the docs snippet passed useObjectChat().messages straight to ChatbotEnhanced, now through toRuntimeMessages. No re-run kicks.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "3 — fleet-write relay: pr_create (#38698, draft), issue_patch (PR #38698 body: declaration lines), comment (this report)",
      "classifier_refusals": [],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": []
    }

    Deviations, all in the PR's Acceptance notes:

    • Metadata-protocol: added, not the claim's none — measured from the diff (authorable-surface shards move); @objectstack/spec graded minor. Skills-docs: none with its reason.
    • Clause-②: yes (widening) — the claim's yes with the arm its text states (additive, optional). The CONTRACT_REVIEW_TIER review is the seat's.
    • Surface beyond the original claim, admitted by the amendment: chatbot.continueTurn.* in all eleven locales, one prop line in ChatPane.tsx, the plugin-chatbot README, and the frontend docs page section (ui/AGENTS.md commandment 2); plus packages/spec/llms.txt counts (generated-index gate).
    • No reviewer requested, not marked ready, not enqueued (dispatch order; release freeze).
    • No browser E2E against a live stack: the cloud AI service neither emits data-turn-end nor accepts resume before cloud#5239. Card done-when "verified against cloud#5239's resume endpoint" stays open.
  10. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu

    2026-11-30T06:50Z · Claim amendment to 7269233060: admits content/docs/frontend/plugins/plugin-chatbot.mdx. The snippet now goes through toRuntimeMessages (Lint · UI), and the contract review 7271059472 found this file was not listed. The Metadata-protocol line is added (spec minor): the diff moves the authorable-surface shards, as the dev measured. Everything else is unchanged.

  11. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#2 · os-warren · session_01JQwxbYmVBS2cvoZWKGbx92
    os-dev-report

    Written 2026-11-30T07:32Z. Contract-review round on PR #38698: S1 and S2 from comment 7271059472, delta f4fbc45edc..1c98384067c54fe893f946905d30153ec126029d.

    {
      "status": "done",
      "branch": "claude/project-thread-5o6334",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38698",
      "session": "session_01JQwxbYmVBS2cvoZWKGbx92",
      "premise_still_valid": true,
      "summary": "S1: withTurnId no longer stamps the top-level turnId when the body carries resume (useObjectChat.ts), and AiChatRequestSchema.resume plus turnId's own description say the top-level key is not read on a resume, so the D1 dedup never answers a resume from store. S2: the resume describe and the turn-end docblock state that the chat sends the answer's id as the request's messageId and that the resume stream's start chunk carries that id or none, since with ai 7.0.118 a start naming another id pushes a second answer. The changeset text says both. N1, N2 and the retry-idempotency note are listed under 'For cloud#5239' in the PR body, not fixed here.",
      "tests": "continueTurn-38609.test.tsx 14 passed (was 11): request pin now asserts resume + messageId 'a1' and no turnId, with a CONTROL that a request without resume is stamped turnId 'u1'; the runtime test asserts the sent body has messageId 'a1' and no turnId; new runtime test: a start chunk carrying messageId 'a1' keeps one answer bubble; CONTROL runtime test: a start carrying 'a-other' draws the answer twice. Ablation (reverted): stamping turnId on a resume again -> 2 failed (request pin, runtime test). plugin-chatbot + app-shell console/ai + hooks: 227 files / 2039 tests passed. Spec: src/ai/turn-end.test.ts + src/api 65 files / 2151 tests passed; typecheck exit 0.",
      "gates": "Spec check:generated --fix: 1 of 14 stale (references docs, the describe text) regenerated, re-check green. plugin-chatbot type-check exit 0; eslint on the three changed files exit 0 (8 warnings, none on changed lines). CI at 1c98384067c54fe893f946905d30153ec126029d: every check-run completed, 65 success, 11 skipped, 0 failure.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "2 this round — fleet-write relay: issue_patch (PR #38698 body: S1/S2 text, tests, For cloud#5239 section, docs-page admission), comment (this report)",
      "classifier_refusals": [],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": []
    }
    • The PR body's Acceptance notes now credit the content/docs/frontend/plugins/plugin-chatbot.mdx section to the seat's amendment after the review, not to amendment 7269233060.
    • Still draft, no reviewer requested, not enqueued.
  12. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#2 · os-warren · session_01JQwxbXyLoBzNYY1U8SNPFu

    2026-11-30T09:24Z · PR #38698 landed; the card stays open.

    PR #38698 (the turn-end protocol and the console's Continue button) merged at 2026-11-30T08:51Z. Contract PASS 7272843866, seat ACCEPT 7272862815. The cloud half (the AI service rebuilding and resuming the same turn) continues on its own card and builds on this protocol. Carried: N3 (the spec's turn-end docblock does not repeat the earlier-approval exception) and the plugin-chatbot changeset line.

  13. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z

    2026-11-30T12:50Z · Hold, set by seat repo:objectstack#3 (zone o2-A area:ai handed to this seat by repo:objectstack#2 · os-warren, #38600 comment 7278933374, which lists this card as undispatched).

    No code work remains in this repo: PR #38698 merged at 2026-11-30T08:51Z. The card's two Done-when legs both wait on outside events:

    1. The spec change must ship in a version cloud installs. npm @objectstack/spec is at latest 18.6.0 and next 19.0.0-next.2 (both published 2026-11-28, before the merge), so feat(chat): a Continue button for a stopped ask turn — spec resume field and data-turn-end part, plugin-chatbot UI #38698 is unreleased.
    2. The UI half must be checked against the resume endpoint of objectstack-ai/cloud#5239, which is still open.

    Per the unreleased-platform rule this card moves to pm:on-hold, grade unchanged, assignee cleared.

    Restart-when: an npm @objectstack/spec release whose CHANGELOG carries the #38698 changeset is published AND objectstack-ai/cloud#5239 is closed. On wake: one verification pass of the UI against the cloud#5239 resume endpoint, then close as completed (or file a finding for any gap).

  14. added
    pm:on-hold
    and removed
    pm:dispatched
    on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:aidomain:specpm:on-holdpriority:p2

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions