Add teacher microphone and per-question model selection

This commit is contained in:
鲨鱼辣椒
2026-09-29 19:43:45 +08:00
parent cd1ba41e21
commit 78cfde6734
20 changed files with 517 additions and 37 deletions

View File

@@ -0,0 +1,56 @@
# Task: Add teacher voice input and model selection
## Identity
- Task ID: 20260929-teacher-composer-4f829ac1
- Mode: Feature
- Branch: codex/20260929-teacher-composer-4f829ac1-teacher-composer
- Worktree: /Users/chillishark/Makelore 麦洛/.codex-worktrees/makelore/20260929-teacher-composer-4f829ac1
- Base commit: cd1ba41e214ebe4a1f698be0dde14591bb7b87df
- Owner: codex
- Status: Ready for Integration
## Scope
- Add microphone transcription and model selection to every teacher composer using operation-composer patterns. Explicit selection uses the chosen model's default thinking settings; no new reasoning override protocol.
## Intent And Constraints
- Preserve account/teacher history, drafts, timestamps, per-turn published configuration and student billing; no subagents, paid test prompts, cloud publishing, main merge/push or desktop activation.
## Outcome
- Shared operation/teacher microphone button and voice hook; transcripts append to the latest draft and never auto-send. Scope/account changes and unmount cancel late results. Toolbar wraps at narrow widths.
- Main exposes a credential-free catalog intersecting cloud capability and account text models; each send revalidates the choice. Per-account/teacher selection is remembered, and requests freeze modelId with existing retry identity. Default follows the published teacher; persona, resources, history, versions and billing remain intact. Automatic check-ins keep their cloud configuration.
- Paired Yuxi commit 489549c and WS commit 0509e0ba implement optional model_id, immutable run snapshots, idempotency and signed teacher_model_id billing. They are not merged, pushed or deployed. Old cloud/gateway capability is explicit and never silently ignores a choice.
- Trial updated in the background, PID 32583, preserving its existing empty-work overlay 0167d36 in a separate build artifact. Peer worktrees remain unchanged. Live API reports selection unsupported until cloud rollout; microphone and selector UI are present. No real recording, paid prompt, cloud configuration publishing or desktop activation performed.
## Verification
- Typecheck, full lint (0 errors / 8 existing warnings), production Vite/Main build passed. Full suite: 267 files / 2694 tests passed / 3 skipped, followed by 1 pressure test passed. After the final toolbar wrap adjustment and one extra model-catalog filter test: 83 focused tests and both 319px/508px browser layout cases passed. No new full-suite failures remain.
- Trial artifact including the already-running empty-work overlay: typecheck/build and 65 preview regressions passed. Same account, selected teacher, route, 14 operation messages, teacher history and 14 draft entries verified; no desktop focus acquisition during monitored restart. Browser screenshots and live composer screenshot inspected.
- Server verification: Yuxi 26 relevant unit/HTTP/SDK tests, engineering gate and 62 validator tests; WS 79 relevant tests passed / 1 PostgreSQL-environment case skipped. Complete PostgreSQL/Redis/worker integration and paid provider calls are not run. No independent subagent review, per user instruction.
## Follow-ups
- Cloud rollout needs separate authorization beyond the temporary app: WS API first, then Yuxi API/worker. Complete service-environment integration before production release. No teacher republish or history migration is needed. Keep the running trial source and profile.
## Promotion Candidates
- Target: teacher/model capability ADR and architecture. Proposal: explicit per-question teacher model with cloud capability gating, unchanged persona/resources/version/payer; voice is draft-only. Evidence: service/UI/billing tests above. Future impact: three-part rollout and immutable retry choice. Earlier cloud-only model ownership is extended by this user's explicit selection request; canonical promotion belongs to integration.
## Project Context Loaded
- Task 20260929-teacher-composer-4f829ac1, feature, owns this worktree and branch per Identity at base cd1ba41. App worktree creation returned Not a git repository for the parent chat directory; official task_context isolated from the verified previous trial source. Start/status passed.
- Read entry/memory index, active task, positioning, current integrated snapshot, decision index and teacher/model-capability ADRs, system overview/module map/data flow, domain/success criteria and evidence/reflection/commitment indexes. Read every peer scope/constraints/promotion record through status registry. Current source includes newer approved timestamp/bubble/community changes than the integrated snapshot.
- Teacher capability/persona is cloud-owned, with per-account/teacher local history, student-paid runs and per-question version/project/read-only context. The user now explicitly wants client model selection, extending the earlier cloud-only model choice while preserving cloud persona/resources and billing. Main remains the validation and credential boundary.
- Peers: earlier trial/community work retained for running app; teacher-help-label and formal application release work remain separate; empty-work-preview and operation language work are not in this baseline. No identified semantic conflict; retain all current labels/UI and leave peer checkouts unchanged.
- Unknown dependency: current cloud /questions client has no model override field; inspect the committed Yuxi contract before deciding server support. No cosmetic model dropdown that silently keeps another model.
- Gate: Passed for client work and dependency investigation.
## Plan
1. Reuse the operation voice hook/button and input safeguards, scoped to account/teacher/context; keep transcription as an editable draft.
2. Trace cloud model capability/override support and implement an authoritative model selection contract, preserving request identity, version binding, student billing and history; selected models use their defaults.
3. Verify account/teacher switches, requests/retries, unavailable models and responsive composer layout; run required checks and update the trial in the background when the working integration is ready.