feat(delegate): per-task model routing — model/provider/base_url/api_…#26736
Open
wuwuzhijing wants to merge 1 commit into
Open
feat(delegate): per-task model routing — model/provider/base_url/api_…#26736wuwuzhijing wants to merge 1 commit into
wuwuzhijing wants to merge 1 commit into
Conversation
1c5b6c4 to
fac0ed1
Compare
…key overrides - delegate_task 顶层和 per-task 均支持 model/provider/base_url/api_key 参数 - 每个子任务可按 provider 名称解析完整凭证(base_url、api_key、api_mode) - 顶层参数作为所有子任务的默认值,per-task 参数覆盖顶层 - 新增 DELEGATE_TASK_SCHEMA 字段定义 - 新增 3 个单元测试覆盖 batch mode / single-task / provider-only resolution - 在 scripts/release.py AUTHOR_MAP 中注册 wuyefeima9@gmail.com
fac0ed1 to
4a7f494
Compare
Collaborator
Contributor
Author
4 tasks
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 does this PR do?
Adds per-task model routing to
delegate_task: top-level and per-taskmodel/provider/base_url/api_keyparameters. Each sub-agent can independently resolve full credentials (base_url, api_key, api_mode) by provider name, enabling a singledelegate_taskcall to route different sub-agents to different models (e.g., DeepSeek reviewer + GLM reviewer + KIMI reviewer running in parallel).delegate_tasknow acceptsmodel,provider,base_url,api_keyat both top-level and per-task level_resolve_delegation_credentialsto resolve full credentials independentlyDELEGATE_TASK_SCHEMAwith new field definitions (top-level +tasks.items.properties)Related Issue
N/A
Type of Change
Changes Made
tools/delegate_tool.py— Extended function signature (+4 params), per-task credential resolution logic,DELEGATE_TASK_SCHEMAfield definitions,registry.registerparam forwardingmodel,provider,base_url,api_keyparameters (all optional, backward compatible)_resolve_delegation_credentialswhen a task specifies its own providerDELEGATE_TASK_SCHEMAat both top-level andtasks.items.propertiestests/tools/test_delegate.py— Added 3 test cases + schema field validationtest_per_task_model_routing_overrides_global_config— batch mode: 2 tasks with different providers/modelstest_toplevel_model_routing_overrides_global_config— single-task mode: top-level routing overrides global configtest_per_task_provider_resolved_when_only_provider_and_model_given— provider name alone triggers full credential resolution (base_url/api_key/api_mode/acp_command)test_schema_has_routing_keys— validates schema fields at both top-level and per-task levelHow to Test
1. Unit Tests
Result: 130 passed in 38.07s, zero regressions.
All 3 new per-task routing tests pass:
2. End-to-End Validation (CLI with real multi-model routing)
Result:
All three sub-tasks correctly returned their respective model identities. Per-task model routing works as expected.
3. Credential Resolution Validation (no token consumption)
Result: All three providers correctly resolved to their respective base_url, api_key, and api_mode.
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/tools/test_delegate.py -x -qand all 130 tests passDocumentation & Housekeeping
DELEGATE_TASK_SCHEMA)cli-config.yaml.example— N/A (no new config keys)CONTRIBUTING.mdorAGENTS.md— N/A (no architecture changes)DELEGATE_TASK_SCHEMAupdated with new fields at both top-level and per-task level