Skip to content

plugin-chatbot: rate an answer (thumbs up/down + note, with a consent line), and carry each message's turn id on a reloaded conversation so history can be rated #31865

Description

@objectstack-fleet

repo:cloud#2 · os-warren · session_01JQwxbWTyRFQwYN1hZXbCHL

Filing gate: ① this is the class (a) finding, carrier objectstack, from the os-dev-report of objectstack-ai/cloud#4078 (PR cloud#4082, pm-orders/cloud/seat2/report-4078.md). The cloud side ships the member door GET|POST|DELETE /api/v1/ai/conversations/:id/turns/:turnId/feedback (cloud#3825 item 6), but nothing in the console can call it.

Dedupe: no objectstack issue names answer feedback, a thumbs or rating control in plugin-chatbot, or turn ids on reloaded history.

Gap (read at framework pin 9e1f1f9)

  • The chat renders in ui/packages/plugin-chatbot. Assistant answers have no rating control.
  • The client mints turnId as the last user message's id (useObjectChat.ts:146-163, turnId: lastUser.id at :163).
  • A reloaded conversation carries no turn ids:
    • spec/src/contracts/ai-service.ts:760-770: AIConversation.messages is ModelMessage[].
    • The UI falls back to msg-idx ids (useObjectChat.ts:385, :748).
    • So an answer in history cannot name its turn.
  • The cloud store maps rows without ids (cloud packages/service-ai/src/conversation/objectql-conversation-service.ts:693 toMessage). That half belongs to cloud once the contract carries the field.

What done looks like

  1. Spec. A conversation's messages carry the turn_id the server stamped, as an optional field, so the contract stays backward-compatible.
  2. plugin-chatbot. A thumbs up/down control on each assistant answer, with an optional short note.
    • Before a thumbs-down is sent, it shows the consent line "A thumbs-down shares this question and your note with your organization's administrators" in four locales.
    • It shows the member's current rating and lets them change or remove it.
  3. SDK. Methods for the three member routes.
  4. Tests.
    • Rating a live answer and a reloaded one.
    • The consent line is shown before a thumbs-down.
    • No control on another member's shared conversation.

Then cloud maps turn_id in toMessage (one cloud follow-up). Reader: domain:ui (+ spec). Consumer: the cloud lane. Suggested grade: p3.

Blocked-by: #32642
Blocked-by: #32644

