Coder Agents client tools: $ref in tool input schemas is not resolved
维护者通常 1 天内回复
@ThomasK33 已经在做这个了。
开始于 2026年10月12日。
评估
这个 Issue 还没有评估数据。
描述
Client tools registered through Coder Agents (chatd) lose any $ref in their input schema. The model then guesses the referenced shape.
Evidence (live, dogfood.cdr.dev v2.38.0-devel, 2026-10-12)
I registered one client tool, create_reminder, through @coder/ai-sdk-agent's CoderLanguageModel, with delay behind a reference. I tried two forms:
| Schema form | chatd response | Model's delay argument |
|---|---|---|
draft-07: { "$ref": "#/definitions/Delay" } + definitions |
accepted | "10m" |
2020-12: { "$ref": "#/$defs/Delay" } + $defs |
accepted | "10m" |
inline { "type": "object", "properties": { "minutes": { "type": "integer" } } } |
accepted | { "minutes": 10 } |
The dialect makes no difference, so the reference most likely never reaches the model resolved. I did not verify where it is dropped (chatd's schema handling or the upstream provider call).
Impact
@coder/ai-sdk-effect derives tool schemas from Effect Schema. Any schema with an identifier annotation is emitted as a $ref (on Effect 3 and Effect 4), so such tools do not work as Coder Agents client tools. The AI Gateway path (CoderLanguageModel) is not affected by this observation (not tested live).
Options
- A. Find and fix where chatd drops or fails to resolve
$ref(coder/coder). - B. Inline (dereference) local references in the agent package before registering client tools.
- C. Document the limitation and inline only in
@coder/ai-sdk-effect.
Found during the Effect 4 migration (#144, #320). The live test there uses an inline schema.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high
- 主要语言
- TypeScript
- 星标
- 3
- 派生
- 0
- 平均合并
- 50 分钟
- 30 天内合并 PR
- 136
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
coder/ai-sdk 的其他 Issue
-
accepted dependencies
难度 5/5 一周以上 新手友好度 35/100
维护者通常 1 天内回复
-
accepted enhancement
难度 5/5 一周以上 新手友好度 35/100
维护者通常 1 天内回复
-
accepted dependencies
难度 5/5 一周以上 新手友好度 25/100
维护者通常 1 天内回复
相似的 Issue
-
type: bug
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
0️⃣ phase/new
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 1/5 1 小时以内 新手友好度 70/100
microsoft/playwright#43640 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100