Skip to content

feat(kilocode): native SDD orchestration with Kilo Gateway model routing #851

@statick88

Description

@statick88

Problem

Kilo Code's integration in Gentle-AI uses the same OpenCode-compatible overlay format (opencode.json with "mode": "primary" for the orchestrator), which causes issue #729: "gentle-orchestrator is a primary agent and cannot be used as a subagent."

Additionally, the current integration doesn't leverage:

  • Kilo Code's native .kilo/agents/*.md sub-agent file format
  • Kilo Gateway's free model routing for per-phase model assignment
  • kilo.jsonc for provider configuration

Proposed Solution

Replace the OpenCode overlay approach for Kilo Code with native agent files, following the same pattern used for Cursor (.cursor/agents/), Kiro (.kiro/agents/), and Kimi (.kimi/agents/).

Changes

  1. Native Agent Files: Generate .kilo/agents/sdd-*.md files with YAML frontmatter instead of relying on opencode.json overlay
  2. Model Routing: Add KiloModelAlias type with per-phase model assignment via Kilo Gateway
  3. Provider Config: Generate kilo.jsonc with Kilo Gateway provider settings
  4. Verification: Add post-injection verification for Kilo Code (currently only runs for OpenCode)

Files Changed

File Change
internal/model/kilo_model.go NEW — KiloModelAlias type, model resolver
internal/agents/kilocode/adapter.go MODIFIED — Enable SupportsSubAgents, add SubAgentsDir
internal/assets/kilocode/agents/*.md NEW — 10 SDD phase agent templates
internal/components/sdd/inject.go MODIFIED — Kilo-specific injection path
internal/components/kilojsonc/kilojsonc.go NEW — kilo.jsonc generation
internal/model/kilo_model_test.go NEW — Model unit tests
internal/agents/kilocode/adapter_test.go MODIFIED — Adapter capability tests
internal/components/sdd/inject_test.go MODIFIED — Kilo integration tests

Test Results

All tests pass (go test ./...), go vet clean. 10 new Kilo-specific tests added.

Known Limitations

  • Profile Detection: ~/.config/kilo/profiles/ detection not implemented in this PR (additive feature, non-blocking)
  • Backward Compatible: Existing opencode.json overlay is preserved as fallback

Related Issues

Checklist

  • Tests pass (go test ./...)
  • go vet clean
  • No breaking changes to OpenCode adapter
  • Documentation updated (agents.md)

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:approvedApproved for implementation — PRs can now be openedtype:featureNew feature

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions