ACP: first prompt can miss MCP tools supplied to session/new (2.0.18 / 2.0.22)
维护者通常 1 天内回复
@kitlangton 已经在做这个了。
开始于 2026年10月5日。
评估
这个 Issue 还没有评估数据。
描述
Description
MCP tools supplied through ACP session/new can be absent from the first model-visible tool catalog, even after session/new has returned successfully. A later prompt in the same session sees them.
Reproduced on 2.0.18 and 2.0.22 on macOS arm64. Two independent 2.0.18 runs both showed: immediate prompt = tools absent; prompt after 500 ms = tools present. A diagnostic control that waits for actual tool registration makes the first prompt include them.
The diagnostic observer records tool registration and model context, then deliberately stops before provider dispatch. These observations do not require a model/API request. Native permissions were ask, with the test MCP namespace allowed.
Expected: the first prompt should use the tools supplied for that session without the ACP client needing an arbitrary sleep.
Suspected location in v2.0.22: packages/core/src/tool/mcp.ts debounces subsequent updates by 100 ms, but flush only awaits the initial registration. packages/core/src/session/context.ts then takes the tool snapshot. This appears to leave a readiness gap for MCP servers added by ACP; please confirm the diagnosis.
Plugins
Custom diagnostic observer only; separate control adds a tool-readiness wait. No third-party plugin pack.
OpenCode version
2.0.18 and 2.0.22
Steps to reproduce
- Start opencode acp with a clean runtime/config directory.
- Complete ACP initialize.
- Call session/new with an absolute cwd and a local stdio MCP server exposing two fixed tools. Allow this MCP namespace.
- Wait for the successful session/new response, then immediately call session/prompt.
- Inspect the model-visible tool catalog: the supplied MCP tools may be missing, while the registry logs show them arriving shortly afterward.
- Send another prompt in the same session after 500 ms: the tools are now present.
Control: wait for the supplied tools to enter the registry before preparing the first prompt; the first context then includes them. This control is a diagnostic workaround, not an upstream fix.
Screenshot and/or share link
No response
Operating System
macOS, Darwin 27.0.0, Apple Silicon arm64
Terminal
ACP stdio client launching opencode acp (not the TUI)
- 主要语言
- TypeScript
- 星标
- 212k
- 派生
- 28.1k
- 平均合并
- 9 小时 58 分钟
- 30 天内合并 PR
- 373
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
Windows: global-project session path depends on server process drive, hides API-created sessions from desktop picker可能已有人在做 @1624318455 于 11 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
[FEATURE]: Test that PermissionV2 declines pending requests when its scope closes可能已有人在做 @saeedahmed96 于 9 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
EffectFlock heartbeat never refreshes, so locks held over 60 s can be broken可能已有人在做 @iceteaSA 于 12 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
anomalyco/opencode#51159 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
umbraco/Umbraco-CMS-MCP-Dev#512 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
wimpysworld/sidra#290 ·
维护者通常 1 天内回复
-
defuFn invokes function values for inherited default properties可能已有人在做 @xiehuanyi 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 85/100
-
feature request good first issue
难度 2/5 1-3 小时 新手友好度 85/100
TabularisDB/tabularis#853 ·
维护者通常 1 天内回复
-
难度 2/5 1 小时以内 新手友好度 85/100
capricorn86/happy-dom#2474 ·
维护者通常 2 天内回复