feat(claude_code): per-agent reasoning effort via claudeConfig#283
feat(claude_code): per-agent reasoning effort via claudeConfig#283vprudnikoff wants to merge 1 commit into
Conversation
Add a `claudeConfig` field to the agent profile, the Claude Code analog of `codexConfig` for the codex provider. The claude_code provider maps it to Claude Code CLI flags at launch: - effort -> --effort <level> - fallback_model -> --fallback-model <model> This lets a profile set per-agent reasoning effort (e.g. an orchestrator at xhigh) without relying on the machine-global `effortLevel` in ~/.claude/settings.json, which silently differs between machines. The top-level `model` field still maps to `--model`.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #283 +/- ##
=======================================
Coverage ? 92.15%
=======================================
Files ? 70
Lines ? 7115
Branches ? 0
=======================================
Hits ? 6557
Misses ? 558
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds per-agent Claude Code launch overrides by introducing a claudeConfig map on AgentProfile, and mapping selected keys to Claude Code CLI flags when building the claude command. This brings profile-level control over reasoning effort / fallback model without relying on machine-global ~/.claude/settings.json settings.
Changes:
- Add
claudeConfigtoAgentProfileand document it indocs/agent-profile.md. - Update
ClaudeCodeProvider._build_claude_command()to emit--effortand--fallback-modelwhenprofile.claudeConfigis set. - Add unit tests ensuring the flags are emitted/omitted as expected.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/cli_agent_orchestrator/providers/claude_code.py |
Map profile.claudeConfig entries to claude CLI flags during command construction. |
src/cli_agent_orchestrator/models/agent_profile.py |
Extend the agent profile schema with the new optional claudeConfig field. |
test/providers/test_claude_code_unit.py |
Add unit tests covering claudeConfig → CLI flag behavior. |
docs/agent-profile.md |
Document the new claudeConfig profile field and its flag mappings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Apply Claude Code-only per-agent knobs from claudeConfig: | ||
| # effort -> --effort <level> | ||
| # fallback_model -> --fallback-model <model> | ||
| # Claude analog of codexConfig: per-agent reasoning effort without | ||
| # depending on the machine-global effortLevel in | ||
| # ~/.claude/settings.json. |
There was a problem hiding this comment.
For context: codexConfig is introduced by the sibling PR #278 (feat/codex-agent-config). This launch-override comment intentionally mirrors that field — claudeConfig is the claude_code analog — so it resolves once both PRs merge. If reviewers prefer this PR to stand alone regardless of merge order, I'm happy to drop the codexConfig mention and describe the behavior on its own.
| # Claude Code-only. Per-agent Claude Code knobs mapped to CLI flags at | ||
| # launch: {"effort": "<low|medium|high|xhigh>"} -> `--effort <level>` and | ||
| # {"fallback_model": "<model>"} -> `--fallback-model <model>`. Lets a | ||
| # profile set per-agent reasoning effort without relying on the | ||
| # machine-global `effortLevel` in ~/.claude/settings.json. This is the | ||
| # Claude analog of codexConfig for the codex provider; the top-level | ||
| # `model` field still maps to `--model`. |
There was a problem hiding this comment.
For context: codexConfig is added by the sibling PR #278 (feat/codex-agent-config). claudeConfig here is the deliberate claude_code analog of that field, so this comment cross-references it on purpose; it becomes accurate once both PRs merge. If you'd rather keep this PR independent of merge order, I can drop the codexConfig reference and just describe claudeConfig on its own.
| - `model` (string): AI model to use | ||
| - `permissionMode` (string, `claude_code` only): One of `"default"`, `"acceptEdits"`, `"plan"`, `"auto"`, `"bypassPermissions"`. When set, the `claude_code` provider passes `--permission-mode <value>` instead of `--dangerously-skip-permissions`. `cao launch --yolo` overrides this and forces bypass. See [Claude Code permission modes](https://code.claude.com/docs/en/permission-modes). | ||
| - `native_agent` (string, `claude_code` only): Name of a native Claude Code agent (`~/.claude/agents/`). When set, the provider passes `--agent <name>` directly and skips system prompt / MCP config decomposition (thin-wrapper mode). See [Claude Code native agent routing](claude-code.md#native-agent-routing). | ||
| - `claudeConfig` (object, `claude_code` only): Per-agent Claude Code knobs mapped to CLI flags at launch. `{"effort": "<low|medium|high|xhigh>"}` adds `--effort <level>` and `{"fallback_model": "<model>"}` adds `--fallback-model <model>`. Lets a profile set per-agent reasoning effort without relying on the machine-global `effortLevel` in `~/.claude/settings.json`. The Claude analog of `codexConfig`; the top-level `model` field still maps to `--model`. |
There was a problem hiding this comment.
Context: codexConfig is introduced by the sibling PR #278 (feat/codex-agent-config). These two are a pair — per-agent provider config: codexConfig for the codex provider, claudeConfig for claude_code — so the cross-reference is intentional and resolves once both land. If you'd prefer each PR to read as fully self-contained regardless of merge order, I'm happy to drop the codexConfig mention here.
|
@vprudnikoff great PR. I think this needs one behavior fix before approval. The new Could we make On the existing One smaller compatibility note: local Claude Code 2.1.181 help says Results:
|
What
Adds a
claudeConfigfield to the agent profile, the Claude Code analog ofcodexConfig(PR #278) for the codex provider. Theclaude_codeprovider maps it to Claude Code CLI flags at launch:claudeConfigkeyeffort--effort <level>fallback_model--fallback-model <model>The top-level
modelfield still maps to--model(unchanged), mirroring how codex keepsmodelseparate fromcodexConfig.Why
Today the only lever for a
claude_codeagent's reasoning effort is the machine-globaleffortLevelin~/.claude/settings.json(or theCLAUDE_CODE_EFFORT_LEVELenv var, which the provider already preserves). That silently differs between machines: an orchestrator profile meant to run atxhighfalls back to the Claude Code default (high) on any host where the global setting is absent.codexConfigalready solves the equivalent problem per-agent for codex; this brings parity to claude_code.Example
Tests
test/providers/test_claude_code_unit.py::TestClaudeCodeProviderClaudeConfig: effort flag emitted when set, fallback-model emitted when set, no flag whenclaudeConfigis absent. Docs updated indocs/agent-profile.md.