Skip to content

[Desktop] select_tools reloads built-in Agent and causes duplicate tool name HTTP 400 #4717

Open

Description

@908602313

Summary

Loading the built-in Agent / AgentSwarm tools through select_tools makes the next model request fail with HTTP 400 because Agent is present in both request-level tools and message-level tools. The session then becomes unusable: Continue and resuming it reproduce the same failure.

Environment

  • Kimi Code Desktop 1.3.1
  • Windows
  • Model: kimi-code/k3.1-pro
  • Long-running restored session

Steps to reproduce

  1. In a session where the built-in Agent tools are available, invoke:

    {"names":["Agent","AgentSwarm"]}

    through select_tools after the tool set has changed.

  2. The tool returns Loaded: Agent, AgentSwarm.

  3. On the next model request, the API rejects the request:

    duplicate tool name Agent between request-level tools and message tools at message position 933
    provider.api_error · HTTP 400
    
  4. Click Continue, or resume the session and try again. The same error remains at message position 933.

The failing request had 934 messages; position 933 is the final tool-result message produced by select_tools. It appears that loading the tool adds message-level schemas without deduplicating the existing request-level Agent schema.

Expected behavior

Tool loading should deduplicate schemas by name across request-level and message-level definitions, or reject an already-loaded built-in tool locally without poisoning subsequent requests.

Actual behavior

Every later model call is rejected before generation, so the task cannot continue in that session.

Request IDs (2026-11-05, UTC+8)

  • 20:52:17 — 10e97fd8743b6e382fb19025f657cc93
  • 20:53:26 — 4d2b1aad9d5447d562f8577949d579aa
  • 20:59:45 — 912f1cc20b49ac085eed874a78654981

No conversation logs or business code are attached to keep the report sanitized. I can provide a minimal sanitized wire excerpt if needed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions