docs(teacher): clarify teacher and friend configuration sources

This commit is contained in:
2026-09-24 11:18:53 +08:00
parent de72b1cd94
commit 248776d855

View File

@@ -27,6 +27,9 @@
- Fixed configuration/current-discussion overflow is distinguished from oversized questions/references. Teacher behavior, current question, explicit references and discussion instructions remain complete. Updated README explains the approximate native versus exact transport boundary.
- No Renderer workflow changed. Before: a short first question could be rejected with advice to shorten it or start a topic. After: the same 8000-budget legacy shape and cloud long-code case submit successfully; truly oversized fixed inputs identify configuration as the cause.
- Follow-up source audit: teacher availability/default, catalog and published versions are fetched from Works Square (`/api/coding-teacher/config`, `/teachers`, `/versions/{version}`). Main stores each topic's definition/version; the Renderer restores that snapshot for existing topics. Teacher prompts also include client teaching behavior and discussion instructions, so behavioral content is not wholly cloud-owned.
- Friend is not an independently distributed server/Yuxi agent: `consultationDefinition(..., 'friend')` inherits the published teacher definition's model, limits, runtime and version while replacing its name/persona/welcome/questions and clearing text Skills locally. Friend cloud calls retain the same teacher version and expose no project read tools. Runtime=yuxi uses the Yuxi teacher transport; legacy snapshots use Main's student-model gateway runner. No product behavior or live configuration changed during this audit.
- Reproduced two reachable failures before changing product code: legacy model preparation plus empty-source first discussion needs 9013 byte-based estimated units but allows only 4456 after tool reserves (synthetic 2700-byte prompt matching observed shape); cloud compilation accepts long ordinary quoted code then JSON serialization exceeds its byte budget.
## Verification
@@ -35,6 +38,8 @@
- pnpm 10.33.4 frozen offline install, standard pnpm run typecheck and scoped ESLint passed. Production Vite build passed for Renderer/Main/Preload/utility. Expanded Main tsc reports 66 diagnostics; a CompilerHost replay substituting exact base versions of all changed Electron files also reports the same 66, with zero new diagnostics. No full-suite or real-model success is claimed.
- Existing Electron UI fixtures replace the Host API and bypass this budget seam; this Main-only change is covered at real service/runner boundaries instead of treating a mocked UI pass as reproduction evidence. No installed application, live Yuxi instance or user topic was modified.
- Follow-up verification: resumed official ownership, checked all 108 peer registry timestamps against the prior scope audit (unchanged), and traced config-client, consultation-role, service creation/send, Renderer restore, cloud-runner and context assembly. This was a source-only clarification; no new runtime tests or paid calls were needed. Previous fix remains unmerged/unpackaged.
- Red loops: pnpm exec vitest run tests/unit/coding-teacher-model.test.ts -t 'existing 8000 budget' --maxWorkers=1; pnpm exec vitest run tests/unit/coding-teacher-cloud.test.ts -t 'long code context' --maxWorkers=1. Both fail with the exact screenshot message at their respective real preflight seam. Empty-source cloud question with the discussion protocol passes.
- Native model limits are tokens; existing implementation equates them to UTF-8 bytes, unlike model tokenization. DeepSeek documentation distinguishes character estimates and actual usage (https://api-docs.deepseek.com/zh-cn/quick_start/token_usage/). Keep native token estimates explicitly approximate and model/usage authoritative; retain the separate exact cloud query byte guard.