core: Slack MCP catalog budget hides tools with long descriptions
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
packages/core/src/codemode/catalog.ts の 52 行目付近にある INLINE_BUDGET から始めて、予算が尽きるまで各ツール署名がどのように追加されるかを読んでください。次に、codemode のサーバーごとのフラグが opencode.json からどこでパースされるかを見つけ、設定可能な予算をどこに通すことになるかを確認してください。完了の形は、カタログが ~30 個の Slack ツールをすべて一覧表示している(または予算がより高いデフォルトでユーザー設定可能である)ことであり、既存のカタログテストは引き続き通っています。
索引モデルが issue の本文から書いたものです。
説明
Summary
The Code Mode tool catalog uses a hardcoded 2000-character inline budget (INLINE_BUDGET) for rendering tool signatures. When an MCP server provides tools with long descriptions (typical of Slack MCP's 30 tools at ~1400 chars avg), the budget exhausts after 2-5 tools. The model sees only those few tools and cannot call the remaining 28+, effectively hiding the majority of an MCP server's tools.
Environment
- opencode version: 2.3.0
- OS: Windows_NT 10.0.26300 (win32 x64)
- Terminal: xterm-256color
- Shell: C:\WINDOWS\system32\cmd.exe
- Install/channel: latest (npm global)
- Active plugins: None found in config
Reproduction
- Configure Slack MCP server in
opencode.json:{ "mcp": { "servers": { "slack": { "type": "remote", "url": "https://mcp.slack.com/mcp", "oauth": false, "headers": { "Authorization": "Bearer {env:SLACK_MCP_TOKEN}" } } } } } - Open a session that connects the Slack MCP server. Logs confirm:
mcp connected, server=slack, tools=30. - Observe the model can call at most 2 Slack tools (
slack_add_list_record,slack_add_reaction) through Code Mode. The other 28 tools are not visible in the Code Mode catalog. - All 30 tools have valid JSON schemas (
inputSchema.type = "object") and pass validation — the issue is the inline budget, not schema filtering.
Expected Behavior
The Code Mode catalog should display all or most tools from each connected MCP server, allowing the model to call any of them.
Actual Behavior
Only 2 of 30 Slack MCP tools appear in the Code Mode catalog. Slack tools have very long descriptions (e.g., slack_read_list = 3646 chars, slack_create_list = 2470 chars). The hardcoded 2000-char budget exhausts after ~2 tools:
// packages/core/src/codemode/catalog.ts line 52
const INLINE_BUDGET = 2_000
// Each Slack tool listing costs ~1500-450 chars:
// " - slack_send_message // Sends a message to a Slack channel..." (~250 chars)
// " - slack_create_list // Creates a new Slack List with..." (~390 chars)
// Budget exhausts after 2-5 tools depending on description length.
Additional Context
Root cause: INLINE_BUDGET = 2_000 is hardcoded with no config override. Each tool listing costs approximately line.length / 4 characters (1 char ≈ 0.25 tokens). Slack MCP tools have descriptions ranging from 236 to 3646 chars, producing inline entries of ~150-470 chars each. The budget exhausts after 2-5 tools.
Affected MCP servers: This affects any MCP server whose tools have descriptions > ~400 chars (budget / 5 tools). Slack MCP is the primary example; many other MCP servers could be impacted.
Workarounds tried:
- Verified all 30 Slack tools have valid schemas — schema filtering is NOT the issue.
- Slack REST API works directly (
auth.test,conversations.list,chat.postMessage), confirming the Slack token is valid and the workspace is accessible. - Setting
"codemode": falseon the Slack MCP config moves tools to direct tool calls (full exposure), but that's a workaround, not a fix.
Suggested fix: Make INLINE_BUDGET configurable via either:
- A top-level config option (e.g.,
codemode.catalog_budget), or - A flag (e.g.,
codemode_catalog_budget), defaulting to a higher value (e.g., 8000-16000) in all builds.
- 主要言語
- TypeScript
- スター
- 228k
- フォーク
- 31k
- 平均マージ
- 3時間 22分
- マージ済み PR(30日)
- 476
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
anomalyco/opencode のほかの issue
-
desktop: app-version.v1 in drafts.sqlite is never refreshed — reports 1.19.4 while running 2.3.2オープンarea/desktop platform/windows type/feature version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
anomalyco/opencode#66079 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area/mcp platform/windows status/repro-simulated type/bug version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
anomalyco/opencode#66073 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
claude-agent with a Claude subscription doesn't set cache.ttl, so warming pings every 4 minutesオープンarea/providers platform/windows type/feature version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
anomalyco/opencode#66001 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
@opencode/ui: v2-text-text-faint and light v2-state-fg-warning fall below WCAG AA 4.5:1 contrast対応中かも @KhadeerBasha1232 が今日担当しました。 オープンstatus/repro-plausible
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
anomalyco/opencode#65923 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
area/core platform/windows type/bug version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
anomalyco/opencode#65880 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
anomalyco/opencode の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
lidofinance/validator-ejector#233 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
ai-driven-qa bug claude Major
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
linagora/twake-mail-admin#742 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
OpenSlides/openslides-client#6728 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 66/100