Repository navigation
feat(delegation): per-request mode/config overrides - #879
Open
zenviosoft wants to merge 1 commit into
Open
zenviosoft wants to merge 1 commit into
zenviosoft wants to merge 1 commit into
Conversation
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.
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
DelegationRequestandResumeDelegationRequestgain an optionaloverrides: Option<AgentDelegationDefaults>, laid over the agent's configured delegation defaults:mode_idreplaces the configured one only when set;config_valueswin key by key, so an override that pins onlymodelkeeps 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_delegationpaths passoverrides: None; the tool schema is unchanged.Tests
request_overrides_are_laid_over_agent_defaultsrequest_overrides_apply_without_agent_defaultsresume_overrides_are_laid_over_agent_defaultscargo test --features test-utilspasses (4944 lib tests).cargo clippy -D warningsreports one pre-existingnonminimal_boolinsrc/computer/helper/mod.rs:667on currentmain(Rust 1.96), unrelated to this change; no warnings in the touched files.