Skip to content

feat(adapters): add Kilo adapter (kilocode, an OpenCode fork) - #755

Closed
halisyilboga wants to merge 1 commit into
bmad-code-org:mainfrom
halisyilboga:feat/kilo-adapter
Closed

feat(adapters): add Kilo adapter (kilocode, an OpenCode fork)#755
halisyilboga wants to merge 1 commit into
bmad-code-org:mainfrom
halisyilboga:feat/kilo-adapter

Conversation

@halisyilboga

Copy link
Copy Markdown

Summary

Adds the Kilo coding CLI (kilocode — an OpenCode fork, v7.5.5) as a first-class bundled adapter, beside opencode-http.

Kilo is driven over its local HTTP/SSE server exactly like OpenCode:

  • New bundled kilo-http adapter kind → KiloHttpAdapter/KiloDevAdapter (subclass the opencode_http family)
  • Bundled kilo profile: binary = "kilo", adapter = "kilo-http", hookless, skills in .claude/skills/, model as provider/model
  • Registry constant + builtin registration; tests pin the kilo deltas and update the bundled kind/profile-set expectations

The fork differs from OpenCode in exactly two facts the adapter overrides:

  1. It reads KILO_* env vars (KILO_SERVER_PASSWORD, KILO_CONFIG_CONTENT, KILO_DISABLE_EXTERNAL_SKILLS), not OPENCODE_* — verified: with OPENCODE_SERVER_PASSWORD set, kilo serve still warns "KILO_SERVER_PASSWORD is not set; server is unsecured".
  2. Its server basic-auth username is kilo, not opencode — 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

Verification

  • uv run pytest tests/test_kilo_http.py tests/test_profile.py tests/test_adapter_registry.py — all pass
  • uv run pyright on changed files — clean
  • trunk check on changed files — no issues
  • Live smoke test against kilo serve (auth username + KILO_* env injection) — confirmed

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.
Copilot AI lite review requested due to automatic review settings September 1, 2026 16:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 / KiloDevAdapter and registers new bundled adapter kind kilo-http.
  • Adds the bundled kilo profile (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.

Comment on lines 64 to +71
# 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"
Comment thread src/bmad_loop/cli.py
Comment on lines 4702 to +4703
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)",
Comment thread tests/test_kilo_http.py
Comment on lines +16 to +20
from pathlib import Path

import pytest

from bmad_loop.adapters import kilo_http
@pbean

pbean commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

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 pbean closed this Sep 1, 2026
@halisyilboga

Copy link
Copy Markdown
Author

@pbean can I implement cursor adapter then

@halisyilboga

Copy link
Copy Markdown
Author

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 kilo-http adapter kind + kilo profile through the documented out-of-tree seams. Happy to help with the adapter-authoring seams themselves if that would help others do the same. Thanks again for the review.

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