Skip to content

feat(roadmap): trial an open harness for the stage agent #7269

Backlog

Description

@dan-petty

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_TOOLS entry 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, then publish): the engine reads the run folder and writes the patch of the change folder, the body candidate and out/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 grades shows 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

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 kilo and a fake kilo program on PATH that writes out/plan.patch, out/candidate.md and out/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.py passes.

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.engine is unset and roadmap.stage.engine_share is 0, and the stage job runs an item.
  • THEN The job runs the Coder engine, the result line holds engine=coder, and tests/roadmap/stage/test_roadmap_stage_job_entry.py and tests/security/test_config_declarations.py pass.

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.py passes.

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, and tests/roadmap/stage/test_roadmap_stage_job_entry.py passes.

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 LokiFake and 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.py passes.

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_KEY or 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.py and tests/roadmap/stage/test_roadmap_stage_agent_phase.py pass.

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 kilo entry in NOT_IN_RUNNER with that reason, holds no kilo entry in RUNNER_TOOLS, and tests/roadmap/test_roadmap_runner_tools.py passes.

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 names dan-petty/devtools#98 for 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.json as the typed StageOutcome. 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 StageOutcome model 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.
  • How does the stage job select the engine for a share of attempts?: Add roadmap.stage.engine (coder default, kilo second) and roadmap.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_result appends an engine= field at the end of the line, so the positional fields keep their places. The grade report groups the rows of RESULT_LINES by 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_TOOLS entry. Add kilo to NOT_IN_RUNNER with the reason dan-petty/devtools#98. Defer the RUNNER_TOOLS entry to a new issue. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py, smoke.Dockerfile:57]
    • Chosen: List kilo in NOT_IN_RUNNER and defer the RUNNER_TOOLS entry. The runner image check passes now, and the entry waits for the devtools image.
    • Rejected: Add the RUNNER_TOOLS entry now. It fails python -m devops_cli.roadmap.runner_tools with status 127 until dan-petty/devtools#98 ships.
    • Rejected: Wait for dan-petty/devtools#98 before any code. It blocks the adapter, the setting and the report that can be built and tested offline.
  • Why does the live two-engine trial wait?: The Service starts the stage Job with no --phase, so run_stage_agent does 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 until dan-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]
  • 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 kilo on PATH proves the command line, the exit codes, the three artifacts and the refused-key path. The provider base URL and the --auto approval 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.

Moved to new items

#7957, #7958

Activity

  1. added
    type/feature
    source/agent
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 26, 2026
  2. dan-petty commented on Nov 26, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    priority/p1-high
    effort/high
    value/high
    and removed
    priority/p2-medium
    value/medium
    effort/low
    on Nov 26, 2026
  4. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    Contributor

    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:

    • Kilo Code CLI open source headless auto mode, results: 5
    • OpenCode open source AI coding agent headless non-interactive run, results: 5
    • kilocode Kilo Code CLI github, results: 5
    • sst opencode github AI coding agent, results: 5
    • opencode run non-interactive mode documentation, results: 5
    • pax coding agent open source CLI, results: 5
    • OpenCode CLI headless CI agent OpenAI compatible provider docs, results: 5
    • "opencode" npm opencode-ai coding agent terminal, results: 5
    • opencode github action run agent non-interactive CI workflow, results: 5
    • opencode run prompt, results: 5

    Sources:

  5. dan-petty commented on Nov 26, 2026

    @dan-petty
    OwnerAuthor

    First task done: the choice of the harness. Choice: Kilo CLI (@kilocode/cli).

    Point Kilo CLI Source
    License MIT, copyright Kilo Code (2026) and opencode (2025) LICENSE of Kilo-Org/kilocode, read 2026-11-26
    Headless run kilo run --auto "<task>". --auto answers approval requests from the auto-approval settings: "Operations which are not auto-approved will not be allowed." CLI page of the Kilo docs
    Result for a Job Exit 0 for success, 124 for a timeout, 1 for a failed start, run or request, and 1 with a cause on stderr when a permission was rejected. --format json ends a failed run with an error record. CLI page
    Model endpoint A provider under provider.<id> with options.apiKey and 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. CLI page
    Install npm package @kilocode/cli CLI page

    Reasons for Kilo and not OpenCode:

    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 --auto on 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:

    1. devtools: add @kilocode/cli to npm/package.json, so the image gives the tool on PATH to each user and Renovate moves it. No install in the Job or in product code.
    2. The second engine behind the stage contract (prepare, agent, publish), which writes the same out/outcome.json.
    3. The setting for the share of attempts, and the engine name in the result line and in devops roadmap eval grades.
    4. The live trial: 30 or more graded attempts for each engine, then the decision rule of the body.

    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

  6. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    Contributor

    Owner question: See Suspected block and Watched files in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  7. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    Contributor

    Owner question: See Suspected block in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  8. added
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 30, 2026
  9. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor

    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 main at 0cd86ee.

    1. The RUNNER_TOOLS entry fails the runner image check.

    • An entry with ToolSource.DEVTOOLS goes into IMAGE_TOOLS (src/devops_cli/roadmap/runner_tools.py:111, :209).
    • smoke.Dockerfile:57 runs python -m devops_cli.roadmap.runner_tools on the runner image. The job Service Image of ci.yml runs it on each change to src. release-image.yml:157 runs it on each released runner image.
    • The devtools image does not ship the Kilo CLI. The file npm/package.json of dan-petty/devtools has no kilo entry, and feat(image): add the Kilo CLI devtools#98 is open with no pull request.
    • Proof: failures([RunnerTool("kilo", ToolSource.DEVTOOLS, ("job",), ("kilo", "--version"))]) with no kilo on PATH gives Runner tool 'kilo': kilo --version exited with status 127.
    • Thus the entry stops each release of the runner image until devtools#98 ships and Renovate moves the devtools digest in Dockerfile.

    2. The engine share gets to no live attempt.

    • The Service starts the stage Job with no --phase (src/devops_cli/roadmap/stage/stage_submit.py:330). The phase all runs run_stage_job, which uses the toolbox planner of plan_stage.
    • run_stage_agent is 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).
    • Thus a kilo share 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

    • A. Add dan-petty/devtools#98 and refactor(k8s): run the stage Job as three containers #6814 to the Dependencies section. Build the full item when both are closed.
    • B. Split the item. This item keeps the adapter, the setting, the engine= result field and the per-engine grade rows, and puts kilo in NOT_IN_RUNNER with a reason that names devtools#98. A new item moves kilo into RUNNER_TOOLS after the devtools digest update.

    Recommendation: A. Before #6814, no live Job can start the second engine, so the code has no user.

  10. added
    status/new
    and removed
    status/in-progress
    on Nov 30, 2026
  11. added
    status/ready
    and removed
    status/new
    on Nov 30, 2026
  12. devops-cli-service commented on Nov 30, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.

  13. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    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:

    • Kilo CLI kilocode headless run auto mode, results: 5
    • OpenCode CLI run non-interactive headless agent, results: 5
    • kilocode cli npm @kilocode/cli documentation, results: 5
    • opencode.ai docs cli run command, results: 5
    • open source coding agent CLI headless patch generation, results: 5
    • pax coding agent CLI harness, results: 5
    • Kilo Code CLI github Kilo-Org kilocode, results: 5

    Sources:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/highowner/agentpriority/p1-highscope/roadmapsource/agentstatus/readytype/featurevalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions