Repository navigation
Commit b891de7
authored
feat(workflow): per-task subagent routing and a spawn-plan telemetry event (#241)
## Related Issue
No issue. Eighth step of the subagent routing work. Stacked on #240
(merge #234 → #240 first; until then this diff includes their commits).
## Problem
`AgentDynamicWorkflow` could only spawn homogeneous subagents: one
`subagent_type` and one `model` for every item, and nothing reported how
a spawn plan was resolved.
## What changed
- Input gains `tasks[]` (`{ item, subagent_type?, model?, thinking? }`)
and `defaults.subagent_type` beside the homogeneous `items` shape;
`tasks` and `items` cannot be combined (schema refinement). Each task
resolves through `SessionSubagentRoutingService.resolve()`, so one
workflow can mix profiles, models, and thinking efforts and every plan
carries its own provenance. Profile names come from the session catalog;
model aliases use the same vocabulary as `model`. `model` stays the last
top-level parameter so the pool-less schema strip is unchanged.
- `SubagentSpawnPlanInput.thinking` (explicit effort) is honored by the
resolver and is part of `routeDecisionFingerprint` only — never of
`routingEnvironmentRevision`.
- Telemetry: `subagent_spawn_plan_resolved` (`operation`,
`profile_source`, `model_source`, `policy_mode`, `policy_source`,
`feature_source`, `routing_env_revision`, `route_decision`,
`explicit_profile|model|thinking`). No prompt content.
- Token-count expectations in the compaction/loop tests and the wire
snapshots follow the larger tool schema (verified: the only delta is the
new `defaults`/`tasks` parameters and the tool-list hash).
Tests: mixed-profile workflow (three tasks → three plans with different
profile/model/thinking/provenance); `tasks` + `items` rejected; legacy
`items` shape unchanged; explicit thinking changes the decision
fingerprint but not the environment revision; telemetry attribute set
asserted exactly.
## Checklist
- [x] I have read the
[CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md)
document.
- [ ] I have linked a related issue (external PRs: the issue must have a
maintainer's `/approve`).
- [x] I have added tests that prove my feature works.
- [x] Ran `gen-changesets` skill, or this PR needs no changeset.
- [x] Ran `gen-docs` skill, or this PR needs no doc update.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Dynamic workflows now support per-task subagent types, models, and
thinking settings, with optional defaults.
* Subagent routing and model selections are preserved when workflows
resume or create child tasks.
* Added telemetry visibility for resolved subagent spawn plans.
* Expanded diagram and editor support in the web experience.
* **Bug Fixes**
* Improved workflow task counts when tasks are still resolving.
* Automatically clears stale secondary-model settings during provider
refreshes.
* Improved spacing consistency across workflow cards.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 55d12a2 commit b891de7
113 files changed
Lines changed: 475 additions & 183 deletions
File tree
- .changeset
- apps
- pythinker-code/dist-web
- assets
- pythinker-web
- src/components/chat/tool-calls
- test
- packages
- agent-core-v2
- src
- app/telemetry
- features/dynamic_workflow/tools/agent-dynamic_workflow
- session/subagent
- test
- agent
- fullCompaction
- loop
- features/dynamic_workflow
- session/subagent
- tool
- agent-gateway/test
- oauth
- src
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments