feat: add CommandCode (command-code) harness + worker effort support
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-codeeverywhere,cmdon POSIX,cmdcon Windows (npm i -g command-code). NeedsbinaryutilPATH + npm-global resolution like opencode. - Launch (headless-first):
cmd -p "<prompt>" --output-format json --max-turns 100 --skip-onboarding— NDJSONeventframes + finalresultline withsessionId(docs/headless). Resume viacmd -p --resume <id>,--continue. - Hooks:
.commandcode/settings.jsonwithPreToolUse / PostToolUse / Stop / SessionStart(docs/hooks) callingao hooks command-code …, same shape as ourGetAgentHooks+activitydispatchdrivers. - Auth:
cmd status --json/cmd whoami. Models:cmd --list-models,-m <id>. - Flags we must forward:
-m/--modeland--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:
- Add
effortto workerAgentConfig(+ConfigSpecfield,AppendEffortFlag, validation, CLI--effort, DTO/OpenAPI regen) socommand-code --effortand futureopencode-style flags work even whenefforts[]is absent — with empty = adapter default. - Then add
command-codeadapter 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.
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.
Hope this get's in with full functionality.
Fixed by #6141