Skip to content

feat(backend): add Kilo CLI as backend provider - #161

Merged
claudiusthebot merged 1 commit into
dylanneve1:mainfrom
PawiX25:kilo-backend-pr
May 14, 2026
Merged

feat(backend): add Kilo CLI as backend provider#161
claudiusthebot merged 1 commit into
dylanneve1:mainfrom
PawiX25:kilo-backend-pr

Conversation

@PawiX25

@PawiX25 PawiX25 commented May 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a Kilo CLI backend selectable via "backend": "kilo" in
~/.talon/talon.json. Spawns kilo serve --hostname 127.0.0.1 --port 4097
via cross-spawn; talks to it over the @kilocode/sdk v2 client. Mirrors
the existing OpenCode backend in shape: lifecycle management, session
handling, model catalog with provider routing, MCP server registration.

What's included

src/backend/kilo/ — 6 files, ~2050 LOC

  • index.ts — exports + initKiloAgent / stopKiloServer entry points.
  • server.ts — server process spawn, MCP server registration,
    tool overrides, plugin MCP propagation.
  • handler.ts — query handler: stream events, tool-use propagation,
    end-turn detection.
  • sessions.ts — per-chat session state, message accumulation,
    tool-call mapping.
  • model-provider.tsresolveModel, getModelInfo,
    getSettingsPresentation, getProviders, listModels — plugs
    into the QueryBackend abstraction in core/types.ts.
  • models.ts — model catalog (~758 LOC) with provider routing,
    bucket priority, normalized lookup, query parsing.

Wire-up

  • src/bootstrap.ts — adds Kilo branch in initBackendAndDispatcher.
  • src/util/config.ts"kilo" added to backend enum.
  • package.json — adds @kilocode/sdk@^7.2.22; lockfile regenerated.

Configuration example

{
  "backend": "kilo",
  "model": "anthropic/claude-sonnet-4-5"
}

Talon will spawn kilo serve on localhost:4097 and route queries
through it. Models are resolved against the Kilo catalog with the
same provider/model semantics as OpenCode.

Out of scope (future work)

  • Kilo-specific tool-output renderers (currently shared with
    OpenCode rendering path).

Adds a Kilo CLI backend selectable via `"backend": "kilo"` in
~/.talon/talon.json. Spawns `kilo serve --hostname 127.0.0.1 --port 4097`
via cross-spawn; talks to it over the @kilocode/sdk v2 client. Mirrors
the existing OpenCode backend in shape: lifecycle management, session
handling, model catalog with provider routing, MCP server registration.

`src/backend/kilo/` (6 files, ~2050 LOC):
- index.ts          exports + initKiloAgent / stopKiloServer
- server.ts         server process spawn, MCP server registration,
                    tool overrides, plugin MCP propagation
- handler.ts        query handler: stream events, tool-use propagation,
                    end-turn detection
- sessions.ts       per-chat session state, message accumulation,
                    tool-call mapping
- model-provider.ts resolveModel, getModelInfo, getSettingsPresentation,
                    getProviders, listModels — pluggable into the
                    backend abstraction in core/types.ts
- models.ts         model catalog (~758 LOC) with provider routing,
                    bucket priority, normalized lookup, query parsing

Wire-up:
- src/bootstrap.ts  + Kilo branch in initBackendAndDispatcher
- src/util/config.ts  `"kilo"` added to backend enum
- package.json     + @kilocode/sdk@^7.2.22; lockfile regenerated
@PawiX25
PawiX25 requested a review from dylanneve1 as a code owner May 13, 2026 23:40
@claudiusthebot

Copy link
Copy Markdown
Collaborator

Drive-by CI note (not a maintainer, just observing) — second PR from this contributor in ~18 minutes (after #160). This one is fully green on first push: 21/22 jobs green, 1 skipped (Auto-Merge, expected behavior).

All passing: Tests on ubuntu × {Node 22, 24} / macOS × Node 22 / windows × Node 22; Functional + Integration on all 3 OSes; Docker Build; Tarball; CodeQL; Dependency Review; Secret Scan; Lockfile Portability; Security Audit; Fuzz Testing; Code Quality.

The combined-status rollup may show "pending" — that's the legacy commit-status API not reflecting check-runs (same surface oddity as #160). The check-runs view is the source of truth.

No CI noise to clear — substantive review on whether Kilo is a path Talon wants is Dylan's call.

— Talon (heartbeat instance)

@dylanneve1 dylanneve1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thanks

@claudiusthebot
claudiusthebot merged commit 9263611 into dylanneve1:main May 14, 2026
22 checks passed
claudiusthebot added a commit that referenced this pull request May 15, 2026
The README hadn't kept pace with what landed across PRs #96, #160, #161,
#165, #169, #170, and #172:

- Kilo and OpenCode backends were missing or misrepresented (the badge
  still said "Claude Agent SDK", the backend config row listed only
  claude/opencode, the architecture tree didn't mention kilo,
  remote-server, or shared).
- Discord frontend (PR #160) was absent from every list.
- Triggers (PR #96) were absent from the features table.
- Test count was stale at "1300+" — the suite is now 2200+ across the
  unit / SDK-stub / MCP-functional / integration tiers.
- Prerequisites assumed a single backend (Claude CLI on PATH).

Changes:

- New "Backends" section explaining the three options + their transport
  shape + shared remote-server infrastructure.
- Backends badge replaces the Claude Agent SDK badge.
- Features table: dedicated "Pluggable backend" row, new "Triggers"
  row, MCP tools row mentions triggers.
- Architecture tree refreshed: backend/registry.ts, backend/shared/,
  backend/remote-server/, kilo/, plus discord/ under frontend.
- Backend-specific prerequisites called out under Quick Start.
- Dependency rule paragraph mentions the QueryBackend interface.
- Config table: backend accepts claude/kilo/opencode, frontend accepts
  discord, model description is backend-agnostic.
- Development: test count updated to 2200+ across the tier matrix,
  added `npm run format`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants