Commit 5b46861
authored
## Summary
Adds full record/replay support for Google's Gemini Interactions API
(`POST /v1beta/interactions`), the stateful conversation endpoint used
by TanStack AI's `geminiTextInteractions()` adapter. 12th LLM provider.
- **New handler** (`src/gemini-interactions.ts`): request conversion,
response builders, SSE stream writer with data-only format, multi-turn
sequencing via `previous_interaction_id`
- **SDK wire-format conformance**: prefers `content` over `parts` (Turn
field) and `result` over `output` (function_result field), matching the
official `@google/genai` SDK types with backwards-compat fallback
- **Drift detection**: canonical drift tests with SDK shape
triangulation
- **Recorder integration**: `buildFixtureResponse` Interactions
detection + stream collapse
- **63 tests** (2682 total) covering input conversion, response
builders, SSE streaming, stream collapse, fixture matching, wire-format
conformance, and edge cases
Closes #136
## Test plan
- [x] `pnpm test` — 2682 passed, 36 skipped, 0 failed
- [x] `pnpm run format:check` — clean
- [x] `pnpm run lint` — clean
- [x] `npx tsc --noEmit` — clean
- [x] CR converged (R1: 2 findings fixed, R2: 0 findings)
31 files changed
Lines changed: 3206 additions & 66 deletions
File tree
- docs
- docs
- fixtures
- gemini-interactions
- migrate-from-mock-llm
- migrate-from-mokksy
- migrate-from-msw
- migrate-from-openai-responses
- migrate-from-piyook
- migrate-from-python-mocks
- migrate-from-vidaimock
- scripts
- skills/write-fixtures
- src
- __tests__
- drift
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| |||
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
109 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
110 | 122 | | |
111 | 123 | | |
112 | 124 | | |
| |||
163 | 175 | | |
164 | 176 | | |
165 | 177 | | |
166 | | - | |
| 178 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
310 | 313 | | |
311 | 314 | | |
312 | 315 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
| 550 | + | |
550 | 551 | | |
551 | 552 | | |
552 | 553 | | |
| |||
566 | 567 | | |
567 | 568 | | |
568 | 569 | | |
| 570 | + | |
569 | 571 | | |
570 | 572 | | |
571 | 573 | | |
| |||
578 | 580 | | |
579 | 581 | | |
580 | 582 | | |
| 583 | + | |
581 | 584 | | |
582 | 585 | | |
583 | 586 | | |
| |||
590 | 593 | | |
591 | 594 | | |
592 | 595 | | |
| 596 | + | |
593 | 597 | | |
594 | 598 | | |
595 | 599 | | |
| |||
598 | 602 | | |
599 | 603 | | |
600 | 604 | | |
| 605 | + | |
601 | 606 | | |
602 | 607 | | |
603 | 608 | | |
| |||
609 | 614 | | |
610 | 615 | | |
611 | 616 | | |
| 617 | + | |
612 | 618 | | |
613 | 619 | | |
614 | 620 | | |
| |||
626 | 632 | | |
627 | 633 | | |
628 | 634 | | |
| 635 | + | |
629 | 636 | | |
630 | 637 | | |
631 | 638 | | |
| |||
634 | 641 | | |
635 | 642 | | |
636 | 643 | | |
| 644 | + | |
637 | 645 | | |
638 | 646 | | |
639 | 647 | | |
| |||
0 commit comments