2.9 KiB
2.9 KiB
Task: Fix Code fresh-conversation voice input
Identity
- Task ID: 20260817-voice-input-fix-b4e62d91
- Mode: Feature
- Branch: codex/20260817-voice-input-fix-b4e62d91-voice-input-fix
- Worktree: D:\Datas\OthersProjects\makelore-voice-input-fix-b4e62d91
- Base commit:
9fd9a7761d - Owner: codex
- Status: Completed
Scope
- Enable AI Programming voice capture after the user selects an Agent but before the lazy first OpenCode session exists.
- Add a component-level regression that exercises the real fresh-contact state and verifies transcription populates the composer draft without creating an empty session.
- Preserve existing-session voice behavior and the current busy/transcribing guards.
Intent And Constraints
- Preserve lazy contact selection: choosing an unused Agent or starting voice capture must not create or start an OpenCode session; only message submission may create the first session.
- Keep speech capture and transcription on the existing Renderer -> Host API -> Electron Main -> Works Square path.
- Do not change Canvas, Learning, Agent templates, provider configuration, or unrelated composer behavior.
- Keep the implementation surgical and limited to the ChatPanel predicate and its focused unit coverage.
Outcome
- Updated the AI Programming composer voice-availability predicate so a selected Agent is sufficient before the lazy first session exists.
- Kept the existing loading, transcription, recording, and session-busy guards unchanged.
- Added a component regression covering a fresh Agent conversation: voice capture transcribes into the draft while the selected session remains lazy and no session-creation request is sent.
Verification
- Regression-first evidence: the new fresh-Agent test failed before the predicate change because the voice button was disabled, then passed after the one-line fix.
pnpm exec eslint src/pages/Chat/OpencodeChatPanel.tsx tests/unit/opencode-chat-panel.test.tsxpassed.- Five focused lazy-session and voice-input tests passed (
5 passed,80 skipped). - The complete
opencode-chat-panel.test.tsxfile passed (85/85) during implementation. pnpm testpassed (175files,2048tests).pnpm run typecheckpassed.pnpm run build:vitepassed for Renderer, Electron Main, and Preload (3921,133, and1modules transformed respectively); only pre-existing chunk-size and mixed static/dynamic import warnings were reported.- Final read-only Sol review:
PASS, with no blocking findings across spec and standards checks. - Electron microphone E2E was not added because the shared fixture does not provide a deterministic
MediaRecorder/microphone seam; the component regression exercises Agent selection, recording start/stop, transcription, and lazy-session behavior directly.
Follow-ups
- None.
Promotion Candidates
- None. The change restores the documented lazy-session behavior and does not alter an architectural or product contract.