Uh oh!
There was an error while loading. Please reload this page.
feat(runtime): open linked subagents while spawn is still running - #2408
Closed
Astro-Han wants to merge 12 commits into
Closed
feat(runtime): open linked subagents while spawn is still running#2408Astro-Han wants to merge 12 commits into
Astro-Han wants to merge 12 commits into
Conversation
Astro-Hanforce-pushed
the
feat/midflight-subagent-open
branch
from
August 7, 2026 07:42
6e09e8f to
a10d42fComparePublish a live-only tool_result_preview when a linked child becomes ready so SubagentPreview can show Open before the durable tool_result commits. Keep preview projection in-flight, map the event as a partial tool heartbeat, and leave swarm/batch paths untouched.
Rebase onto main for headless format drift. Assert linked-child ready includes permissionMode and that ToolRuntime always wraps spawn with onReady for live tool_result_preview.
#2406 deleted the contract tests that imported these helpers; knip on the desktop workspace then failed the typecheck lane for every PR on main.
Astro-Hanforce-pushed
the
feat/midflight-subagent-open
branch
from
August 7, 2026 07:45
85d4d2a to
bacacb4CompareLinked single-spawn Open is in scope; agent_swarm batch ready must not publish a subagent preview that rewrites the parent swarm tool card.
Publish kind:agent_swarm tool_result_preview from batch start through item ready so AgentSwarmPreview can show every row and Open as soon as childSessionId exists. One buildAgentSwarmContent path owns live and settled shapes; spawn still skips subagent previews for swarm tags.
Project live/settled agent_swarm results into a collapsed ChatToolCalls group — one CallRow per item with status — instead of AgentSwarmPreview. Activating a ready child row opens that child session.
Astryx multi-call groups show the latest child name when folded. Render agent_swarm as a single outer CallRow named Agent Swarm, with per-item rows nested in its expand detail instead.
Use a product header named Agent Swarm that expands into flat Astryx CallRows per item. Drop the nested outer-CallRow-plus-inner-group that forced two expand hops.
Drop the product header shell and CSS. Live/settled swarm items map to one ChatToolCalls group; fold chrome stays Astryx's.
CallRow name is the tool kind; put agentName/profile in target so rows
read like agent_spawn ("Agent · Local Read") instead of a fake tool
named after the preset.Mid-flight Open needs structured live facts (childSessionId / swarm items) to reach Desktop. Wire tool_result_preview as a first-class continuity transient with retained latest-per-toolUseId seed on rejoin, keep durable agent_swarm decode terminal-only, project swarm through one Astryx multi-call path, and stabilize ordinary ToolTrow keys so live membership growth does not collapse expanded rows.
Live mid-flight Open only needs identity and status, not full ToolResultContent bulk. Introduce ToolResultPreviewContent (subagent/agent_swarm open-facts), publish it through buildAgentSwarmPreviewContent and a single preview event shape, enforce durable terminal-only decode, fix protocol subpath import, and materialize open-facts into activity rows with empty summary/artifacts.
Astro-Han
commented
Aug 8, 2026
ContributorAuthor
Closing to rewrite on current main. #2384 removed the sync agent_swarm multi-call path this branch was built on (live open-facts / flat CallRows). Post-#2384 main uses async graph swarm + agent_swarm_status; a mechanical rebase is not the right shape. Will reopen from latest main with a design that matches the current spawn_subagent / ToolTrow + SubagentPreview presentation and the async swarm model. |
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 freeto 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
After a linked subagent or swarm batch is ready, the parent stream used to only show stdout progress until the durable tool result settled. Expand could show logs, but Open waited on that settle.
This PR adds live-only
tool_result_previewSessionEvents so existing previews can show Open mid-flight:kind: subagentpreview when the child becomes ready (ToolRuntimewrapsonReady).kind: agent_swarmsnapshots from batch start (all items listed) through item start/ready/terminal, built by a singlebuildAgentSwarmContentpath shared with durable settlement. Per-item Open appears as soon aschildSessionIdexists.tool_result; previews neverappendMessage.Swarm-tagged spawns still do not emit
kind: subagentpreviews (those would overwrite the batch snapshot). Open still navigates into the live child session chat (titlebar project › parent › child).Out of scope: host-join dual authority, durable reconnect of previews, linked edit/revise, async Graph (#2384) status panel.
Refs the mid-flight gap after #2383.
Verification
npm run build --workspace @maka/core --workspace @maka/ui --workspace @maka/runtimenode --test --test-concurrency=1 packages/core/dist/__tests__/agent-swarm-result.test.jsnode --test --test-concurrency=1 packages/runtime/dist/__tests__/tool-runtime-settlement.test.jsnode --test --test-concurrency=1 packages/runtime/dist/__tests__/agent-swarm-tools.test.jsnode --test --test-concurrency=1 packages/ui/dist/__tests__/live-turn-projection.test.jsnode --test --test-concurrency=1 packages/ui/dist/__tests__/subagent-open-session.test.jsReview focus
tool_result_previewstays live-only (event stream, notappendMessage)buildAgentSwarmContent(snapshot copy of items)kind: subagentpreviewsqueued/runningare mid-flight; settle still terminal-only in practice