agent-orchestrator icon indicating copy to clipboard operation
agent-orchestrator copied to clipboard

feat: add CommandCode (command-code) harness + worker effort support

Open ApexYash11 opened this issue 2 months ago • 3 comments

I want CommandCode in AO as a first-class harness — https://commandcode.ai/ (docs: https://commandcode.ai/docs).

From their docs, the integration surface is small and maps cleanly onto our existing adapter pattern (opencode/opencode.go, omp/omp.go):

  • Binary: command-code everywhere, cmd on POSIX, cmdc on Windows (npm i -g command-code). Needs binaryutil PATH + npm-global resolution like opencode.
  • Launch (headless-first): cmd -p "<prompt>" --output-format json --max-turns 100 --skip-onboarding — NDJSON event frames + final result line with sessionId (docs/headless). Resume via cmd -p --resume <id>, --continue.
  • Hooks: .commandcode/settings.json with PreToolUse / PostToolUse / Stop / SessionStart (docs/hooks) calling ao hooks command-code …, same shape as our GetAgentHooks + activitydispatch drivers.
  • Auth: cmd status --json / cmd whoami. Models: cmd --list-models, -m <id>.
  • Flags we must forward: -m/--model and --effort <low|medium|high…> (docs/reference/cli).

The gap — model/effort in the client:

Chat already does effort: provider catalog returns efforts[] (dto.go:1865), frontend TurnSettingsBar.tsx renders model + effort, drivers forward it (codexappserver/driver.go, claudeacp/driver.go).

Worker sessions don't: domain/agentconfig.go only has model/mode/permissions — no effort. agentbase only has ModelConfigSpec / AppendModelFlag, and opencode only forwards --model. I searched PRs for effort — no merged worker-effort PR found, so copying opencode for CommandCode would repeat the same hole: --effort would be silently dropped when the catalog has no efforts.

Robust fix proposed:

  1. Add effort to worker AgentConfig (+ ConfigSpec field, AppendEffortFlag, validation, CLI --effort, DTO/OpenAPI regen) so command-code --effort and future opencode-style flags work even when efforts[] is absent — with empty = adapter default.
  2. Then add command-code adapter on that plumbing (launch/restore/hooks/activity/auth/model catalog).

Happy to split into two PRs (effort plumbing first, harness second) — flagging here so we don't ship another model-only adapter.

ApexYash11 avatar Sep 22 '26 17:09 ApexYash11

PR #5417 is the active Command Code harness work, but it currently covers Terminal UI only and explicitly omits hooks, Chat, and --effort. Current main has an AgentConfig.Effort field from #5075; the Command Code flag path is still missing. Keeping this issue open for the remaining scope while #5417 is reviewed.

codebanditssss avatar Sep 23 '26 13:09 codebanditssss

Hope this get's in with full functionality.

sirinath avatar Sep 26 '26 11:09 sirinath

Fixed by #6141

Rishet11 avatar Oct 14 '26 11:10 Rishet11