Skip to content

feat(kiro): add Kiro ACP provider with agent picker, /agent command, Opus 4.7#1

Merged
hrishikeshmane merged 1 commit into
mainfrom
kiro-acp
Apr 20, 2026
Merged

feat(kiro): add Kiro ACP provider with agent picker, /agent command, Opus 4.7#1
hrishikeshmane merged 1 commit into
mainfrom
kiro-acp

Conversation

@hrishikeshmane
Copy link
Copy Markdown
Owner

@hrishikeshmane hrishikeshmane commented Apr 20, 2026

Summary

Adds Kiro (Amazon CLI speaking ACP over stdio) as a first-class ACP provider layered on top of upstream's shared ACP infrastructure (pingdotgg#1355). This is the canonical Kiro patch carried by this fork — kiro-acp will be rebased onto upstream main whenever pingdotgg/t3code ships changes.

  • Full ACP lifecycle: initialize → session/new → session/prompt/cancel, streaming session/update, RPC-response turn end.
  • Agent discovery (kiro-cli agent list) + per-model agentOptions surfaced in TraitsPicker. --agent is a spawn-time flag, so sendTurn respawns the child when the selected agent changes.
  • /agent slash command opens the TraitsPicker (mirrors /model), gated on whether the current model exposes agentOptions.
  • TraitsPicker closes on agent selection (closeOnClick).
  • Opus 4.7 added to built-in Kiro models (opus alias maps here).
  • OIDC auth (out-of-band via kiro-cli login); adapter skips ACP authenticate because initialize returns empty authMethods.
  • _kiro.dev/commands/available runtime-patches slash commands; _kiro.dev/metadata surfaces context window usage.

Hidden traps documented in PATCH.md

  • Three hardcoded ProviderKind arrays in composerDraftStore.ts all need "kiro" — missing any produces a silent model-selection revert.
  • normalizeProviderModelOptionsWithCapabilities switch needs case "kiro" — missing it silently strips { agent } on dispatch. This PR adds the case and 4 unit tests.
  • ACP authMethodId made optional — Kiro returns empty authMethods; per spec clients must skip authenticate.
  • Unknown _kiro.dev/* ext requests must return JSON-RPC error -32601.
  • mcpServers: [] required in session/new.

Test plan

  • bun typecheck — 10/10 packages green
  • vitest run src/provider/Layers/KiroAdapter.integration.test.ts — 8/8 pass
  • bun test src/model.test.ts in packages/shared — 29/29 pass
  • Manual: pair, enable Kiro, select non-default agent, confirm kiro-cli reports selected agent (not kiro_default)
  • Manual: type /agent → TraitsPicker opens
  • Manual: / triggers slash commands and MCP prompts populate

Fork maintenance

See PATCH.md for sync workflow, conflict zones, verification checklist. docs/KIRO.md covers Kiro ACP protocol notes.

@github-actions github-actions Bot added size:XXL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Apr 20, 2026
…, and Opus 4.7

Adds Kiro as a first-class ACP provider layered on top of upstream's shared ACP
infrastructure (PR pingdotgg#1355). Kiro is an Amazon CLI (`kiro-cli acp`) speaking the
Agent Communication Protocol over stdio; authentication is OIDC via
`kiro-cli login` (out-of-band).

Highlights:

- Full ACP lifecycle: initialize → session/new → session/prompt/cancel, with
  streaming `session/update` notifications and `{stopReason: "end_turn"}` turn
  end via RPC response.
- Agent discovery via `kiro-cli agent list`, cached at `~/.t3/caches/kiro.json`
  and surfaced through `ModelCapabilities.agentOptions`. Agents are a spawn-time
  CLI flag (`--agent <name>`) so `sendTurn` respawns the child process when the
  selected agent changes mid-session.
- `/agent` slash command opens the TraitsPicker, mirroring `/model`. Gated on
  whether the current model exposes `agentOptions`.
- TraitsPicker now closes on agent selection (`closeOnClick` MenuRadioItem).
- `normalizeProviderModelOptionsWithCapabilities` gains a `case "kiro"` —
  previously the kiro dispatch path dropped `{ agent }` silently because the
  switch fell through to `undefined`, so the server never received the agent
  selection even though the composer store held it.
- `_kiro.dev/commands/available` notifications runtime-patch slash commands;
  `_kiro.dev/metadata` surfaces context window usage.
- Built-in Kiro models include Opus 4.7 (aliased as `opus`), Sonnet 4.6, Haiku
  4.5, Deepseek 3.2.

Hidden traps documented in PATCH.md:

- Three hardcoded ProviderKind arrays in `composerDraftStore.ts` all need
  `"kiro"` or model selection silently reverts to previous provider.
- `normalizeProviderModelOptionsWithCapabilities` switch needs an explicit
  `case "kiro"` or agent selection never reaches the server.
- ACP `authMethodId` is made optional: Kiro returns empty `authMethods` and per
  spec the client must skip `authenticate`.
- `_kiro.dev/*` ext requests the adapter doesn't handle must return JSON-RPC
  error `-32601` (not empty-object success).
- `mcpServers: []` is required in `session/new`; omission exits kiro-cli
  silently.

Test coverage:

- `KiroAdapter.integration.test.ts` — 8 tests covering start/stop/listSessions,
  streaming, runtime events, agent flag propagation, respawn on agent change.
- `KiroAdapter.parsing.test.ts` — ACP message parsing.
- `packages/shared/src/model.test.ts` — 4 new tests for `normalizeKiro*` and
  provider-switch wiring.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@hrishikeshmane hrishikeshmane merged commit 128f8f0 into main Apr 20, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant