Skip to content

Fix for bug found in Gemini support found during INT tests#24

Merged
rpkruse merged 4 commits intomainfrom
ts-fix-gemini-int
Mar 17, 2026
Merged

Fix for bug found in Gemini support found during INT tests#24
rpkruse merged 4 commits intomainfrom
ts-fix-gemini-int

Conversation

@rpkruse
Copy link
Copy Markdown
Contributor

@rpkruse rpkruse commented Mar 17, 2026

  • The Bug: Google's @google/genai SDK strictly rejects any message in its contents array that isn't explicitly tagged with the user or model role, throwing a 400 INVALID_ARGUMENT error. When the core Memori engine injected recalled facts using a standard { role: 'system' } message, the Axon middleware blindly passed it into the Gemini contents array.
  • The Impact: Any attempt to use Memori's recall injection feature with Gemini resulted in an immediate API crash, breaking the integration.
  • The Fix: Updated the Axon translation layer (proxy.ts, common.ts, and types.ts) to properly intercept and filter out system messages from the main array. Axon now cleanly extracts and maps the system prompt over to config.systemInstruction, exactly where modern Gemini models expect it. We also completely overhauled the Gemini type definitions along the way

@rpkruse rpkruse merged commit b73a283 into main Mar 17, 2026
4 checks passed
@rpkruse rpkruse deleted the ts-fix-gemini-int branch March 17, 2026 18:53
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