provider.api_error: unload_tools rejected — "tool is not declared or has already been unloaded" — session unrecoverable
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- ai-infra-agents, cli
調査の方向性
Start by tracing how context compaction rebuilds request history and preserves dynamic_tool_schema messages, then follow how unload_tools directives are validated against provider tool state. The issue points to #5066 as related; compare its findings with a long session using MCP servers and dynamic tool loading. Done means compaction cannot leave unload directives inconsistent and the session can continue after compaction.
索引モデルが issue の本文から書いたものです。
説明
What version of Kimi Code is running?
2.8.0
What platform is your computer?
Linux (WSL2)
What model were you using?
Default Kimi model with dynamically_loaded_tools capability.
What issue are you seeing?
Every turn in the session fails with:
Error: [provider.api_error] unload_tools at message position 88:
tool "<mcp tool name>" is not declared or has already been unloaded
The request history contains an unload_tools directive that the provider-side load/unload state machine rejects. Once it appears, every subsequent request is rejected with the same error — the session cannot continue, only starting a new session helps.
Notably, dynamic tool loading was active even though tool-select is NOT enabled under [experimental], no MCP server has deferred: true, and no KIMI_CODE_EXPERIMENTAL* env vars are set.
Likely related to #5066 (compaction drops dynamic_tool_schema messages): if compaction rebuilds history while unload directives remain, the wire history can end up inconsistent with the provider-side state machine.
Steps to reproduce
- Long session with MCP servers, dynamic tool loading active.
- Context compaction occurs (auto-compaction in a long session).
- Next request fails with the error above; every retry fails identically.
Expected behavior
The client should keep load/unload directives consistent with the provider state machine (or rebuild them after compaction), and a session should never enter a state where every request is rejected.
Also reported via /feedback, Feedback ID 3611.
- 主要言語
- TypeScript
- スター
- 8.3k
- フォーク
- 1.4k
- 平均マージ
- 12時間 6分
- マージ済み PR(30日)
- 596
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MoonshotAI/kimi-code のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
MoonshotAI/kimi-code#5539 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] Kimi RC workspace folder picker does not display symbolic link directories対応中かも @markankamaransheogarat-sys が 2 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
MoonshotAI/kimi-code#5296 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
MoonshotAI/kimi-code#5256 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
MoonshotAI/kimi-code#5062 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
MoonshotAI/kimi-code#5057 ·
メンテナーはふだん 1 日以内に返信
MoonshotAI/kimi-code の issue をすべて見る
似ている issue
-
Add Alice&Botオープン
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
slavakurilyak/awesome-ai-agents#1048 ·
-
bot:ai-assisted component:faucet github_actions security status:untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
midnightntwrk/midnight-faucet-api#215 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NanmiCoder/cc-haha#2034 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
mobile prio:low
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
digitalfabrik/entitlementcard#3324 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信