Generated Pi extension (cbmem.ts) breaks Gemini/Antigravity: Type.Union of Type.Literal serializes to anyOf/const
维护者通常 2 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- node.js, typescript
调研方向
从 codebase-memory-mcp install 使用的 Pi 扩展生成器入手,检查 cbmem.ts 如何输出 30 个 Type.Union schema,包括 mode 和 format。检查生成的 schema 输出,并将其与提供方接受的函数声明格式进行比较。完成标准是:生成的枚举序列化时不含 anyOf 或 const,且 Gemini/Antigravity 能接受加载了该扩展的 prompt。
由索引模型根据 Issue 内容生成。
描述
Summary
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.tsgenerated bycodebase-memory-mcp install
Repro
- Run
codebase-memory-mcp installwith 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).
- 主要语言
- C
- 星标
- 45.8k
- 派生
- 3.8k
- 平均合并
- 3 天 4 小时
- 30 天内合并 PR
- 208
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
DeusData/codebase-memory-mcp 的其他 Issue
-
editor/integration parsing/quality
难度 2/5 1-3 小时 新手友好度 68/100
DeusData/codebase-memory-mcp#2286 ·
维护者通常 2 天内回复
-
install writes an unsupported `args` key into the Claude Code SubagentStart hook, so it never runs未关闭bug editor/integration priority/high stability/performance ux/behavior
难度 2/5 1-3 小时 新手友好度 72/100
DeusData/codebase-memory-mcp#2239 · 1 条评论 ·
维护者通常 2 天内回复
-
bug priority/high ux/behavior
难度 2/5 1-3 小时 新手友好度 72/100
DeusData/codebase-memory-mcp#2232 · 2 条评论 ·
维护者通常 2 天内回复
-
documentation editor/integration parsing/quality priority/normal
难度 2/5 1-3 小时 新手友好度 85/100
DeusData/codebase-memory-mcp#2169 ·
维护者通常 2 天内回复
-
documentation priority/normal ux/behavior
难度 2/5 1-3 小时 新手友好度 72/100
DeusData/codebase-memory-mcp#2050 ·
维护者通常 2 天内回复
查看 DeusData/codebase-memory-mcp 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
yunusemreyl/omen-space#337 ·
维护者通常 1 天内回复
-
dependency component: oneMKL module: dpclang
难度 2/5 1-3 小时 新手友好度 82/100
intel/torch-xpu-ops#5880 ·
维护者通常 2 天内回复
-
area/ci-build bug
难度 2/5 1-3 小时 新手友好度 65/100
DarkFlippers/qUnleashed#423 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
CVE-2026-111497未关闭
难度 1/5 1 小时以内 新手友好度 82/100
fink/fink-distributions#1322 ·