feat: configurable agent harness CLI (claude default + custom template)#5
Merged
Conversation
The 4 agent surfaces hardcoded `claude` (+ a copy-pasted gateway-wait/retry loop
each). Centralise that into scripts/lib/agent-harness.sh's agent_run, so the CLI
is a .agent-ops.json choice:
harness.kind = claude (built-in default — byte-compatible with the old calls)
| custom (run harness.command, a template with {model}/{prompt_file}/
{out}/{tools}/{write}/{max_turns} placeholders → any CLI)
- agent_run --profile {investigate|implement|review} owns the gateway pre-flight
wait + retry-on-gateway-down loop (guarded by harness.health_probe); --stream
tees, --out redirects, review extras pass through. AGENT_HARNESS_DRYRUN=1 prints
the built command (used by the test).
- config.sh loads .harness.{kind,command,model,health_probe}; .harness.model wins
over .model. (Fixes a jq `// empty` gotcha so health_probe:false is honored.)
- run_triage / run_wiwi / run_revise / run_review now call agent_run, deleting
their inline claude + retry blocks. run_review also loads .agent-ops.json now.
- schema + config-reference + cookbook ("Swapping the agent CLI" + codex example +
the prompt-shape KNOWN CONSTRAINT) + example config.
- test_harness.py (stdlib, dry-run) locks claude back-compat command construction
per profile + custom template substitution; wired into ci.yml.
Back-compat: no harness block ⇒ identical claude invocations; heron + existing
consumers unaffected.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Part A of "make the agent CLI configurable + qualify candidates". The 4 agent surfaces hardcoded
claude(each with its own copy of the gateway-wait/retry loop). Centralised intoscripts/lib/agent-harness.sh'sagent_run, so the CLI is a.agent-ops.jsonchoice:agent_run --profile {investigate|implement|review}owns the gateway pre-flight wait + retry-on-gateway-down loop;--streamtees,--outredirects, review extras pass through.AGENT_HARNESS_DRYRUN=1prints the built command.config.shloads.harness.{kind,command,model,health_probe}(fixes a jq// emptygotcha sohealth_probe:falseis honored).agent_run, deleting their inlineclaude+ retry blocks;run_reviewnow also loads.agent-ops.json.test_harness.py(dry-run) locks claude back-compat command construction per profile + custom substitution; wired into ci.Back-compat (non-negotiable)
No
harnessblock ⇒ identicalclaudeinvocations. heron + every existing consumer unaffected. test_harness.py asserts this.Next
Part B (
evals/qualification bench) lands separately and reuses this adapter to benchmark candidate CLIs (codex → pi agent → kilo cli …) before integration.🤖 Generated with Claude Code