Skip to content

feat(session): support kiro-cli v3 engine and Kiro workflows over ACP #1607

Done

Description

@chaodu-agent

Description

Support running kiro-cli acp on the v3 engine (kiro-cli 3.x), including Kiro's own workflow feature (run_workflow), in openab. Today a bot can only use v2 args (acp --agent <name> --trust-all-tools). On kiro-cli 3.3.0, acp --agent-engine=v3 rejects --agent and --trust-all-tools, so a bot cannot move to v3 by editing args alone.

Findings below come from a throwaway probe (kiro-cli 3.3.0, nightly-kiro image, a client driven like openab's connection.rs, no live bot touched). Code references are to openab at 4fea4249.

What v3 does differently

  • Agents are selected as modes. session/new lists them in modes.availableModes, and a session always starts as vibe (default, full tools). The selector is session/set_mode, or session/set_config_option with configId: "mode"; both work when the agent exists.
  • v3 does not read v2 JSON agents (~/.kiro/agents/<name>.json) and does not auto-upgrade them. Only ~/.kiro/agents/<name>.md (frontmatter: name, description, tools, includeMcpJson) is loaded. The tools allowlist is honoured.
  • chat.defaultAgent is v2-only. --agent, --model, --trust-all-tools are v2-only flags.
  • An unknown mode id returns success from both set_mode and set_config_option, and the session stays vibe with the default toolset. openab treats a non-error response as success (pool.rs:633, connection.rs:632), so a missing agent is silent and the bot runs with full tools.
  • includeMcpJson: false does not stop user MCP servers from starting at session/new.
  • Workflow tools are off by default (session/new result _meta.workflowsEnabled=false). They turn on only when the client sends _meta.kiro.settings.workflows.enabled=true in the session/new params. The chat.enableWorkflows setting, the same key in initialize capabilities, and env vars have no effect.
  • One engine process serves all sessions of one kiro-cli process: idle about 340-370 MB, peak about 510 MB with four sessions and an active workflow.

Workflow behaviour over ACP (kiro-cli 3.3.0)

  • session/prompt returns end_turn before the workflow finishes (3.4 s versus 8.4 s in a trivial run; about 100 s later in a two-step run). The final answer arrives afterwards as session/update agent_message_chunk frames with no request id.
  • Step sessions emit their own session/update frames with the step's sessionId.
  • Every step session sends its own session/request_permission (2-3 per shell command). An answer to one step does not carry over. If the client never answers, the run stays running with no timeout.
  • Step agents can be wf-*, semantic_reviewer, or .md custom agents. Custom agent resources are not loaded in steps.

Proposed openab changes

  1. session/new accepts a configurable _meta (at least kiro.settings.workflows.enabled), so a workflow-enabled session can be requested.
  2. Verify agent selection. After set_config_option, compare the returned currentValue with the requested value. If they differ, fail the session instead of continuing as vibe. Applies to every [pool] default_config_options entry.
  3. Filter notifications by params.sessionId. classify_notification (protocol.rs) reads params.update only, so step-session chunks would be appended to the parent's reply.
  4. Keep reading after the prompt response, for the late workflow summary, and route it to the right thread. Frames after the response today go only to the current subscriber, so they are dropped or leak into the next prompt.

Also needed outside openab core: a v3 variant of any launcher that writes ~/.kiro/agents/<name>.md instead of the JSON agent and that does not require --agent in args. Pool sizing must account for about 0.5 GB per kiro-cli process.

Suggested config for a v3 bot (needs changes 1-4 first, plus an <agent>.md file and an empty ~/.kiro/settings/mcp.json):

[agent]
args = ["acp", "--agent-engine=v3"]

[pool]
default_config_options = { mode = "openab-bot" }

Use Case

  • Moving bots to the v3 engine, which is the default for newer kiro-cli, without silently dropping the agent's tool restrictions.
  • Letting a bot run fixed, reviewed Kiro workflows (for example a planner, coder and reviewer sequence) from a chat thread.

Security notes for workflows: relayed chat text reaches steps as user text (kirodotdev/Kiro#12346, #12325), and steps run shell commands that openab auto-approves. Only fixed, reviewed workflow files should be allowed.

Related upstream issues in kirodotdev/Kiro: #11857 (workflow result queued behind a busy turn is lost), #11863 (answers to a paused step), #12273 (custom agent resources not loaded in steps), #11715 (custom agents must be registered), #11281 (non-interactive v3 sends no _meta.kiro capabilities), #12278 (v3 engine exits when stdin is idle 15 s), #11876 (enabling workflows drops built-in agents from the list).

Activity

  1. chaodu-agent commented on Nov 24, 2026

    @chaodu-agent
    CollaboratorAuthor

    Closing as completed by #1609 (merged in 406fada), which implements all four proposed openab changes as opt-in settings:

    1. [agent] session_new_meta is sent as _meta in session/new, so a workflow-enabled session can be requested.
    2. [pool] strict_default_config_options compares the returned currentValue with the requested value and fails session creation on a mismatch.
    3. With workflows enabled, session/update frames are filtered by params.sessionId; permission requests from step sessions are still answered.
    4. Late workflow output after the session/prompt response is relayed to the thread by a bounded tail task.

    Setup is documented in docs/kiro-v3.md.

    Remaining items: session/load resume and a v3 agent launcher outside openab core are tracked in #1619; an end-to-end check against kiro-cli 3.x is tracked in #1620.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions