fix(teacher): 隔离子智能体流式消息与老师正文
This commit is contained in:
@@ -8,11 +8,12 @@
|
||||
- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260923-yuxi-teachers-client-53ba33e2
|
||||
- Base commit: 1f2ad3fb3a71b8b35fabb5b319cd3b54b4c2ebbe
|
||||
- Owner: codex
|
||||
- Status: Planning
|
||||
- Status: Ready for Integration
|
||||
|
||||
## Scope
|
||||
|
||||
- Implement the accepted Yuxi coding-teacher design across Yuxi runtime, Works Square distribution and MakeLore Main/local context. This record owns the ml repository changes only. User explicitly confirmed student-account billing on 2026-09-23.
|
||||
- User-authorized follow-up on 2026-09-23 fixes the confirmed client SSE routing omission: child-agent text must not become the main teacher answer. This follow-up changes only MakeLore Main, its regression test and documentation.
|
||||
|
||||
## Intent And Constraints
|
||||
|
||||
@@ -26,19 +27,19 @@
|
||||
- Implemented teacher selection for new topics, Main-owned scoped Yuxi sessions/SSE, local project/Pi snapshot binding, complete structured read results and native cloud continuation. Reconnect follows persisted continuation and cursor; original question ID supports cancellation even if submission acknowledgment is lost.
|
||||
- Main enforces existing project read boundaries; frozen public Pi messages and current teacher topic texts can be read by ID. Legacy teacher histories retain their original path. Disabled teacher topics remain readable without borrowing another teacher's availability. Cloud topic headers reflect the selected teacher, including implicit topic creation on first send.
|
||||
- Updated README with runtime, configuration/version, local read, cancellation and billing behavior. Implementation and local evidence complete. The user-authorized fresh read-only reviewer independently reviewed all three repositories and returned PASS with no reproducible defects. Prepared for integration; no merge, push, deployment, installer release or paid-model calls.
|
||||
- Follow-up review on 2026-09-23 reopened integration readiness: cloud-runner appends every message_delta without routing by the envelope's cloud thread_id. A supported Yuxi teacher using subagents can therefore mix child-agent text into the teacher response, saved history and brought-back draft. The previous review/test set did not exercise this case. No implementation changes were made during this review.
|
||||
- Resolved the follow-up review finding on 2026-09-23: cloud-runner now routes message text using the authoritative cloud main thread_id from the Run view, which differs from the local topic ID. Child-thread events no longer enter the teacher response, saved history or brought-back draft, or reset main-answer accumulation. Every observed event still advances the reconnect cursor. This bounded client fix received direct diff review; the earlier independent reviewer PASS applies to the initial implementation only.
|
||||
|
||||
## Verification
|
||||
|
||||
- Typecheck passed. All 50 relevant tests across coding-teacher, model, read-tools, UI and cloud runner passed. Cloud runner tests use real temporary project files and captured public messages, asserting all result IDs/content, stale-context rejection, saved continuation, lost acknowledgment cancellation and SSE replay/partial final-answer repair. Service integration also validates native Yuxi topics with no local prompt use cloud credentials, local reads and saved cloud request/response rather than the local model loop.
|
||||
- Typecheck passed. All 51 relevant tests across coding-teacher, model, read-tools, UI and cloud runner passed after the routing fix (50 at initial implementation). Cloud runner tests use real temporary project files and captured public messages, asserting all result IDs/content, stale-context rejection, saved continuation, lost acknowledgment cancellation and SSE replay/partial final-answer repair. Service integration also validates native Yuxi topics with no local prompt use cloud credentials, local reads and saved cloud request/response rather than the local model loop.
|
||||
- Electron E2E project teacher side chat passed against actual built window with explicit Host API fixtures, including choosing a non-default teacher and bringing its response back to the main draft without submitting. Production Renderer/Main/Preload build passed. Focused ESLint and git diff whitespace checks passed.
|
||||
- Yuxi real HTTP/PG/worker integration separately verifies cloud interruption/continuation; WS verifies student wallet. No real paid provider or deployed three-service topology call.
|
||||
- A task-local regression probe under ignored node_modules/.cache/teacher-review supplies the real SSE envelope shape emitted by Yuxi ChunkedEventWriter: a child-thread message followed by a parent-thread reply. Command: pnpm exec vitest run --config node_modules/.cache/teacher-review/vitest.config.mjs -t 'keeps child-agent text'. Result: 1 failed / 5 not selected. Expected teacher-only text; actual output contains child text followed by teacher text. This is a confirmed routing defect, not a provider or timing failure.
|
||||
- Added a tracked regression with interleaved main/child text, both payload.items and payload.chunk, cloud/local thread-ID distinction and disconnection after a child event. It failed before the fix with child text plus a duplicated final answer, then passed with teacher-only text and after_seq=2-0 on reconnect. Cursor assertions run outside the transport callback so transport retry handling cannot swallow assertion failures. All six cloud tests passed again after that assertion refinement.
|
||||
- The original task-local probe under ignored node_modules/.cache/teacher-review now passes: pnpm exec vitest run --config node_modules/.cache/teacher-review/vitest.config.mjs -t 'keeps child-agent text' (1 passed / 5 not selected; previously 1 failed). Focused ESLint, typecheck and production Renderer/Main/Preload build passed for this follow-up. Existing Electron E2E was not rerun: its Host API topic fixture bypasses the changed cloud transport; the tracked transport regression exercises the actual routing defect.
|
||||
|
||||
## Follow-ups
|
||||
|
||||
- Integrate the three paired task branches together when requested. Deployment, real provider billing, remote MCP and production three-service/one-api topology validation remain a separate release step. Retain task worktrees and branches for that handoff.
|
||||
- Before integration, use the authoritative cloud thread ID to keep child stream messages out of the main teacher response, and add the reproduced case to the tracked cloud-runner regression suite. Keep cursor advancement for all observed stream events so reconnection does not replay ignored child events.
|
||||
|
||||
## Promotion Candidates
|
||||
|
||||
|
||||
Reference in New Issue
Block a user