Activity

  1. added
    pm:queue
    repo:cloud
    domain:ui
    on Nov 9, 2026
  2. objectstack-fleet commented on Nov 9, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

    Path: none

    Triage: repo:cloud removed · domain:ui · p3 · 2026-11-09T08:56Z

    ⛔ Not a claim.


    Generated by Claude Code

  3. removed
    repo:cloud
    on Nov 9, 2026
  4. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:ui#1 · sunhaolin · session_017xRBcSf5S4Kkc7aL9t5DSd

    Retriage ask · domain:ui#1 · 2026-11-12T06:49Z · ⛔ not a claim

    What I ask triage: split item 1 (the spec field) and route a contract for the feedback door ahead of the console half.

    Reading (origin/main 3452dec21):

    • Item 1 is packages/spec work (AIConversation.messages carrying turn_id). That is the spec lane's, not this seat's.
    • No file under packages/spec/src, packages/client*/src or ui/packages names the …/turns/:turnId/feedback route. grep -rln "turns/.*feedback\|AnswerFeedback\|answer_feedback" returns zero hits.
    • The SDK methods in item 3 are packages/client, which is domain:server.
    • The plugin-chatbot half cannot render history ratings until item 1 lands, and cannot call the door without guessing its shape.

    Proposal: a spec card (item 1 + the feedback door contract), a server card (the SDK methods), and this card Blocked-by: both, keeping the plugin-chatbot items. pm:queue stays until triage answers. This seat does not dispatch it meanwhile.

  5. added
    pm:retriage
    on Nov 12, 2026
  6. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Retriage answer: split as proposed · domain:ui · p3 · pm:blocked · 2026-11-12T09:02Z

    ⛔ Not a claim.


    Generated by Claude Code

  7. added
    pm:blocked
    area:ai
    and removed
    pm:queue
    pm:retriage
    on Nov 12, 2026
  8. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    epic:#35205#1 · os-warren · session_01JQwxbYJqoPAoSpWTMpH1yq

    Partial-block check: the whole card waits · 2026-11-19

    Both halves (rating an answer, and the turn id on a reloaded conversation) call the client SDK methods #32644 adds (turn feedback and turn artifact). #32644 is back in pm:queue in this sweep.

    Blocked-by: #32644

    State unchanged (pm:blocked). Rule: only the part that waits stays blocked (#35259 item 8); here nothing can go first.

    Order: Warren, 2026-11-19 00:42Z 「ok」 to the partial-block review (execution sheet section I).


    Generated by Claude Code

  9. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · zhuangjianguo · session_01QsR2jRH2X4frz9bBiZHNk4

    Triage: unlocked · area:ai · domain:ui · Feature · p3 (an epic #35205 child, pre-authorised) · pm:blocked → pm:queue · size M. Rationale: the waiting part named on 11-19 is #32644 (client SDK methods for saved questions, turn artifact and turn feedback), closed completed; the SDK methods are on main (PR #38539, 3b900a8). The lane re-checks the premise on the merged ref before dispatch.

  10. added
    pm:queue
    and removed
    pm:blocked
    on Nov 29, 2026
  11. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · zhuangjianguo · session_01QsR2jTsdScTh3o2fSjbxSz

    2026-11-29T10:26Z · Unlock · pm:blocked → pm:queue: both line-leading Blocked-by: targets are closed (#32642 completed; #32644 completed by PR #38539, merged as 3b900a8). Premise re-read on origin/main: AIConversationMessage.turnId is in packages/spec/src/contracts/ai-service.ts and ai.answers.{get,set,delete}Feedback are in @objectstack/client; plugin-chatbot still has no rating control. Claimable by repo:objectstack#1 zone o1-ai.

  12. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · zhuangjianguo · session_01QsR2jTsdScTh3o2fSjbxSz

    Claim: PM loop round 2
    Session: session_01QsR2jTsdScTh3o2fSjbxSz
    Thread session: session_01QsR2jSymFaYDuyMR7bQJ1R
    Account: zhuangjianguo
    Branch: claude/project-thread-csf98c
    Worktree: objectstack-issue-31865
    Domain: domain:ui
    Seat: repo:objectstack#1
    Area: o1-ai
    File surface: ui/packages/plugin-chatbot/src/**, ui/packages/i18n/src/locales/*.ts (the new rating keys only), ui/packages/app-shell/src/hooks/useChatConversation.ts and ui/packages/app-shell/src/console/ai/aiChatHydration.ts (carry the server row's turnId onto reloaded messages only), ui/packages/app-shell/src/console/ai/ChatPane.tsx (switch the rating control on only), their existing tests ui/packages/app-shell/src/hooks/__tests__/useChatConversation.test.tsx, ui/packages/app-shell/src/hooks/useChatConversation.test.ts, ui/packages/app-shell/src/console/ai/__tests__/AiChatPage.hydration.test.ts, generated locale files a gate demands, and .changeset/31865-*.md (stop on breach; explain in the report). The app-shell rows were added on the dev's measured ask: plugin-chatbot has no history loader, the reload path drops turnId in toUIMessages.
    Container & model: M, mode:thread, model: default (dispatch-gates --tier ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx: no path-derived mandate), effort: high
    Clause-②: yes
    Metadata-protocol: none
    Responsibility: n/a — not a defect card
    Thread-read: 7254444512
    Premise: holds (SDK half landed in #38539; spec types turnId on AIConversationMessage)
    Serial constraints cleared: check-handover.mjs --inflight on every surface row: the two OVERLAP rows on ui/packages/plugin-chatbot/src are suffix readings of other packages' fragments (#38556 src/__tests__/ names service-knowledge's directory in prose; #38150 src/chrome, src/console/home/__tests__, src/layout/__tests__, src/views/setup are app-shell/console paths, and its PRs #38364 #38389 touch only the studio i18n namespace, not locales/); the app-shell and locales rows read clear; none

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

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · zhuangjianguo · session_01QsR2jSymFaYDuyMR7bQJ1R
    os-dev-report

    {
      "issue": 31865,
      "status": "done",
      "branch": "claude/project-thread-csf98c",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38572",
      "head": "d1ae115a",
      "session": "session_01QsR2jSymFaYDuyMR7bQJ1R",
      "premise_still_valid": true,
      "summary": "plugin-chatbot: ChatbotEnhanced with rateAnswers draws thumbs up/down on each finished assistant answer; a thumb opens a note form (max 500), a thumbs-down shows the card's consent line before anything is sent, the stored rating draws pressed and can be changed or removed (GET/POST/DELETE .../conversations/:id/turns/:turnId/feedback, spec ai-answer.zod.ts types, host apiFetch). Messages carry turnId via assignTurnIds: live answers take the triggering user message id (what withTurnId sends), restored ones the turnId their history carried, null otherwise. Measured: plugin-chatbot has no history loader; app-shell toUIMessages dropped the row turnId, so (claim widening + maintainer decision card option A) app-shell now carries it through toUIMessages and hydratedMessagesToChatMessages, and ChatPane switches rating on. No control on readOnly (shared) transcripts, without conversationId, while streaming, or without a turn; one control per turn.",
      "tests": "head d1ae115a. New: ChatbotEnhanced.answerRating-31865.test.tsx (16), useChatConversation.test.ts +1, AiChatPage.hydration.test.ts +1 -> 3 files 42 tests passed. Touched-package suites under the lock (vitest --maxWorkers=2 packages/plugin-chatbot/ packages/i18n/ packages/app-shell/src/hooks/ packages/app-shell/src/console/ai/ + product-neutral-renderer.ratchet.test.ts): Test Files 335 passed, Tests 3907 passed 13 skipped, VERDICT command-exit 0. type-check: plugin-chatbot and i18n (tsc + tsconfig.test.json) exit 0; app-shell after its closure build (72 tasks) exit 0. Ablations from the committed state: restored-turn map ignored + toUIMessages turnId dropped -> 4 tests red; consent line removed + readOnly gate removed -> 4 tests red; both restored (git restore, status clean).",
      "gates": "dispatch-gates --commands at d1ae115a: 42 derived; all 42 run locally, each exit 0 (ui scripts/ vitest first SIGKILLed while sharing the box with a closure build, re-run alone under the lock: 172 files 5159 tests passed, VERDICT 0). dispatch-gates --ran: 42 derived, 42 run, 0 NOT-MEASURED, 0 UNRUN. Body gates on the PR body via GITHUB_EVENT_PATH: check-changeset-no-major exit 0, check-adr-0087-registration exit 0, check-closing-keyword-parity exit 0, check-partof-closing-keyword exit 0. Type Check UI light gates run locally: check:spec-symbols, i18n-keys, i18n-drift, esm-specifiers, phantom-deps, unreferenced-sources, self-import, new-line-citations all exit 0. PR check-runs: not yet read (CI in progress at report time); the seat reads them.",
      "line_budget": "25 files, +1034 / -39 (1073 changed lines): plugin-chatbot src 528+38, tests 337, app-shell 48, i18n 11 packs x 13 = 143, changeset 17. Under the 3000 Tier-H size line; no governed path.",
      "files_changed": [
        ".changeset/31865-rate-chatbot-answers.md",
        "ui/packages/plugin-chatbot/src/chat/AnswerRating.tsx (new)",
        "ui/packages/plugin-chatbot/src/chat/answerFeedback.ts (new)",
        "ui/packages/plugin-chatbot/src/ChatbotEnhanced.tsx",
        "ui/packages/plugin-chatbot/src/chat/types.ts",
        "ui/packages/plugin-chatbot/src/chatMessageAdapter.ts",
        "ui/packages/plugin-chatbot/src/mapMessages.ts",
        "ui/packages/plugin-chatbot/src/useObjectChat.ts",
        "ui/packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.answerRating-31865.test.tsx (new)",
        "ui/packages/app-shell/src/hooks/useChatConversation.ts",
        "ui/packages/app-shell/src/hooks/useChatConversation.test.ts",
        "ui/packages/app-shell/src/console/ai/aiChatHydration.ts",
        "ui/packages/app-shell/src/console/ai/ChatPane.tsx",
        "ui/packages/app-shell/src/console/ai/__tests__/AiChatPage.hydration.test.ts",
        "ui/packages/i18n/src/locales/{en,de,es,fr,pt-BR,ru,ar,ja,ko,zh-Hans,zh-Hant}.ts"
      ],
      "deviations": [
        "Clause-② copied verbatim from the claim (yes, no arm); project reading for a new @object-ui/i18n key is yes (widening) - the seat may amend.",
        "Consent line and all rating keys are in all 10 packs plus generated zh-Hant, not four: all-locales-key-parity needs every pack.",
        "No @objectstack/client dependency: the routes are called by pure fetch typed from @objectstack/spec/api (usePendingActions precedent), so package.json and the lockfile stay untouched.",
        "App-shell widening: the first two edit attempts were refused by the container's auto-mode safety check (widening came from the seat session); edits were made only after the maintainer chose option A on the thread's decision card (Fable-reviewed per the project rule).",
        "ui/AGENTS.md #2 (package README + content/docs/frontend page) not done: outside the claim surface.",
        "Reviewer request on the PR skipped: the order forbids MCP writes and pr_create takes no reviewers; assignee zhuangjianguo set via pr_create (read back).",
        "Commit trailers are model-free (Co-Authored-By: Claude) per the repo pre-push hook, not the harness's model-named form."
      ],
      "dogfood_battery": "n/a - no ! in the PR title and no (narrowing) arm",
      "mcp_calls": "3 - mcp__github__issue_read x3 (card get, get_comments x2); no write tools",
      "api_writes": "2 relay writes - fleet-write pr_create (PR #38572, read back byte-identical, 5597 bytes) and this os-dev-report comment via post-stamped; plus git push x2 (not REST)",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none - noted, not filed: sanitizeChatMessagesForCache rebuilds cached messages without turnId, so a conversation restored from the local cache shows no rating control until it is read from the server again (outside the claim surface).",
        "carrier: cloud - cloud store toMessage must map turn_id for reloaded answers to carry a turn (named on the card)."
      ]
    }
  15. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · zhuangjianguo · session_01QsR2jTsdScTh3o2fSjbxSz

    2026-11-29T11:52Z · Landed: PR #38572 merged as 1332e2c; Fixes #31865 closed the card. pm:dispatched removed with this note. The cloud half (reloaded answers carry turn_id) is #38579 in the repo:cloud lane. #31889 (same package) is next in seat 1's serial queue.

  16. removed
    pm:dispatched
    on Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aidomain:uipriority:p3

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions