kilocode icon indicating copy to clipboard operation
kilocode copied to clipboard

agent_manager start becomes list under strict Responses API tool calling

Open Derbay32 opened this issue 3 months ago • 2 comments

Description

When using the OpenAI Response API models (including those accessed via ChatGPT subscription) in kilo code, and requesting the agent_manager to create an independent branch for a subagent with mode: "worktree", the Response API's strict schema enforcement forces the model to return a value for optional fields.

Since the schema does not accept null, even when the model is instructed to pass action: null to indicate omitting the parameter, the tool still ends up receiving action: "list". As agent_manager does not accept null, it interprets "list" as a valid action and returns an overview instead of creating a new branch or session.

I can reproduce it with an OpenAI Responses API model (e.g. GPT-5.6 Sol). And the chat-completions models are ok (e.g. Kimi-K3, Qwen 3.8 Max).

Plugins

None

Kilo version

7.4.20

Steps to reproduce

  1. Configure Kilo Code with an OpenAI Responses API model.
  2. Ask the agent to delegate an implementation task by creating an Agent Manager worktree session.
  3. The agent constructs a start request using mode: "worktree", "versions" and a non-empty tasks array.
  4. Inspect the actual arguments received by the agent_manager tool.

The intended call is effectively:

{
  "mode": "worktree",
  "versions": false,
  "tasks": [
    {
      "prompt": "balabala...",
      "name": "a new name",
      "branchName": "a-new-branch"
    }
  ]
}

But the actual call received by the tool is:

{
  "mode": "worktree",
  "versions": false,
  "tasks": [
    {
      "prompt": "balabala…",
      "name": "a new name",
      "branchName": "a-new-branch",
      "model": "",
      "variant": ""
    }
  ],
  "action": "list",
  "filter": null,
  "sessionID": "",
  "prompt": "",
  "sectionID": null
}

The tool then returns:

{
  "instructions": "This overview is the source of truth. Use sections[].id as sectionID and sessions[].id/session.id as sessionID for action=move. Do not edit .kilo/agent-manager.json.",
  "sections": [],
  "ungrouped": [],
  "local": {
    "branch": "dev",
    "sessions": [],
    "git": {
      "additions": 1,
      "deletions": 1,
      "ahead": 0,
      "behind": 0
    }
  }
}

and no worktree session is created.

Screenshot and/or share link

Image Image

Operating System

macOS 26.6.1

Terminal

macOS Terminal

Derbay32 avatar Aug 09 '26 12:08 Derbay32

This is fixed in v7.4.21 via PR #12695. Responses-family providers now explicitly send function tools with strict: false, preventing OpenAI from filling optional agent_manager fields with placeholder values such as action: "list". Upgrading from v7.4.20 to v7.4.21 should restore worktree session creation.

chrarnoldus avatar Aug 11 '26 08:08 chrarnoldus

Fixed in v7.4.21 via PR #12695 — Responses-family providers now send function tools with strict: false, preventing OpenAI from filling optional agent_manager fields with placeholder values like action: "list". Upgrading from 7.4.20 to 7.4.21+ should resolve this.

maphew avatar Aug 18 '26 14:08 maphew