Repository navigation
Conversation
Templates define placeholders, serial rounds with parallel steps, per-step prompts and a summary node. The web model picker exposes them as discussion:<id> models; the backend orchestrates the calls and stores the transcript on the assistant message.
Adds a dependency-free MCP Streamable HTTP server wrapping DeepSeek's Search and Fetch APIs, plus an opt-in compose profile and deployment notes.
Restores placeholder model bindings from the latest discussion message and a per-conversation local draft. Discussion runs now acquire the generation lifecycle, register their run and publish events, so leaving the page no longer aborts the round loop and the existing run resume stream can replay the final result.
Adds the discussion send request and message discussion field to the generated Swagger and TypeScript contracts.
Moves the width/alignment trigger out of the conversation-only header into a labelled control above the composer, so it is visible on the new-chat landing page as well.
Keeps request calls out of components as required by the web architecture check and removes the unguarded status type assertion.
Domain structs stay protocol-free; transport and persistence payloads now carry the JSON field names.
|
Updated with three follow-up commits:
|
The backend already emitted discussion_start, discussion_turn_delta, discussion_turn_done, discussion_round_done, discussion_summary_delta and discussion_done, but the web client treated unknown event types as "unrecognized" and dropped them, so a discussion only appeared after the whole run had finished. Stream contract - shared/api/conversation.ts: the six discussion types join STREAM_MESSAGE_EVENT_TYPES and route to one onDiscussionEvent callback. The error fallthrough now narrows to the error variant instead of reading error fields off the whole union. - shared/api/conversation-types.ts: typed variants plus DiscussionStreamEvent. - features/chat/model/discussion-stream.ts (new): applyDiscussionEvent folds an event into the live state. Turns are keyed by (round, stepId): a delta creates or appends, turn_done replaces, round_done replaces that round's turns, done swaps in the server state. A replayed discussion_start keeps the turns collected so far. Live state - PendingExchange gains assistantDiscussion; use-chat-run-stream feeds it from onDiscussionEvent and streams summary deltas into assistantText. - use-chat-branch-state maps it onto ChatAreaMessage.discussion and keeps it while merging pending state; settleCompletedExchange adopts the persisted discussion. - use-chat-data applies the same events on the resume stream, so switching away and back keeps the round progress. Rendering - message-discussion.tsx: one utterance per round, with a chip per model ordered 模型 1 … 模型 n by placeholder order; the selected model's Markdown streams through StreamdownRender. Usage cells select the round and model and scroll to it; the detail row keeps a single 全部 chip that resets the selection. - message-bot.tsx: a running discussion no longer renders the empty-body skeleton. Backend - discussion_start now carries the template placeholders, so the client can label 模型 N without the template. - the final delta is emitted with replace: true, because the summary already streamed as discussion_summary_delta. An N-round template now speaks N+1 times without waiting for user input.
…-all switch Workflow preview - The preview was a 320px floating card over the editor. It is now a full-height rail flush with the right edge (23rem at xl, 27rem at 2xl, 24px padding) with a border-left instead of a floating card, so a wide screen gives the workflow real room without squeezing the form. Narrow screens still open it below the editor. Select-all models - Each round's 参与模型 list starts with a 全部 switch. Turning it on joins every discussion placeholder, greys the individual chips, and remembers the selection it replaced; turning it off restores that selection, or keeps one model when there was nothing to restore. - Adding a discussion model still appends it to every round, so 全部 stays satisfied. - Reordering rounds clears the remembered selections, which are keyed by position. i18n: admin-discussions gains allModels (zh-CN / en-US).
The summary model is the last node of the workflow, so it no longer shares a grid cell with the discussion models: it gets a full-width row above them, keeping its 总结 badge and primary tint. Discussion models fill the row with flex-wrap and a 13rem minimum, so they sit side by side until they run out of room instead of being pinned to two columns. Selects keep an aria-label because their container is no longer a <label>.
docs/DISCUSSIONS.md describes the feature end to end: the template shape (placeholders, serial rounds with parallel steps, the summary node), the transcript the backend builds, the NDJSON events and how the client folds them into the transcript, the panel and admin editor rules, and the known limits. Its last section records what this round changed: streamed round utterances, the docked workflow rail, the select-all model switch and the summary row in the composer, with the files each change touched. README and README.zh-CN link the new document next to the architecture guide.
|
Added The three feature commits were reworded to carry their design notes in the message body; the trees are unchanged ( |
…vent payloads Prompt capture (debug) - domain Turn gains Prompt, State gains SummaryPrompt. - generateDiscussion now returns the messages it actually sent (after buildTextTaskGenerateInput normalises system messages for the adapter), and both the round turns and the summary turn keep it. Follow-up context - discussionPriorContext walks ListMessageAncestors from the new user message and takes the nearest non-empty assistant message (truncated to 8000 runes). - discussionTurnUserContent / discussionSummaryUserContent assemble "上次讨论的结果 + 用户本次问题 + 上一轮及更早的讨论记录", so a follow-up in the same conversation continues from the previous discussion's conclusion instead of starting from the bare question. Event payload shape - discussion_start, discussion_turn_done, discussion_round_done and discussion_done used to marshal the Go domain structs directly, which emits Round / StepID style keys the web client cannot read; the live panel only looked right after the final persisted state arrived. They now go through the discussion*Payload helpers, so every event matches discussion_json. - service_discussion_payload.go is reorganised around those helpers and adds turn.prompt / state.summaryPrompt.
…is set up The binding effect returned early whenever the conversation/template scope was unchanged, so the seed was only read on the first run of that scope. Messages load after that first run, which meant the composer fell back to the template defaults and showed models the last discussion never used. The same-scope branch now reapplies the last discussion's bindings when they arrive or change, until the user picks a model themselves; the seeded values are written back to localStorage so a reload keeps them.
…layable The generation stream retains a bounded event window, so a resumed run can lose discussion_start. applyDiscussionEvent dropped every turn event while there was no state, which left the panel empty until discussion_done arrived and the whole discussion appeared at once. Turn events now create a minimal running state on their own, and the panel derives its rounds from the turns when no plan is available, so progress keeps streaming on a resumed run.
§7 documents the binding precedence (last run > stored > template default) and that the seed is applied whenever it arrives; §8 no longer lists the lost discussion_start as a limitation; §11 is the v0.4.6-fork.14 change log with the cause of each symptom.
|
Two fixes for issues reported on the deployed build:
The reducer was replayed in Node for both an ordered run and a deltas-only resumed run; |
A follow-up used to send only the previous assistant answer plus the new question, which dropped the previous user message and looked nothing like a normal chat turn. Discussion rounds and the summary now share the branch's history as real user/assistant messages: - discussionHistoryMessages walks ListMessageAncestors from the new user message, keeps user/assistant roles, and drops empty or non-history entries. Earlier discussions appear as their final answer only; per-model utterances stay in discussion_json. - Each turn is system prompt + history + the current question (with the in-run transcript from round 2 on), so the previous question's constraints survive. - generateDiscussion runs fitGenerateInputToModelBudget with the route's upstream model and capabilities, so history is trimmed per model exactly like a normal chat turn; the ancestor depth follows ContextMaxTurns. The debug view now shows that history too, since it renders the messages actually sent.
§3 now documents the history chain, the per-model token budget, and that only each discussion's final answer enters history; §8 updates the limits; §12 logs the v0.4.6-fork.15 change.
|
Discussion turns now carry the branch's real conversation history instead of a flattened "previous answer" block:
The debug mode shows that history too, since it renders the messages actually sent. |
修复多轮讨论实时状态与轮次自动收起
多轮讨论生成期间提前展示实际 Prompt
多轮讨论 Prompt 支持按消息两层折叠
多轮讨论支持每轮并行或串行执行
手动功能 CI 不再强制执行依赖审计
- keep parallelPrompt and serialPrompt per round - restore the target mode's prompt when switching, filling its default if untouched - add a reset-to-default action to the round prompt editor - add serial default prompts for the first and later rounds in the editor and backend
多轮讨论按执行方式隔离 Prompt
feat: pin discussion configuration per conversation
fix: unwrap discussion snapshot responses once
fix: include config in discussion snapshot templates
feat: sync discussion defaults with manual overrides
fix: standardize discussion model card sizing
Summary
This PR adds three related capabilities on top of
dev:Chat layout: full width and left alignment
fullwidth option (100% of the available area) alongside compact/standard/wide.center/leftalignment setting, applied to the message list, emptystate, skeleton and composer.
chat.content_width/chat.content_align; code blocks, tables,Mermaid and PDF/image previews keep their own local scroll areas.
Admin-defined multi-model discussion templates
chat_discussion_templatestable and/api/v1/admin/discussion-templatesCRUD API.summary node. Participants can be fixed models or placeholders bound at chat time.
discussion:<publicID>models. Selectingone shows a binding bar for every placeholder; the message records the full transcript in
chat_messages.discussion_jsonand a collapsible discussion panel renders it.from the transcript, then asks the summary model for the final answer. Events are streamed
over NDJSON.
Bundled DeepSeek Search MCP service
deploy/services/deepseek-search/contains a dependency-free MCP Streamable HTTP serverwrapping
POST /v1/tools/searchandPOST /v1/tools/fetch.deepseek-searchprofile.(750000 nanousd, matching DeepSeek's $0.75 / 1,000 successful requests).
Commits
feat(chat): add full-width and left-aligned chat layoutfeat(discussion): add admin-defined multi-model discussion templatesfeat(tools): bundle DeepSeek Search MCP servicefeat(chat): add in-chat width and alignment controlfix(discussion): remember bindings and continue in backgroundTest plan
go build ./...go test ./internal/domain/discussion/ ./internal/application/conversation/ -run 'TestDiscussion|TestParseConfig|TestResolveRuntime|TestValidateConfig'pnpm --filter @deeix/web typecheckpnpm --filter @deeix/web lintpnpm --filter @deeix/web buildinitializeandtools/listagainst the bundled server./healthzand
/readyzreturn 200, andchat_discussion_templates/chat_messages.discussion_jsonexist after migration.
Known limitations
session (
Billable=false). A follow-up should aggregate the per-turn usage into the messagebilling/usage ledger.
yet (the admin editor can add/remove rounds and steps).
completed state; wiring pending-exchange updates is a follow-up.