Skip to content

fix: pre-existing sweep — 15 fixes across router, realtime, recorder, fal-audio, gemini-interactions, and drift infra#230

Open
jpr5 wants to merge 7 commits into
mainfrom
fix/pre-existing-sweep
Open

fix: pre-existing sweep — 15 fixes across router, realtime, recorder, fal-audio, gemini-interactions, and drift infra#230
jpr5 wants to merge 7 commits into
mainfrom
fix/pre-existing-sweep

Conversation

@jpr5
Copy link
Copy Markdown
Contributor

@jpr5 jpr5 commented May 19, 2026

Summary

Fixes 15 pre-existing issues identified during CR of PRs #226 and #229. Grouped by area:

Router — systemMessage array exact-match logic bug (unsatisfiable for 2+ needles), missing elevenlabs-tts/translation in endpoint compatibility filter

WS-Realtime — incomplete session.update rollback (only restored model/type, now captures full snapshot), missing Beta flat fields for noise reduction and transcription

Recorder — Content-Type empty-string fallback (changed ?? to ||), derived EndpointType from FixtureMatch instead of duplicate union

Gemini Interactions — missing webSearches warning on tool-call-only branch, interactionsUsage now honors Gemini-native field names (promptTokenCount/candidatesTokenCount/totalTokenCount)

fal-audio + ElevenLabs — 6 journal entries now use flattenHeaders(req.headers) instead of {}, handleSyncRun accepts RawJSONResponse fixtures

Small fixes — buildEmbeddingResponse accepts optional usage, geminiTurnsToMessages warns on unrecognized roles, types.ts header LLMock→aimock, extractFormField escapes regex metacharacters, parseTypedSSE null guards

Test plan

  • 3151 tests pass (90 files)
  • TypeScript clean
  • Prettier clean
  • ESLint clean

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 19, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@copilotkit/aimock@230

commit: f770b80

@jpr5 jpr5 force-pushed the fix/pre-existing-sweep branch 3 times, most recently from 97fb02c to cad6cae Compare May 19, 2026 13:26
jpr5 added 7 commits May 19, 2026 06:34
Collapse dead if/else branch in array systemMessage matching (both
paths were identical after the exact-match fix). Add elevenlabs-tts
and translation to the bidirectional endpoint compatibility filter.
…parts, ws.send race

Complete session.update rollback with full snapshot. Add missing Beta
flat fields for noise reduction and transcription. Apply turn_detection
updates from session.update. Concatenate all text content parts in
realtimeItemsToMessages. Wrap ws.send in try-catch for TOCTOU safety.
…n guards

Change ctString ?? to || for empty-string fallback. Derive EndpointType
from FixtureMatch instead of duplicate union. Add negative guards to
Gemini Interactions outputs detection. Scope turnIndex/hasToolResult to
chat endpoints. Document gemini-interactions provider key remap.
…unks framing

Add missing webSearches warning to tool-call-only branch. Align
interactionsUsage with geminiUsageMetadata fallback chain. Only count
content.delta events for truncateAfterChunks (skip framing events).
Replace headers: {} with flattenHeaders(req.headers) in 6 journal
entries. Add isJSONResponse branch to handleSyncRun. Document shared
endpoint type between queue-submit and sync-run.
Replace deterministic call_gemini_${name}_${i} IDs with random
generateToolCallId() to prevent cross-turn collisions. Wrap ws.send
in try-catch for connection-close race safety. Update tests for
random IDs.
…rdening

Add input_tokens/promptTokenCount/candidatesTokenCount to resolveUsage.
Preserve error cause in resolveResponse rethrow. Update aimock header.
Escape regex in extractFormField, warn on boundary-less fallback. Fix
parseTypedSSE multi-line handling, [DONE] filter, JSON error context,
retry logging, and API key redaction in drift providers.
@jpr5 jpr5 force-pushed the fix/pre-existing-sweep branch from cad6cae to f770b80 Compare May 19, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant