Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Generated Pi extension (cbmem.ts) breaks Gemini/Antigravity: Type.Union of Type.Literal serializes to anyOf/const

未关闭 适合新手
#2,787 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

@divakantpandey 已经在做这个了。

开始于 2026年10月26日。

  • #2807 来自 @divakantpandey —— 未关闭

评估

难度
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 内容生成。

描述

bug editor/integration

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.ts generated by codebase-memory-mcp install

Repro

  1. Run codebase-memory-mcp install with Pi present, then start Pi with a Gemini/Antigravity model.
  2. 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,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

DeusData/codebase-memory-mcp 的其他 Issue

查看 DeusData/codebase-memory-mcp 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。