fix(engines): drop the non-existent run subcommand from the kilocode invocation (#1012) - #1013
Conversation
…e invocation (#1012) `KilocodeAdapter` built `kilo run <prompt> --auto --workspace <path>`, but there is no `run` subcommand. Verified against kilocode 0.22.0, whose usage is `kilocode [options] [command] [prompt]` with commands auth/config/debug/models only — so `run` was swallowed as the prompt, `--auto` never took effect, and the CLI opened its interactive TUI and hung until the adapter's timeout, writing nothing. `--engine kilocode` could not do any work at all. Reproduced both directions against the real binary: kilo run "Create kilo_probe.txt ..." --auto -w $D -> exit 124, TUI banner, no file kilo "Create kilo_probe.txt ..." --auto -w $D -> exit 0, "Task Completed", file written Also sets require_file_changes=True: the TUI path could exit 0 having written nothing, and gates would then pass on an unchanged tree (the #739/#913 class). The unit test asserted `cmd[1] == "run"` — pinning the bug rather than the CLI's contract. It now asserts the prompt is the leading positional, and a new binary-gated smoke tier drives the adapter's own build_command against the installed kilo: it writes a real file, a no-work run is not reported completed, and the old invocation is pinned as hanging-and-writing-nothing.
…ary-gated (#1012) codex review [P2]: gating only on shutil.which meant a plain `uv run pytest` on any machine with the CLI installed would start driving real kilocode (and, pre-existing from #913, real opencode) sessions — real credentials, real model calls, real money, 20-240s each — making the default suite depend on network and live agent behaviour. Both smoke files now also require CODEFRAME_ENGINE_SMOKE=1. Verified both directions: default run is 202 passed / 9 skipped in 2.3s (was 53s of real model calls); CODEFRAME_ENGINE_SMOKE=1 runs all 5 kilocode smoke tests against the real binary in 54s. The workflow that sets this for the scheduled tier is #915's scope.
|
Claude finished @frankbria's task in 3m 32s —— View job GLM precision review — no defects foundScoped to concrete defects only (logic errors, null/unhandled error paths, security, data loss, contract breaks, resource leaks). Style, architecture, naming, and test coverage are handled by a separate general-purpose review and intentionally not commented on here. What I verified against the checked-out code
No findings to report. |
|
✅ GLM review: no defects found. Scoped to concrete defects (logic errors, unhandled error paths, security, data loss, contract breaks, resource leaks). Traced the kilocode invocation fix and the |
Closes #1012.
Problem
KilocodeAdapter.build_commandbuiltkilo run <prompt> --auto --workspace <path>. There is norunsubcommand. Verified against kilocode 0.22.0: usage iskilocode [options] [command] [prompt]and the only commands areauth,config,debug,models— the prompt is a bare positional.So
runwas swallowed as the prompt, the real prompt became a stray argument,--autonever took effect, and the CLI opened its interactive TUI and hung until the adapter's timeout, writing nothing.--engine kilocodecould not do any work at all.This is the third shipped engine with an invented invocation, after #913 (opencode's non-existent
--non-interactive) and #914 (codex's invented app-server protocol). Found while building the binary-gated tier for #915 — which is exactly what that tier is for.Evidence — reproduced live, both directions
Broken (exactly what the adapter built):
Working (identical, minus the bogus subcommand):
--workspaceis honoured, so unlike #1007 there is no cwd problem here — only the invented subcommand.Changes
The invocation —
runremoved; the prompt is the leading positional.require_file_changes=True— the TUI path could exit 0 having written nothing, and gates would then run on an unchanged tree with the task markable DONE. Same guard claude-code got in #739/#819 and opencode in #913.KilocodeAdapterwas the last shipped coding-agent adapter without it.The unit test was pinning the bug. It asserted
cmd[1] == "run"— i.e. that the adapter agrees with itself. It now asserts the prompt is the leading positional and thatrunis absent, so restoring the bug fails the suite.A binary-gated smoke tier (
test_kilocode_smoke_1012.py) runs the adapter's ownbuild_commandoutput against the installedkilo:kilo --helplists noruncommand — asserted against the CLI's own help, so it fails if kilocode ever adds one and the adapter needs revisitingcompletedDemo — real binary
The file on disk is the outcome evidence: the adapter drove real kilocode to completion and the delegated agent wrote real code.
Review
codex review --base main(cross-family, pre-PR) raised one [P2]: gating the smoke tests onshutil.whichalone meant a plainuv run pyteston any machine with the CLI installed would start making real model calls — real credentials, real money, network-dependent flakiness.Confirmed and fixed in 2d8937f: both smoke files now also require
CODEFRAME_ENGINE_SMOKE=1. I applied it to the pre-existing opencode smoke file too, since it had the same defect. Verified both directions:Tests
tests/core/adapters/— 202 passed, 9 skipped (default); +5 real-binary tests under the opt-in flag.ruff checkclean.Known limitations
CODEFRAME_ENGINE_SMOKE=1on a schedule with the binaries installed is [P0.21] Run every shipped engine adapter against its real CLI in a binary-gated smoke/contract tier #915 (P0.21), which this unblocks — its AC1 requires driving a task to a terminal state per engine, which kilocode could not do before this.opencode runand require file changes for the OpenCode engine #913 addressed for opencode (macOS caps at 256 KB; Linux at 128 KB per argument). The existing docstring notes it. kilocode has no documented stdin path to fall back to, so unlike opencode there is no fix available here — flagging rather than silently leaving it undocumented.