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

ACP: first prompt can miss MCP tools supplied to session/new (2.0.18 / 2.0.22)

未关闭
#53,299 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 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
  1. Start opencode acp with a clean runtime/config directory.
  2. Complete ACP initialize.
  3. Call session/new with an absolute cwd and a local stdio MCP server exposing two fixed tools. Allow this MCP namespace.
  4. Wait for the successful session/new response, then immediately call session/prompt.
  5. Inspect the model-visible tool catalog: the supplied MCP tools may be missing, while the registry logs show them arriving shortly afterward.
  6. 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

环境准备

从这里开始

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

anomalyco/opencode 的其他 Issue

查看 anomalyco/opencode 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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