You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Generated Pi extension (cbmem.ts) breaks Gemini/Antigravity: Type.Union of Type.Literal serializes to anyOf/const #2787
The Pi extension that codebase-memory-mcp install generates (cbmem.ts) builds string enums with Type.Union([Type.Literal(...), ...]). TypeBox serializes that as anyOf: [{ const: ... }]. Google's function-declaration schema (Gemini, Antigravity / Cloud Code Assist) has no const, so the API rejects the whole request and Pi cannot make any model call while the extension is loaded.
Environment
codebase-memory-mcp 0.12.1 (latest release)
Pi 1.1.0, provider: Antigravity (Gemini)
macOS, cbmem.ts generated by codebase-memory-mcp install
Repro
Run codebase-memory-mcp install with Pi present, then start Pi with a Gemini/Antigravity model.
Send any prompt.
Result (every prompt, including "reply OK"):
Antigravity API error (400): Invalid JSON payload received.
Unknown name "const" at 'request.tools[0].function_declarations[5].parameters.properties[1].value.any_of[0]': Cannot find field.
function_declarations[5] is index_repository and properties[1] is mode. The generated file has 30 such Type.Union sites (for example mode, format, direction, diagnostics, aspects).
Removing cbmem.ts makes the same Pi session work again, so the generated file is the trigger.
Suggested fix
Emit enums as plain JSON-schema string enums instead of literal unions, for example Type.Unsafe({ type: 'string', enum: [...] }) (or Pi's StringEnum helper), so the serialized schema is { type: 'string', enum: [...] } with no anyOf/const. The earlier hand-synced copy referenced in #1806 used plain JSON schema and did not have this problem.
Workaround
Rewrite const-unions as enums where the provider builds functionDeclarations. That fixes it for every extension without editing the generated block, which is overwritten on update.
Related: #1806, #1867 (earlier Pi generator fixes).
Thank you for the exact provider rejection and the control with cbmem.ts removed. The generated enum schema versus provider acceptance is a clear boundary to investigate. I’ll follow up after maintainer review of the generator compatibility case.
Activity
DeusData commentedon Oct 25, 2026
Thank you for the exact provider rejection and the control with cbmem.ts removed. The generated enum schema versus provider acceptance is a clear boundary to investigate. I’ll follow up after maintainer review of the generator compatibility case.