Skip to content

[Phase 4] Kilocode Engine Adapter (VS Code Extension Protocol) #417

@frankbria

Description

@frankbria

Summary

Implement an AgentAdapter for Kilocode, the open-source AI coding assistant (fork of Roo Code/Cline), allowing CodeFrame to delegate code writing to Kilocode's capabilities.

Parent issue: #408

Motivation

Kilocode (open-source fork of Roo Code) provides sophisticated AI coding assistance with strong multi-model support and tool use capabilities. It has a growing ecosystem and community. Adding it as an engine option gives CodeFrame users access to its capabilities while CodeFrame handles orchestration.

Scope

New module: core/engines/kilocode.py

  1. KilocodeAdapter implementing AgentAdapter:
class KilocodeAdapter:
    name = "kilocode"
    requires_api_key = {}  # Kilocode manages its own API keys
    
    def execute(self, task_prompt, workspace_path, context, timeout_ms):
        # 1. Determine Kilocode's CLI/API interface
        #    (may need to use its programmatic API or CLI mode)
        # 2. Pass task prompt and workspace context
        # 3. Monitor execution
        # 4. Parse results into AgentResult
        ...
  1. Integration approach (to be determined during implementation):

    • Option A: If Kilocode has a CLI/headless mode, launch as subprocess
    • Option B: If Kilocode exposes an API, call it directly
    • Option C: If only VS Code extension, may need to interface via its extension protocol or wait for a CLI release
  2. Output parsing:

    • Detect modified files via git diff after execution
    • Map Kilocode's output to AgentResult
  3. Configuration:

    • kilocode_path: path to Kilocode binary/server
    • kilocode_model: LLM model override
    • kilocode_flags: additional configuration

Research Needed

  • Determine Kilocode's non-interactive/programmatic interface
  • Identify if CLI mode exists or if extension protocol is needed
  • Determine how to pass task context and receive results

Acceptance Criteria

  • KilocodeAdapter implements AgentAdapter protocol
  • Kilocode invoked with correct workspace context
  • Task prompt passed via appropriate mechanism
  • Timeout enforced
  • Modified files detected
  • Works with cf work start <id> --execute --engine kilocode
  • Integration test with mock interface

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions