Repository navigation
Description
Update 2026-11-26 (infra move): adding the Kilo CLI to the devtools image is a follow-up issue in dan-petty/devtools.
- The image does not ship it today.
- This issue keeps the engine adapter, the setting, the
RUNNER_TOOLSentry and the report. The live trial waits on the new image.
Follow-up: dan-petty/devtools#98.
Problem or Motivation
Experiment 1 of #6519 has its measure for stage: on stock Coder, 19 of 30 graded attempts pass (0.63, grade 60), one success costs 26.8 M tokens and 6,569 seconds, and no success is a first pass (comment of 2026-11-26 on #6519). The action of the grade 60 is "Look for implementation alternatives, or serious defects that a fix can correct". #6519 names Experiment 2 for this: an open harness (Kilo CLI, OpenCode or pax) behind the same Job contract, measured on the same cases. No item holds that work.
Owner, 2026-11-20: Kilo Code with DeepSeek, Antigravity and the Claude harness "generate working plans 100% of the time in my devcontainer environment", and "the devops cli should be modular and custom code should be regularly swapped for robust open implemenation alternatives".
Proposed Solution
Disposition: change the code, as a measured trial.
- The agent phase of the stage Job gets a second engine behind the contract that exists (
prepare, then the agent, thenpublish): the engine reads the run folder and writes the patch of the change folder, the body candidate andout/outcome.json. The engine is one open harness in its auto mode in the agent container, with the model key only, no App key and no write RBAC. - A setting selects the engine for a share of the attempts. The default is Coder, so the two engines run on live items in the same days.
- The result line names the engine, and
devops roadmap eval gradesshows each engine apart. - Measure: 30 or more graded attempts for each engine, with every attempt counted and the infra share apart. The values are the success ratio, the plans that build (the forge outcome of implement), the first passes, and the tokens and the seconds for each success.
- Decision: the harness replaces the Coder engine of stage when its success is 0.80 or more, or when it is 15 points or more over Coder with no more tokens for each success. Else the change deletes the harness engine, and refactor(roadmap): re-architect stage and implement on Coder #6519 records the result.
Proof: the two grade rows of the trial on #6519, and the decision that follows from the rule above.
Existing Tool Considered
Kilo CLI, OpenCode and pax are the candidates that #6519 names. The first task is the choice of one of them: license, maintenance, a headless auto mode, and a model endpoint that the LiteLLM gateway serves (OpenAI-compatible). The trial adds the second engine behind the contract and no new gate, cap or screen. Cost to build: about 300 lines and 2 days.
Related
- feat(roadmap): trial a model tier on a share of a job's attempts #5177 asks for a trial of a model tier on a share of the attempts of a job, which is the same selection for a model.
- The freeze of chore(roadmap): hold incremental stage and implement work #6521 does not apply: this item is the re-architecture work of refactor(roadmap): re-architect stage and implement on Coder #6519.
Source
Source: #6519
Alternatives check of 2026-12-01: in-use.
The repository already uses this tool.
Tool: Kilo CLI (https://github.com/Kilo-Org/kilocode), MIT, last activity 2026-12-01, maintained.
Reason: Searches found no tool for the whole need. Kilo CLI, the open harness the issue selects, runs headless, but the stage adapter, engine setting, result field and grade rows stay project work.
Covers:
- Headless agent run with kilo run auto
- JSON output and exit codes a Job can read
- OpenAI-compatible provider with an API key
Lacks:
- No stage adapter, engine setting, engine field or grade rows
- Not in the devtools runner image while devtools#98 is open
- Provider base URL and auto approval unproven on the gateway
Proposed design
Problem statement
The stage agent has one engine, and its grade 60 result shows no first pass. This item adds the Kilo CLI engine behind the stage contract, an engine setting, the engine= result field and per-engine grade rows. The RUNNER_TOOLS entry and the live trial wait on dan-petty/devtools#98 and #6814, so this item defers them.
Acceptance criteria
Requirement: Stage engine adapter
The stage agent phase SHALL run the selected engine behind the existing prepare, agent and publish contract.
Scenario: Kilo engine produces the stage artifacts
- WHEN A test runs the stage agent phase with engine
kiloand a fakekiloprogram on PATH that writesout/plan.patch,out/candidate.mdandout/outcome.json. - THEN The publish phase applies the patch, opens the draft pull request with the body candidate, and
tests/roadmap/stage/test_roadmap_stage_engine_kilo.pypasses.
Requirement: Engine selection setting
The stage job SHALL select its engine from roadmap.stage.engine and the share of attempts from roadmap.stage.engine_share.
Scenario: Default engine is Coder
- WHEN
roadmap.stage.engineis unset androadmap.stage.engine_shareis 0, and the stage job runs an item. - THEN The job runs the Coder engine, the result line holds
engine=coder, andtests/roadmap/stage/test_roadmap_stage_job_entry.pyandtests/security/test_config_declarations.pypass.
Requirement: Stable engine share
The engine selector SHALL assign the same engine to the same item and the same stage Job for a given share.
Scenario: Same input returns the same engine
- WHEN The selector receives the same item number and the same stage Job name twice.
- THEN It returns the same engine both times, and
tests/roadmap/stage/test_roadmap_stage_engine.pypasses.
Requirement: Engine in the result line
The stage result line SHALL name the engine that ran the attempt, in a field appended after the existing fields.
Scenario: Result line names Kilo
- WHEN The stage job completes an attempt with the Kilo engine.
- THEN The result line ends with
engine=kilo, the positional fields keep their places, andtests/roadmap/stage/test_roadmap_stage_job_entry.pypasses.
Requirement: Per-engine eval grades
devops roadmap eval grades SHALL show the grade and the trial measures of each engine apart.
Scenario: Two engine rows
- WHEN A test serves result lines of both engines from
LokiFakeand runs the grade report. - THEN The report prints one row for each engine with its grade, success ratio, plans that build, first passes, tokens per success and seconds per success, and
tests/roadmap/test_job_grade_report.pypasses.
Requirement: Kilo credential isolation
The Kilo engine SHALL run with only the model key and MUST refuse the App key and the GitHub token.
Scenario: Kilo process environment
- WHEN A test starts the stage agent phase with the Kilo engine while
DEVOPS_CLI_SERVICE_GITHUB_APP_PRIVATE_KEYor a GitHub token is set in the environment. - THEN The run fails with the existing refused-key error and writes no artifact, and
tests/roadmap/stage/test_roadmap_stage_engine_kilo.pyandtests/roadmap/stage/test_roadmap_stage_agent_phase.pypass.
Requirement: Kilo CLI stays out of the runner tools
The runner tool registry MUST list kilo in NOT_IN_RUNNER with the reason dan-petty/devtools#98 and MUST NOT list it in RUNNER_TOOLS.
Scenario: Registry holds the Kilo exclusion
- WHEN A test reads the runner tool registry.
- THEN The registry holds one
kiloentry inNOT_IN_RUNNERwith that reason, holds nokiloentry inRUNNER_TOOLS, andtests/roadmap/test_roadmap_runner_tools.pypasses.
Existing Tool Considered
OpenCode (anomalyco/opencode) has the verdict partly in the alternatives check of 2026-11-26 in the issue body. That block states what OpenCode covers and lacks. This change supplies the block's Lacks: items with the stage adapter, the engine setting, the engine= field and the grade rows. The issue body update selects the Kilo CLI as the engine under test, and OpenCode stays the fallback. The body estimates about 300 lines and 2 days for the code and gives no token count.
Key questions
- Which open harness does the stage agent engine run?: The Kilo CLI (
@kilocode/cli). The issue body update of 2026-11-26 selects it and namesdan-petty/devtools#98for the image. OpenCode stays the fallback from the alternatives check. (best practice) [sources: openspec/specs/devcontainer-agent-config/spec.md]- Chosen: Kilo CLI. The issue body update selects it, and the owner measured Kilo Code in the same devcontainer.
- Rejected: OpenCode. The alternatives check names it partly and keeps it as fallback, but the body update selects Kilo.
- Rejected: pax. No definition of pax exists in the issue or its documents, so the proposal cannot judge it.
- What contract must the second engine implement?: The existing stage agent phase: read the run folder, write the change patch, the body candidate and
out/outcome.jsonas the typedStageOutcome. The publish phase applies the patch, and the existing refused-key check stays in front of the engine. (best practice) [sources: src/devops_cli/roadmap/stage/stage_job_phases.py, tests/roadmap/stage/test_roadmap_stage_agent_phase.py, docs/ROADMAP_WORKFLOW.md]- Chosen: Thin adapter behind the existing contract. It reuses the phases, the
StageOutcomemodel and the refused-key check. - Rejected: New parallel job contract. It duplicates the phases, the outcome model and the refusal, so the result can drift.
- Chosen: Thin adapter behind the existing contract. It reuses the phases, the
- How does the stage job select the engine for a share of attempts?: Add
roadmap.stage.engine(coderdefault,kilosecond) androadmap.stage.engine_share(0 to 100). The selector hashes the item number and the stage Job name, so one attempt keeps its engine across pod retries and each new Job draws again. (best practice) [sources: src/devops_cli/config/settings.py:1425, src/devops_cli/roadmap/stage/stage_job.py, tests/security/test_config_declarations.py, tests/roadmap/stage/test_roadmap_stage_job_entry.py]- Chosen: Hash of item number and stage Job name. The same attempt keeps its engine on a retry, and a new attempt draws again.
- Rejected: Random choice for each attempt. It makes tests flaky and can change the engine on a retry.
- Rejected: Hash of the item number only. It gives each item one engine, so the comparison mixes the item with the engine.
- How do the result line and the grade report show the engine?:
log_job_resultappends anengine=field at the end of the line, so the positional fields keep their places. The grade report groups the rows ofRESULT_LINESby that field, so each engine gets its own grade and measures from the same Loki query. (best practice) [sources: src/devops_cli/roadmap/job_result.py, src/devops_cli/roadmap/job_grade_report.py:130, src/devops_cli/commands/roadmap_eval_grades.py, tests/roadmap/stage/test_roadmap_stage_job_entry.py]- Chosen: Append the engine field to the result line. One query and one command show both engines apart, and the existing parsers keep their positions.
- Rejected: Separate log stream for each engine. It splits the evidence and makes the selector and the comparison harder.
- How does the proposal handle the Kilo CLI in the runner image while devtools#98 is open?: Do not add a
RUNNER_TOOLSentry. AddkilotoNOT_IN_RUNNERwith the reasondan-petty/devtools#98. Defer theRUNNER_TOOLSentry to a new issue. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py, smoke.Dockerfile:57]- Chosen: List
kiloinNOT_IN_RUNNERand defer theRUNNER_TOOLSentry. The runner image check passes now, and the entry waits for the devtools image. - Rejected: Add the
RUNNER_TOOLSentry now. It failspython -m devops_cli.roadmap.runner_toolswith status 127 untildan-petty/devtools#98ships. - Rejected: Wait for
dan-petty/devtools#98before any code. It blocks the adapter, the setting and the report that can be built and tested offline.
- Chosen: List
- Why does the live two-engine trial wait?: The Service starts the stage Job with no
--phase, sorun_stage_agentdoes not run. The phase containers come with refactor(k8s): run the stage Job as three containers #6814, which is open. The devtools image also lacks the Kilo CLI untildan-petty/devtools#98. Defer the live trial. (best practice) [sources: src/devops_cli/roadmap/stage/stage_submit.py:330, src/devops_cli/commands/roadmap_jobs.py:632, src/devops_cli/roadmap/stage/stage_job_phases.py:5]- Chosen: Defer the live trial. The Service starts no agent phase before refactor(k8s): run the stage Job as three containers #6814, and the image lacks the Kilo CLI before devtools#98.
- Rejected: Build the full item now. No live attempt can start the second engine before refactor(k8s): run the stage Job as three containers #6814.
- Rejected: Wait for both before any code. It blocks the workable adapter, setting, result field and grade rows.
- When does the Kilo engine replace the Coder engine?: Replace Coder when Kilo reaches a success ratio of 0.80 or more, or when it is 15 points or more over Coder with no more tokens for each success. Else delete the Kilo engine and record the result in refactor(roadmap): re-architect stage and implement on Coder #6519. (best practice) [sources: CONTEXT.md, docs/roadmap/job-success.md]
- Chosen: Fixed rule from the issue. It gives a pass or fail condition before the trial, so the result cannot be read to fit the outcome.
- Rejected: Decide after the trial with no rule. It invites a biased decision and gives no testable acceptance.
- Which parts of the Kilo run does the build prove offline?: A fake
kiloon PATH proves the command line, the exit codes, the three artifacts and the refused-key path. The provider base URL and the--autoapproval behaviour wait for the first live attempt after the image ships, and a mismatch stops the trial. (best practice) [sources: src/devops_cli/roadmap/stage/stage_job_phases.py, tests/roadmap/stage/test_roadmap_stage_agent_phase.py]- Chosen: Prove the run contract offline, then the gateway on the first live attempt. The run contract and the refusal are in this repository, and the adapter does not depend on the two open details.
- Rejected: Hold the build for a written proof of the provider key and
--auto. No page of the tool is available to this run, so the build would wait for no code.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 26, 2026
Both target the stage agent and use the same 30-attempt measurement, but #6637 grades the existing Coder engine while the candidate adds a new open-harness engine and compares the two.devops-cli-service commentedon Nov 26, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (10)
Tools considered:
Searches run:
Sources:
dan-petty commentedon Nov 26, 2026
First task done: the choice of the harness. Choice: Kilo CLI (
@kilocode/cli).LICENSEof Kilo-Org/kilocode, read 2026-11-26kilo run --auto "<task>".--autoanswers approval requests from the auto-approval settings: "Operations which are not auto-approved will not be allowed."--format jsonends a failed run with anerrorrecord.provider.<id>withoptions.apiKeyand its models, in./kilo.json[c]or~/.config/kilo/.{env:VAR}works only in trusted config, so the Job writes the gateway provider into~/.config/kilo/of the agent container.@kilocode/cliReasons for Kilo and not OpenCode:
kilo.jsoncwith the devops-cli MCP server (feat(devcontainer): onboard Kilo Code with a kilo.jsonc that exposes the devops-cli MCP server #2330) and the OpenSpec skills for Kilo (feat(openspec): commit the OpenSpec skills for Kilo Code #2333).run,--format json, a provider with a base URL).opencode run) stays the second choice. A secondary source says that a deniedaskpermission ends with exit 0 there, which a Job cannot read; not verified.pax: I found no definition of this candidate in the documents or the comments of refactor(roadmap): re-architect stage and implement on Coder #6519, so I did not judge it.Open points to prove in the build, not from a page: the base URL key of an OpenAI-compatible provider against the LiteLLM gateway, and the behavior of
--autoon a command that the settings do not approve. No sandbox comes with the tool: the Job container with no App key and no write RBAC is the control, as #6519 says.Build order:
@kilocode/clitonpm/package.json, so the image gives the tool onPATHto each user and Renovate moves it. No install in the Job or in product code.prepare, agent,publish), which writes the sameout/outcome.json.devops roadmap eval grades.Sources: https://raw.githubusercontent.com/Kilo-Org/kilocode/main/LICENSE, https://github.com/kilo-org/kilocode/blob/main/packages/kilo-docs/pages/code-with-ai/platforms/cli.md, https://kilo.ai/docs/code-with-ai/platforms/cli, https://opencode.ai/docs/models/, https://github.com/wesammustafa/opencode-primer
devops-cli-service commentedon Nov 26, 2026
Owner question: See Suspected block and Watched files in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 26, 2026
Owner question: See Suspected block in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
dan-petty commentedon Nov 30, 2026
The build of this item stopped before any code change. Two parts of the item cannot work as written today. Check of 2026-11-30 on
mainat 0cd86ee.1. The
RUNNER_TOOLSentry fails the runner image check.ToolSource.DEVTOOLSgoes intoIMAGE_TOOLS(src/devops_cli/roadmap/runner_tools.py:111,:209).smoke.Dockerfile:57runspython -m devops_cli.roadmap.runner_toolson the runner image. The job Service Image ofci.ymlruns it on each change tosrc.release-image.yml:157runs it on each released runner image.npm/package.jsonof dan-petty/devtools has nokiloentry, and feat(image): add the Kilo CLI devtools#98 is open with no pull request.failures([RunnerTool("kilo", ToolSource.DEVTOOLS, ("job",), ("kilo", "--version"))])with nokiloon PATH givesRunner tool 'kilo': kilo --version exited with status 127.Dockerfile.2. The engine share gets to no live attempt.
--phase(src/devops_cli/roadmap/stage/stage_submit.py:330). The phaseallrunsrun_stage_job, which uses the toolbox planner ofplan_stage.run_stage_agentis the place for the second engine. It runs only with--phase agent(src/devops_cli/commands/roadmap_jobs.py:632). The CronJob gets the three phase containers with refactor(k8s): run the stage Job as three containers #6814, which is open (src/devops_cli/roadmap/stage/stage_job_phases.py:5).kiloshare changes no live attempt. The two engines cannot run on live items in the same days until refactor(k8s): run the stage Job as three containers #6814 closes.Options for a person
dan-petty/devtools#98and refactor(k8s): run the stage Job as three containers #6814 to the Dependencies section. Build the full item when both are closed.engine=result field and the per-engine grade rows, and putskiloinNOT_IN_RUNNERwith a reason that names devtools#98. A new item moveskilointoRUNNER_TOOLSafter the devtools digest update.Recommendation: A. Before #6814, no live Job can start the second engine, so the code has no user.
devops-cli-service commentedon Nov 30, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.
devops-cli-service commentedon Dec 1, 2026
The result in the alternatives block of the issue body changed. Before this check:
partly, tool https://github.com/anomalyco/opencode. A person decides what the new result means for the item.Searches (7)
Tools considered:
Searches run:
@kilocode/cli documentation, results: 5Sources: