The harness runs Claude Code in print mode, where AskUserQuestion and
the plan mode tools are disabled: Claude Code asked its questions in
plain text and ended the turn.
For each turn, the Claude Code driver now serves a permission_prompt
tool from an MCP server on loopback and hands it to the CLI as its
permission prompt tool. Claude Code then offers AskUserQuestion and plan
mode, and consults the tool before AskUserQuestion and ExitPlanMode
only. The driver turns them into elicitation forms and answers with the
user's choices, or with a denial when the form is declined or
dismissed.
The server requires a bearer token kept in a 0600 MCP config file, sets
a 24 hour tool timeout (Claude Code otherwise abandons an HTTP tool
call after 60 seconds), and ends open questions with the turn. Through
the new optional harness.Eliciter capability, the runtime passes an
elicitation handler only when someone can answer: serve mcp, A2A and
background agents keep plain text questions.
Signed-off-by: Sayt-0 <louis.dal-moro-compta@epita.fr>
In print mode, the claude CLI's JSON output is the result message alone,
unless verbose mode is on in the user's config: it is then an array of
every message of the run, where system notices can follow the result.
Complete only decoded the single object, so for those users every title
request failed with "unexpected output" and sessions stayed untitled.
Complete now accepts both shapes and takes the run's last result
message. Tests cover a verbose array as Claude Code 2.1.310 prints it,
a notice after the result, and errors reported inside an array.
Signed-off-by: Sayt-0 <louis.dal-moro-compta@epita.fr>
A harness agent has no docker-agent model, so the TUI got no title
generator for it and its sessions stayed untitled.
The Claude Code driver now implements an optional harness.Completer: a
one-shot `claude` call in print mode on the haiku model, with no tools,
no MCP servers and no saved session, the prompt passed on stdin and the
JSON result parsed. sessiontitle.Generator accepts such completers after
its models, and LocalRuntime.TitleGenerator uses the driver's completer
for a harness agent. Other harness types still get no title.
Signed-off-by: Sayt-0 <louis.dal-moro-compta@epita.fr>
Wire the Command Code CLI (`cmd`) in as a new coding-harness type,
alongside claude-code, codex, pi and opencode, so an agent can be run by
it:
harness:
type: command-code
The provider lives in github.com/rumpl/harness, so this bumps that
dependency. Until the commandcode package lands upstream
(https://github.com/rumpl/harness/pull/13) the bump is a temporary
replace, allow-listed in .golangci.yml with a TODO to drop it.
Signed-off-by: PremModhaOfficial <PremModhaOfficial@users.noreply.github.com>
Wrap the codex provider's Run/Resume so the documented codex exec
--json interface is driven directly instead of relying on the
upstream library's own process handling:
- bound each JSON event to 16 MiB instead of bufio.Scanner's default
64 KiB, rejecting oversized or malformed events without waiting for
the CLI to finish writing them
- require turn.completed (or treat turn.failed / an unexpected EOF as
an error) while tolerating transient reconnection error events
- drain stdout for a bounded window after the process exits, counting
only pipe idle time (not slow consumer callback time) against the
budget, and join the reader goroutine before returning
- on Unix, cancel the whole process group in one shot so descendants
holding stdout open don't keep the drain alive
- cap and redact stderr diagnostics, discarding (rather than
truncating) output that exceeds the limit so a partial secret can't
leak
Covered by regression tests for large messages/tool outputs, malformed
and unknown events, EOF/failure/exit handling, cancellation with active
descendants and inherited pipes, slow callbacks, and redaction.
pkg/harness defines the Event/Provider contract; pkg/codingharness
implements it on top of rumpl/harness and exposes Factory. The runtime no
longer imports either, so embedders that never run harness agents drop the
harness CLI drivers. The CLI and loaderdefaults.Opts register the driver
with runtime.RegisterHarness(codingharness.Factory); an unregistered
harness agent fails with ErrHarnessNotRegistered.
Add support for harness-backed agents that delegate coding tasks to external
coding CLIs through github.com/rumpl/harness.
Harness agents can now be configured with a `harness` block in agent YAML and
used as sub-agents by an orchestrator. The runtime detects harness-backed
agents, builds a prompt from the current session, streams text/reasoning output
back into docker-agent, records final assistant responses, and forwards usage
when reported by the harness.
Supported harness types:
- claude-code
- codex
- pi
- opencode
Also update config validation and schema support so harness agents do not need
docker-agent model providers, add an example configuration, and handle external
harness tool call lifecycle events including partial tool calls and tool
results.:
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>