feat(delegate): add tier profiles and heuristic routing core - #11155
feat(delegate): add tier profiles and heuristic routing core#11155MestreY0d4-Uninter wants to merge 5 commits into
Conversation
|
Updated the PR body to mirror the maintainer guidance from #9737 point-by-point:
So the PR description now explicitly shows how this successor matches the requested format/scope. |
|
Refresh concluído em branch limpa a partir de origin/main, com cherry-pick do commit relevante e resolução mínima de conflito em tools/delegate_tool.py; push com --force-with-lease. Ajuste adicional: task_count ganhou default compatível para manter o helper usável nos testes. Validação: python -m py_compile tools/delegate_tool.py tests/tools/test_delegate_tier_core.py; uv run --frozen --with pytest pytest -q -o addopts='' tests/tools/test_delegate_tier_core.py (10 passed). |
a6476ea to
a79fc6d
Compare
|
This successor to #9737 looks materially better scoped than the old branch:
So the feature line still looks relevant. Current blocker is packaging/CI readiness, not obvious product irrelevance:
Recommendation: KEEP OPEN, but do one more refresh pass for CI cleanliness before asking for merge. Suggested next step:
So: relevant and likely review-worthy, but not yet merge-ready until the CI packaging issues are cleaned up. Batch 4 — technical follow-up required |
|
✅ Salvage completed (2026-04-19) The delegate tier routing core has been extracted into a clean branch: New branch:
Changes:
The original #11155 will be superseded by this clean version. Salvaged from #11155 per audit plan |
|
Great initiative on the delegate tier profiles and heuristic routing. This is exactly the kind of core architectural improvement we need for intelligent task delegation. However, I found a critical bug that needs to be fixed before this can merge: The _build_child_agent() function requires a task_count parameter, but all call sites throughout the codebase weren't updated to provide it. This is causing 20 test failures in the existing test suite. Action needed: Once this is fixed, this PR will be ready to merge. The tier profiles (light, heavy, review, planning, research) and heuristic auto-routing are exactly what we need for scalable agent delegation. Please address the task_count parameter issue, and I'll re-run the tests to verify the fix. |
- tools/delegate_tool.py: add task_count=n_tasks to the _build_child_agent() call site in delegate_task() to match the function signature which requires task_count as a mandatory parameter. - tests/tools/test_delegate_tier_core.py: add task_count=1 to the test _build_child_agent() call to match the required signature. This fixes the TypeError that occurred when calling delegate_task() after the tier profiles feature was added, which introduced task_count as a required parameter but missed updating these call sites. Fixes regression introduced in PR NousResearch#11155. Reported-by: trevorgordon981
Fixes regression from PR NousResearch#11155 reported by @trevorgordon981.
Fixes regression reported by @trevorgordon981
Fixes regression reported by @trevorgordon981
Fixes test call site reported by @trevorgordon981
|
@trevorgordon981 Obrigado pelo reporte do bug! 🎯 Correção aplicada:
Validação:
O PR agora está pronto para revalidação dos testes. Obrigado novamente por identificar essa regressão crítica! 🙏 |
| # --------------------------------------------------------------------------- | ||
| # Task-tier profiles: named delegation presets for task shape/routing/effort | ||
| # --------------------------------------------------------------------------- | ||
| SUPPORTED_TIERS = frozenset({"light", "heavy", "review", "planning", "research"}) |
There was a problem hiding this comment.
why hardcode these instead of having the signals configured with the tier itself (which accounts for people using non-English languages as well)?
MestreY0d4-Uninter
left a comment
There was a problem hiding this comment.
@m0n5t3r Good point! The hardcoded signals are a heuristic fallback for auto-detection when tier is not explicitly specified. You're right that this doesn't scale well for non-English prompts.
A few notes:
- The heuristic is opt-in via
delegation.auto_tier_selection: true - Explicit
tierparameter always takes precedence over heuristics - Users can specify
tier: "review"directly without relying on signal detection
I agree this could be improved by making signals configurable per-tier in config.yaml. Would you prefer that change be part of this PR, or as a follow-up? Given the scope reduction requested by maintainers on the predecessor PR (#9737), I'd lean toward follow-up unless you feel strongly.
|
the code here ignores all user specified tiers that aren't in so we're left with a set of names that are rather limited and can't be customized; can we have user defined tiers accepted, and have the heuristic fail with a warning if unknown tiers are seen? |
- Remove enum restriction from tier schema to allow custom tiers - Log warning for unknown tiers but proceed instead of rejecting - Fall back to flat config only if tier not defined in tiers config - Add tests for user-defined tier acceptance and config application Addresses feedback from m0n5t3r on PR NousResearch#11155
0a8b6f5 to
79494bd
Compare
|
✅ Addressed in latest commit (79494bd) Thanks for catching this, @m0n5t3r! Your feedback has been implemented: Changes:
Tests added:
This allows users to define custom tier names in their config while maintaining backward compatibility with the built-in tiers (light, heavy, review, planning, research). |
|
✅ Validation Complete - Ready for Review Summary of changes:
Validation performed:
CI Status:
This PR addresses the feedback from @m0n5t3r and is ready for final review and merge. |
|
Duplicate of #9737 — same core feature set (delegate tier profiles + per-task tiering + reasoning-effort routing). Closing in favor of the earlier PR. |
Summary
Fresh successor to #9737, rebuilt on top of current
mainand reduced to the exact core requested in maintainer review.This PR keeps only:
resolve_tier_config()tiersupport in batch modeAddressing maintainer guidance from #9737
tierin batch mode, reasoning floor guardrails, heuristic auto-router.mailmapchangesscripts/release.pychurnagent/credential_pool.pychangestool_error()handlingmainorigin/mainautois not in the schema enumlight,heavy,review,planning,researchdelegation.auto_tier_selection, not a schema enum valueWhat changed
tools/delegate_tool.pylight,heavy,review,planning,research)resolve_tier_config()heavy/research>=medium,planning/review>=high)tierand per-tasktasks[].tierdelegation.auto_tier_selectioncli-config.yaml.exampletests/tools/test_delegate_tier_core.pyValidation
Local validation on the rebased branch:
python -m py_compile tools/delegate_tool.py tests/tools/test_delegate_tier_core.pypython -m pytest tests/tools/test_delegate_tier_core.py -q -o addopts=''10 passedpython -m pytest tests/tools/test_delegate.py tests/tools/test_delegate_toolset_scope.py tests/tools/test_delegate_tier_core.py -q -o addopts=''82 passedOut of scope by design
.mailmapor attribution changesSuccessor to #9737.