Skip to content

feat(delegation): per-request mode/config overrides - #879

Open
zenviosoft wants to merge 1 commit into
spacering-net:mainfrom
zenviosoft:feat/delegation-request-overrides
Open

zenviosoft wants to merge 1 commit into
spacering-net:mainfrom
zenviosoft:feat/delegation-request-overrides

Conversation

@zenviosoft

Copy link
Copy Markdown

What

DelegationRequest and ResumeDelegationRequest gain an optional overrides: Option<AgentDelegationDefaults>, laid over the agent's configured delegation defaults:

  • an override's mode_id replaces the configured one only when set;
  • its config_values win key by key, so an override that pins only model keeps the configured mode and every other configured option.

Fresh spawns and resumes go through one helper (effective_spawn_options), so the two paths cannot disagree on precedence.

Why

Delegation defaults are keyed by agent_type, so every child of one agent type is spawned with the same mode/model. A caller that wants two children of the same agent with different models (e.g. one Claude Code child on Opus for design, one on Sonnet for review) has no way to express it today. This adds the extension point in the broker without changing any existing behavior.

Resume takes overrides too: the broker does not persist a task's original overrides, so a caller that started a task with overrides passes them again to resume it under the same mode/model, instead of silently falling back to the agent defaults.

Behavior change

None for existing callers. The MCP delegate_to_agent / resume_delegation paths pass overrides: None; the tool schema is unchanged.

Tests

  • request_overrides_are_laid_over_agent_defaults
  • request_overrides_apply_without_agent_defaults
  • resume_overrides_are_laid_over_agent_defaults

cargo test --features test-utils passes (4944 lib tests). cargo clippy -D warnings reports one pre-existing nonminimal_bool in src/computer/helper/mod.rs:667 on current main (Rust 1.96), unrelated to this change; no warnings in the touched files.

DelegationRequest and ResumeDelegationRequest gain an optional
`overrides` (AgentDelegationDefaults) laid over the agent's configured
delegation defaults: an override's mode replaces the configured one only
when set, and its config values win key by key.

This lets a caller run the same agent type with different models in
parallel (e.g. two Claude Code children, one per model), which the
per-agent-type defaults alone cannot express. Fresh spawns and resumes
share one precedence helper so they cannot disagree.

The MCP `delegate_to_agent` path passes `None`, so behavior is
unchanged for every existing caller.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant