feat(teacher): stream Yuxi reasoning and answer previews
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
# Task: Stream Yuxi teacher reasoning and answers in Makelore
|
||||
|
||||
## Identity
|
||||
|
||||
- Task ID: 20260929-teacher-stream-f00acb6f
|
||||
- Mode: Feature
|
||||
- Branch: codex/20260929-teacher-stream-f00acb6f-teacher-stream
|
||||
- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260929-teacher-stream-f00acb6f
|
||||
- Base commit: f443f3bc668dfc6c9df111506d739d343ee82bba
|
||||
- Owner: codex
|
||||
- Status: Ready for Integration
|
||||
|
||||
## Scope
|
||||
|
||||
- Stream Yuxi main-thread reasoning and answer previews through Main and the teacher panel, preserving final reply validation, project isolation and tool continuation.
|
||||
|
||||
## Intent And Constraints
|
||||
|
||||
- Concurrent/Planning Gates Passed: official scripts established the exact feature identity above. Loaded entry, task, positioning, integrated state, teacher ADR, architecture/domain/success and relevant indexes; peer task records were read only. Historical placeholder scopes remain unknown; adjacent completed teacher/observer/packaging work has no conflicting dependency. No subagents.
|
||||
- User explicitly requests both reasoning and results streamed. This revises the old exclusion of reasoning from visible teacher chat, while keeping it separate from answers, tools and future model context. Main remains transport owner; no provider configuration or server mutation.
|
||||
- Plan: verify the committed Yuxi event contract; add incremental prose projection and separate reasoning stream; cover continuation, final reconciliation, cancellation, persistence and visible streaming; run focused tests, typecheck, lint/build and available Electron UI fixture.
|
||||
|
||||
## Outcome
|
||||
|
||||
- Implemented separate main-thread reasoning deltas and replaceable answer previews through the existing Main-owned stream. Yuxi committed chat_service/agent_run_service confirm message_delta reasoning_content (and retained additional_reasoning_content) is already transported; no Yuxi or WS changes were needed.
|
||||
- Partial reply JSON is decoded into prose without requiring its closing string/object or exposing quick-reply fields. Final output remains authoritative, and a new message/tool continuation resets the preview while retaining question reasoning. Terminal event draining retains reasoning from fast completed/interrupted Runs. Child events only advance the cursor.
|
||||
- The panel expands real reasoning while running, streams answer Markdown independently, folds reasoning when finished and exposes quick replies only after completion. Cancellation/failure preserves received previews and original bytes; saved reasoning is separate from follow-up model context and bring-back answer text. Old suggestion records without the current presentation marker keep their existing raw-output hiding behavior.
|
||||
- README updated; no shared canonical project-memory writes. Implementation is isolated from the primary checkout and other tasks; no merge, push, deployment, package or installation.
|
||||
|
||||
## Verification
|
||||
|
||||
- 322 distinct relevant unit cases passed across eight files, in focused batches: cloud runner, service, reply parser/streaming/history, conversation store and both panel suites. Coverage includes incomplete escapes/fences, live preview, terminal reconciliation, main-thread filtering, cursor continuation, tool-read reasoning, cancellation, disk reload, context exclusion and historical raw-JSON hiding.
|
||||
- pnpm run typecheck passed; scoped ESLint passed; final pnpm run build:vite passed (Renderer/Main/Preload/utility).
|
||||
- New Electron fixture test `teacher reasoning and answer stream separately before the final response` passed. Inspected teacher-streaming.png: separate visible reasoning/prose while stop remains available, then collapse/reopen and quick replies. This uses deterministic Host API/SSE fixtures, not a production provider.
|
||||
- Extended Main typecheck reports 66 diagnostics, matching the documented existing count; none mention the modified teacher files. Standard project typecheck passes. No full unit suite or live paid-provider/installed-client acceptance was claimed.
|
||||
- git diff --check passed; final task-aware documentation drift gate run before handoff.
|
||||
|
||||
## Follow-ups
|
||||
|
||||
- Integrate this branch and ship an updated Makelore client to affect installed users. Verify production Yuxi/model actually emits reasoning when enabled; models without reasoning events still stream their answer normally. This task did not alter cloud model/reasoning configuration.
|
||||
|
||||
## Promotion Candidates
|
||||
|
||||
- Targets: coding-teacher ADR, architecture/domain and integrated state. Proposal: explicitly document independent live main-thread reasoning and replaceable answer previews, with final answer reconciliation and final-only quick replies; keep reasoning out of tools, follow-up context and bring-back text. Evidence: committed Yuxi producer contract, the focused unit cases, Electron fixture and production compile above. Future impact: streaming/progress, cancellation and history consumers preserve these separate fields. Conflict: intentionally supersedes the earlier exclusion of visible reasoning, as directly authorized by this user request; no additional product-direction confirmation is needed. Promote only under Integration Gate.
|
||||
Reference in New Issue
Block a user