feat(adapters): add Kilo adapter (kilocode, an OpenCode fork) - #755
feat(adapters): add Kilo adapter (kilocode, an OpenCode fork)#755halisyilboga wants to merge 1 commit into
Conversation
Drive the Kilo CLI over its local HTTP/SSE server, exactly like the bundled opencode-http family but targeting the Kilo binary: - new bundled 'kilo-http' adapter kind + KiloHttpAdapter/KiloDevAdapter (subclass opencode_http) overriding the two facts the fork renames: KILO_* env vars instead of OPENCODE_*, and the 'kilo' basic-auth username - bundled 'kilo' profile (binary=kilo, adapter=kilo-http, hookless, skills in .claude/skills); env_fault_patterns intentionally unseeded pending a captured kilo outage line - registry constant + builtin registration; tests pin the kilo deltas and the updated builtin kind/profile sets - docs (setup guide --cli list, adapter-authoring adapter field, README supported table, CLI help) + CHANGELOG Verified endpoint/auth parity live against kilo 7.5.5.
There was a problem hiding this comment.
Pull request overview
Adds a new first-class Kilo coding-CLI integration to bmad-loop by reusing the existing OpenCode HTTP/SSE adapter family and packaging it as a new bundled adapter kind (kilo-http) plus a bundled profile (kilo), with tests and documentation updated accordingly.
Changes:
- Introduces
KiloHttpAdapter/KiloDevAdapterand registers new bundled adapter kindkilo-http. - Adds the bundled
kiloprofile (src/bmad_loop/data/profiles/kilo.toml) and updates docs/README/CHANGELOG to document the new CLI. - Adds focused unit tests and updates registry/profile tests to pin the new kind/profile behavior.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_profile.py | Updates built-in profile expectations to include kilo as hookless and inert for env-fault patterns. |
| tests/test_kilo_http.py | New unit tests covering Kilo’s two deltas (KILO_* env vars + kilo basic-auth user) and bundled registration. |
| tests/test_adapter_registry.py | Extends registry tests to include the new bundled adapter kind constant and ordering. |
| src/bmad_loop/data/profiles/kilo.toml | New bundled kilo profile selecting kilo-http, hookless, .claude/skills, usage parser none. |
| src/bmad_loop/cli.py | Updates CLI help text to list kilo as an init-able profile and notes probe limitations. |
| src/bmad_loop/adapters/registry.py | Adds KILO_HTTP constant and registers the new built-in kind via a lazy builder thunk. |
| src/bmad_loop/adapters/kilo_http.py | New adapter implementation subclassing OpenCode HTTP/SSE adapter and overriding env/auth specifics. |
| README.md | Documents kilo alongside other supported CLIs. |
| docs/setup-guide.md | Updates init/setup instructions to include kilo and clarifies hookless behavior. |
| docs/adapter-authoring-guide.md | Documents kilo-http as a bundled HTTP/SSE adapter kind alongside opencode-http. |
| CHANGELOG.md | Adds an “Added” entry describing the new Kilo adapter/profile/kind. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # The two bundled kind names, as constants rather than literals scattered across | ||
| # modules. `validate`'s httpx check keys on OPENCODE_HTTP because httpx is *that | ||
| # family's* optional extra — a fact about one bundled family, which is a different | ||
| # thing from the set of VALID kinds (that set is only ever `known_adapter_kinds()`, | ||
| # never a literal). GENERIC is the `profile.adapter` default. | ||
| GENERIC = "generic" | ||
| OPENCODE_HTTP = "opencode-http" | ||
| KILO_HTTP = "kilo-http" |
| help="CLI profile name (claude | codex | gemini | copilot | antigravity | custom; " | ||
| "opencode-http is HTTP-driven — nothing to probe)", | ||
| "opencode-http and kilo-http are HTTP-driven — nothing to probe)", |
| from pathlib import Path | ||
|
|
||
| import pytest | ||
|
|
||
| from bmad_loop.adapters import kilo_http |
|
Thank you for taking the time to write this pr. Unfortunately we aren't adding kilocode as an adapter in the official repo at this time. The only remaining upcoming one will be cursor. We will continue to build seams to help everyone use our adapter guide to implement other adapters as well though so always appreciate any needed contributions in that direction. You have done a great job though and I recommend publishing it on your own repo and let the discord server know you have created it for anyone thats interested. either in bmad-loop or community-modules-expansions channel. |
|
@pbean can I implement cursor adapter then |
|
Following up on the feedback above: I've published this as a standalone community plugin (kilo-adapter only, no core edits) here: https://github.com/halisyilboga/bmad-loop-adapter-kilo It registers a |
Summary
Adds the Kilo coding CLI (
kilocode— an OpenCode fork, v7.5.5) as a first-class bundled adapter, besideopencode-http.Kilo is driven over its local HTTP/SSE server exactly like OpenCode:
kilo-httpadapter kind →KiloHttpAdapter/KiloDevAdapter(subclass theopencode_httpfamily)kiloprofile:binary = "kilo",adapter = "kilo-http", hookless, skills in.claude/skills/,modelasprovider/modelThe fork differs from OpenCode in exactly two facts the adapter overrides:
KILO_*env vars (KILO_SERVER_PASSWORD,KILO_CONFIG_CONTENT,KILO_DISABLE_EXTERNAL_SKILLS), notOPENCODE_*— verified: withOPENCODE_SERVER_PASSWORDset,kilo servestill warns "KILO_SERVER_PASSWORD is not set; server is unsecured".kilo, notopencode— verified:-u kilo:<pw>authenticates,-u opencode:<pw>401s.Everything else — the HTTP/SSE surface (
/global/health,/session,/prompt_async,/event,/session/status,/abort), SSE frame shapes, and usage schema — is byte-identical to OpenCode (verified live against 7.5.5).Notes
env_fault_patternsare intentionally unseeded forkilo— no captured kilo outage line exists yet, and this repo's bar is "seed only from a captured line, never from a plausible string" (claude.toml's env_fault pattern false-positives on ordinary prose — including this repo's own CHANGELOG and docs #507, Provider usage-limit / quota errors are not classified as environment faults — the loop burns retries and defers healthy stories #323). Leaving it inert is the honest default; it can be seeded from a real captured kilo outage line later.[opencode]extra supplies httpx. Auth once withkilo auth login.Verification
uv run pytest tests/test_kilo_http.py tests/test_profile.py tests/test_adapter_registry.py— all passuv run pyrighton changed files — cleantrunk checkon changed files — no issueskilo serve(auth username + KILO_* env injection) — confirmed