Skip to content

Commit b891de7

Browse files
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

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@pymodel/pythinker-code": minor
3+
---
4+
5+
AgentDynamicWorkflow accepts a `tasks` list where each entry sets its own subagent type, model, and thinking effort. Pass `tasks` instead of `items`, with optional `defaults.subagent_type`.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"sourceHash": "c294d9482527fbd47119352fcaac10f9870f9ef62d7228be22642ea8bd1a7804",
2+
"sourceHash": "1e2f179018f506a81f8da2b82e60a8331dedf5e9683f13ea4a64e2625c0116fc",
33
"sourceFileCount": 407
44
}

apps/pythinker-code/dist-web/assets/CodeBlockNode-33pAwoCL.js renamed to apps/pythinker-code/dist-web/assets/CodeBlockNode-Dm1Yf-GJ.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/pythinker-code/dist-web/assets/DesignSystemView-4b_cOQ1c.js renamed to apps/pythinker-code/dist-web/assets/DesignSystemView-DgxFdnj9.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/pythinker-code/dist-web/assets/Tooltip-CcCCxqwO.js renamed to apps/pythinker-code/dist-web/assets/Tooltip-CTnp6aoX.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/pythinker-code/dist-web/assets/abnfDiagram-VCTEODGH-BfFA3n2p.js renamed to apps/pythinker-code/dist-web/assets/abnfDiagram-VCTEODGH-DJ6f-04C.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/pythinker-code/dist-web/assets/arc-D4p47luw.js renamed to apps/pythinker-code/dist-web/assets/arc-BSJR-ESo.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/pythinker-code/dist-web/assets/architectureDiagram-5GKGNRK7-CijUuhX1.js renamed to apps/pythinker-code/dist-web/assets/architectureDiagram-5GKGNRK7-C_eZufDB.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)