feat(core): emit SubagentProgress for child tool/turn milestones#41
Merged
Conversation
The `SubagentProgress` event variant exists but until now was never sent —
the subagent task tracker introduced in the previous commit observed
Start and End but had no mid-task signal to update from.
Adds a `synthesize_subagent_progress()` helper called by the mpsc → broadcast
forwarder inside `TaskExecutor::execute_with_task_id`. It translates two
child-loop events into compact progress milestones on the parent broadcast:
- `ToolEnd` → `status = "tool_completed"`, metadata `{ tool, exit_code,
output_bytes, error_kind? }`
- `TurnEnd` → `status = "turn_completed"`, metadata `{ turn, total_tokens,
prompt_tokens, completion_tokens }`
Noisy events (TextDelta / ToolStart / ToolOutputDelta / nested Subagent*)
are intentionally not translated — consumers needing token-level detail
should subscribe to the raw event stream directly.
The original child events are still forwarded unchanged; progress is
additive, so downstream consumers see both the synthesized milestone
and the underlying event.
8 tasks
ZhiXiao-Lin
pushed a commit
that referenced
this pull request
May 23, 2026
Bumps Rust core, Node SDK, and Python SDK to 3.2.0 and documents the subagent task tracker work that landed across #35–#41 + #38. Changes - Bump all five version files (core/sdk Cargo.toml, sdk/node/package.json, sdk/python/pyproject.toml) plus Node lockfiles and Cargo.lock. - Mark SubagentStatus #[non_exhaustive] so future variants are non- breaking. The Cancelled variant added in this release still counts as a breaking change for exhaustive matchers — flagged in the CHANGELOG. - Add a [3.2.0] section to CHANGELOG.md covering: the tracker query API, SubagentProgress emission, the Cancelled status and cancel_subagent_task entry point, Node + Python SDK exposure of all of the above, the regen-stable Node .d.ts split, and the TaskExecutor / register_task_with_mcp signature additions. - Extend README with a "What's new in 3.2" block and a Delegation table that lays out the observe + cancel API across Rust, Node, and Python. Preflight done locally - cargo fmt --all --check - cargo test -p a3s-code-core --lib (1661 passed) - cargo test -p a3s-code-core --tests (all green) - scripts/check_release_versions.sh (consistent at 3.2.0) - (cd sdk/node && npm run build:debug && npm test && npm run test:types) Not run here: release.sh / git tag. This commit is for review only; tagging + publishing happens after the PR lands.
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.
Summary
The `SubagentProgress` event variant existed but was never emitted — the tracker landed in #35 had no mid-task signal to update from. This PR fills that gap.
Adds `synthesize_subagent_progress()` in `tools/task.rs`, called by the mpsc → broadcast forwarder inside `TaskExecutor::execute_with_task_id`. Translates two child-loop events into compact progress milestones on the parent broadcast:
Noisy events (TextDelta / ToolStart / ToolOutputDelta / nested Subagent*) are intentionally not translated.
Test plan