feat(kiro): add Kiro ACP provider with agent picker, /agent command, Opus 4.7#1
Merged
Conversation
…, 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>
fe31445 to
1012bdb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-acpwill be rebased onto upstreammainwhenever pingdotgg/t3code ships changes.session/update, RPC-response turn end.kiro-cli agent list) + per-modelagentOptionssurfaced in TraitsPicker.--agentis a spawn-time flag, sosendTurnrespawns the child when the selected agent changes./agentslash command opens the TraitsPicker (mirrors/model), gated on whether the current model exposesagentOptions.closeOnClick).opusalias maps here).kiro-cli login); adapter skips ACPauthenticatebecauseinitializereturns emptyauthMethods._kiro.dev/commands/availableruntime-patches slash commands;_kiro.dev/metadatasurfaces context window usage.Hidden traps documented in PATCH.md
ProviderKindarrays incomposerDraftStore.tsall need"kiro"— missing any produces a silent model-selection revert.normalizeProviderModelOptionsWithCapabilitiesswitch needscase "kiro"— missing it silently strips{ agent }on dispatch. This PR adds the case and 4 unit tests.authMethodIdmade optional — Kiro returns emptyauthMethods; per spec clients must skipauthenticate._kiro.dev/*ext requests must return JSON-RPC error-32601.mcpServers: []required insession/new.Test plan
bun typecheck— 10/10 packages greenvitest run src/provider/Layers/KiroAdapter.integration.test.ts— 8/8 passbun test src/model.test.tsinpackages/shared— 29/29 pass/agent→ TraitsPicker opens/triggers slash commands and MCP prompts populateFork maintenance
See
PATCH.mdfor sync workflow, conflict zones, verification checklist.docs/KIRO.mdcovers Kiro ACP protocol notes.