Make the agent CLI a port: Claude Code as one adapter, add Kilo & OpenCode#20
Merged
Conversation
…nCode Extracts an AgentCliPort (issue #19). The core now computes a neutral LaunchIntent (baseUrl, credential, per-tier models, skipPermissions, extendedContext) and each agent adapter lowers it into its own CLI. - Claude Code becomes the reference adapter; its ANTHROPIC_*/CLAUDE_CODE_* lowering, the [1m] suffix, compat flags, auto-compact and binary spec move out of core/ into src/adapters/agents/claude-code/. - New Kilo (@kilocode/cli) and OpenCode (opencode-ai) adapters reach the same provider presets over the Anthropic transport, lowering the intent into an inline config (KILO_CONFIG_CONTENT / OPENCODE_CONFIG_CONTENT) + args; no file is written. Capability gaps (tiers, [1m]) warn, never silently drop. - Selectable via profile.agent, 'swisscode config agent', and --cc-agent. - Per-adapter binary resolution keeps the self-alias/recursion guard; execve stays the launch mechanism. golden.test.ts proves the Claude Code env plan is byte-identical; a new architecture test bans ANTHROPIC_*/CLAUDE_CODE_* literals from core/ and ports/. 475 tests green, typecheck clean.
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.
Closes #19.
Extracts an
AgentCliPortso the agent CLI is pluggable the way providers already are. The core computes a neutralLaunchIntent(baseUrl, credential, per-tier models, skipPermissions, extendedContext) and each adapter lowers it into its own CLI.What changed
ANTHROPIC_*/CLAUDE_CODE_*env building, the[1m]suffix, compat flags, auto-compact and binary spec moved out ofcore/intosrc/adapters/agents/claude-code/.@kilocode/cli) and OpenCode (opencode-ai) adapters reach the existing provider presets over the Anthropic transport (@ai-sdk/anthropic), lowering the intent into an inline config (KILO_CONFIG_CONTENT/OPENCODE_CONFIG_CONTENT) + args — no file written. Capability gaps (4 tiers → 1 slot,[1m]) warn on stderr, never silently drop.profile.agent,swisscode config agent <profile> <id>, and--cc-agent <id>.execvestays the launch mechanism.Verification
golden.test.tsproves the Claude Code env plan is byte-identical — existing launches are unchanged.ANTHROPIC_*/CLAUDE_CODE_*literals fromcore/andports/.Caveat
Kilo/OpenCode config schemas match their documented patterns but aren't confirmed against a live install; every uncertain string is behind a single named constant with a test, so a fix is one line.
Follow-up (not in this PR)
The setup wizard's agent-step was deferred — selection works via
config agent/--cc-agent.