Skip to content

ACP Function Enhancement #5863

Description

@Lujc0523

serve --acp does not expose session config options (modes / models / configOptions), so editor clients cannot show or change the working mode


Environment

  • Package / version: codewhale npm wrapper 0.9.11, native binary codewhale 0.9.11 (Linux x64)
  • Command under test: codewhale serve --acp (ACP v1 server over stdio)
  • Client: JetBrains IntelliJ IDEA 2026.2 built-in ACP client (com.intellij.platform.acp, ml-llm AI Assistant), registered via ~/.jetbrains/acp.json

Summary

codewhale serve --acp implements only a minimal subset of the Agent Client Protocol (ACP v1): initialize and session/new work and prompts run fine, but the server does not expose session-level configuration — no modes, no models, no configOptions — and it does not implement the session/set_mode / session/set_model / session/set_config_option methods (-32601 method not found).

Editor clients such as JetBrains AI Assistant build the agent's configuration UI ("working mode", model picker, effort, tool-approval, …) entirely from the data an agent exposes over ACP. With none of it present, there is no mode/model/config UI at all for codewhale, even though the same client shows rich, editable configuration for other ACP agents (Kilo, Reasonix).

Reproduction

Start the ACP server and speak ACP v1 framing (JSON-RPC 2.0 with Content-Length headers) over stdio:

codewhale serve --acp

Send initialize, then session/new:

{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":1,"clientCapabilities":{}}}
{"jsonrpc":"2.0","id":2,"method":"session/new","params":{"cwd":"/tmp","mcpServers":[]}}

Then try to change the session mode:

{"jsonrpc":"2.0","id":3,"method":"session/set_mode","params":{"mode":"plan"}}

Actual behavior

session/new returns only a session id — no modes, models, or configOptions:

{"jsonrpc":"2.0","id":2,"result":{"sessionId":"codewhale-6a060599-85c8-4b5e-b87c-21302b86185c"}}

session/set_mode is unimplemented:

{"jsonrpc":"2.0","id":3,"error":{"code":-32601,"message":"method not found: session/set_mode"}}

Expected behavior

Per ACP, the agent should advertise available session configuration (modes, models, config options) and handle the corresponding setter methods, so that ACP editor clients can present and persist them in their UI.

Reference: how other ACP agents behave (for comparison)

Both were probed with the exact same requests, through their ACP entrypoints (kilo acp, reasonix acp).

Kilo (v7.5.9) — session/new

Returns configOptions with a model select (12 options) and a mode select:

{"jsonrpc":"2.0","id":2,"result":{
  "sessionId":"ses_f9a95eaf9ffeufj81Dfx8BY6K7",
  "configOptions":[
    {"id":"model","name":"Model","category":"model","type":"select","currentValue":"newapi/deepseek-v4-pro","options":[
      {"value":"newapi/deepseek-v4-flash","name":"NewAPI (内网)/DeepSeek V4 Flash"},
      {"value":"newapi/deepseek-v4-pro","name":"NewAPI (内网)/DeepSeek V4 Pro"}
    ]},
    {"id":"mode","name":"Session Mode","category":"mode","type":"select","currentValue":"code","options":[
      {"value":"code","name":"code","description":"The default agent. Executes tools based on configured permissions."},
      {"value":"ask","name":"ask","description":"Get answers and explanations without making changes to the codebase."},
      {"value":"debug","name":"debug","description":"Diagnose and fix software issues with systematic debugging methodology."},
      {"value":"orchestrator","name":"orchestrator","description":"Coordinate complex tasks by delegating to specialized agents in parallel."},
      {"value":"plan","name":"plan","description":"Plan mode. Can only edit plan files; all other filesystem mutations are denied."}
    ]}
  ]
}}

Reasonix (v1.36.0) — session/new

Returns models (7 entries), modes, and configOptions:

{"jsonrpc":"2.0","id":2,"result":{
  "sessionId":"df9f4968-3bab-454b-8fd8-4af4d75c6852",
  "models":{"availableModels":[
    {"modelId":"newapi/deepseek-v4-flash","name":"newapi/deepseek-v4-flash","description":"newapi"},
    {"modelId":"newapi/deepseek-v4-pro","name":"newapi/deepseek-v4-pro","description":"newapi"},
    {"modelId":"newapi/glm-5.1","name":"newapi/glm-5.1","description":"newapi"}
  ],"currentModelId":"newapi/glm-5.1"},
  "modes":{"currentModeId":"normal","availableModes":[
    {"id":"normal","name":"Normal","description":"Work directly and pause when user input is required"},
    {"id":"plan","name":"Plan","description":"Research and propose a plan before making changes"},
    {"id":"goal","name":"Goal","description":"Keep advancing the next prompt as a goal until complete or blocked"}
  ]},
  "configOptions":[
    {"id":"model","name":"Model","category":"model","type":"select","currentValue":"newapi/glm-5.1","options":[]},
    {"id":"effort","name":"Effort","category":"thought_level","type":"select","currentValue":"auto","options":[
      {"value":"auto","name":"Auto"},{"value":"disabled","name":"Disabled"},
      {"value":"low","name":"Low"},{"value":"high","name":"High"},{"value":"max","name":"Max"}
    ]},
    {"id":"tool_approval","name":"Tool Approval","category":"tool_approval","type":"select","currentValue":"ask","options":[
      {"value":"ask","name":"Ask","description":"Ask before permission-gated tool calls"},
      {"value":"auto","name":"Auto","description":"Follow configured permission rules without fallback prompts"},
      {"value":"yolo","name":"Yolo","description":"Approve tool calls except protected decisions"}
    ]}
  ]
}}

Impact

  • JetBrains IDEA's built-in ACP client shows no mode/model/configuration UI for codewhale, although it shows fully editable cards for other ACP agents.
  • The user cannot switch codewhale into a plan-only / read-only working mode from the IDE, nor pick a model per session.
  • ACP client-side configuration persistence (acpAgents.xml / ~/.jetbrains/acp.json agent config options) only carries values for options the agent advertises, so nothing can be applied either.

Suggested fix

In the serve --acp handler:

  1. Advertise session config in the session/new response: at minimum a configOptions array (or the models / modes structures) describing what the running codewhale session supports.
    • A natural starting point: map codewhale's own session concepts to ACP, e.g. a mode option backed by codewhale's existing working modes / planning mode, a model option listing models from the active provider, and reasoning_effort / approval posture from the existing config (~/.codewhale/config.toml: default_text_model, reasoning_effort, permission_posture).
  2. Implement the setter methods session/set_mode, session/set_model, session/set_config_option so clients can apply changes and persist them across the session.
  3. Optionally surface the same in initialize's agentCapabilities (model selection etc.) for clients that decide UI capabilities from the handshake.

Notes

  • Codewhale already runs correctly as an ACP agent end-to-end (IDEA 2026.2 launches codewhale serve --acp, creates sessions, and completes tasks); only the configuration surface is missing.
  • JetBrains' ACP method surface (for reference): session/set_mode, session/set_model, session/set_config_option, plus session CRUD methods already supported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    • Status
      Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions