mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
6d49ecbb7b
Three follow-ups on top of PR #4837 that I had on the same branch but didn't make it into the squash merge. 1. **packages/runtime: stamp `audio/webm` on empty-type Blobs in the transcription handler.** Browser MediaRecorder writes the audio as webm/opus, but the Blob's `type` field is often empty by the time it hits the server. `isValidAudioType` lets empty / octet-stream through for compatibility, but OpenAI Whisper then rejects the upload with `502 Invalid file format. Supported formats: ['flac', 'm4a', 'mp3', 'mp4', 'mpeg', 'mpga', 'oga', 'ogg', 'wav', 'webm']` because it can't pick a decoder. Reconstructing the File with an explicit `audio/webm` type (and a `.webm` filename fallback) makes Whisper accept the bytes that were already valid. Monorepo-wide — applies to every integration using `/api/copilotkit-voice/transcribe`. 2. **showcase/aimock/feature-parity.json: port 12 subagents fixtures from d5-all.json** so the three pills (cold-exposure blog, LLM tool-calling explanation, reusable-rockets summary) work in production. d5-all.json already has the full research → writing → critique chain with substantive content; feature-parity only had the single LP remote-work pill. Production aimock loads both files but any case where feature-parity wins first-match needs the same content. Verbatim port — no fabricated text. Net result: no more `[sub-agent error] the writing agent...` on the demo's pills. 3. **showcase/aimock both files: scope shared-state-read-write Greet + Plan-a-weekend fixtures with a true all-defaults systemMessage gate.** The PR #4837 gate (`systemMessage: "tone: casual"`) only caught tone changes — name / language / interests changes still hit the canned fixture. Replaced with a two-element array gate (aimock supports all-present substring matching, verified in `/app/dist/router.js`): - `preferences:\n- Preferred tone: casual\n` — breaks if name is set (Name line inserts between signature and tone) or tone changes. - `- Preferred language: English\nTailor every response` — breaks if language changes or interests are added (Interests line inserts between language and Tailor). With `--provider-gemini` already wired in both local docker-compose and Railway prod, any state change now proxies to real Gemini and returns a personalised reply. 4. **showcase/aimock/feature-parity.json: re-remove bare 'plan' / 'steps' / 'mars' / 'dashboard' / 'report' substring catch-alls + the bare 'alice' / 'Alice' fixtures.** These were removed in commit `ddc2e179` on the PR #4837 branch but didn't survive the squash merge, so they're back in main and still hijacking hitl-in-app downgrade-#12346 ('plan'), shared-state-rw weekend pill ('plan'), subagents 'rockets' pills, hitl-in-chat Schedule-1:1 with Alice ('alice'). Replace the alice pair with a single scoped `Hi, my name is Alice` fixture for the showcase-assistant introduction flow. Local verification: - `bin/showcase test google-adk --d5` → 38/38 green, 165s. - Paired curl on shared-state-read-write: - Default state → canned fixture ("Hi — I'm your shared-state co-pilot…") - `name=alem` → real Gemini ("Hi there! …") - `interests=[Cooking, Travel]` weekend pill → real Gemini ("Hey there! Since you're into cooking and travel, how about a weekend plan that combines both?") Production deploys this PR will pick up the aimock fixture changes (prod loads feature-parity.json from GitHub raw at boot — no image rebuild needed for that file) plus the runtime change once the packages/runtime build is republished.