Skip to content

feat(agent): continue completed subagent tasks - #580

Open
changer-changer wants to merge 1 commit into
OpenBMB:mainfrom
changer-changer:feat/subagent-resume
Open

changer-changer wants to merge 1 commit into
OpenBMB:mainfrom
changer-changer:feat/subagent-resume

Conversation

@changer-changer

@changer-changer changer-changer commented Sep 13, 2026

Copy link
Copy Markdown

Following up on a subagent currently starts a new child without its earlier tool history. This adds an optional task_id argument to the agent tool so a completed child can continue with a new instruction, including after the owning parent session is reloaded.

The native runtime restores the child's durable messages, keeps its identity and last-used provider/model, and applies the parent's current permissions. Sidechain transcripts now record terminal results and compaction boundaries, with sequence state restored before appending another round. The tool returns the resumable id in its text and JSON result.

Unknown, foreign, busy, corrupt, incomplete and failed tasks return explicit errors. A removed model also fails rather than silently switching. Custom fork hosts must opt in to continuation support, so older hosts cannot accidentally interpret task_id as a fresh task. See the continuation contract for supported boundaries and examples of failure cases.

Validation:

  • Production TypeScript build passed.
  • Full backend run with test concurrency limited to 4: 565 passed, 0 failed, 7 cancelled, 2 skipped. The seven cancellations are the existing networkFetch tests also observed on the baseline; those files are unchanged.
  • 35 continuation-focused tests cover replay, compaction, model routing, input validation, ownership, concurrency, permissions and legacy hosts.
  • A deterministic native-gateway probe read a file, deleted it, recreated the gateway, changed the default model and successfully continued the same child from persisted tool history. Separate routing checks verify that the actual selected model is saved and continuation bypasses automatic re-routing.
  • Local integration with feat(agent): configure subagent roles and model bindings #576 and feat(settings): expose subagent execution timeout #579 passed 93 relevant tests and a gateway probe covering custom roles, changed model bindings, narrowed tools and disabled roles. The PR itself is based directly on main; shared fork-path conflicts will need resolving if feat(agent): configure subagent roles and model bindings #576 merges first.

This is the continuation part of the subagent work, submitted separately for review. The gateway probes use scripted model responses; no model-quality or speed improvement is claimed from them.


Merge sequencing (added 2026-09-14)

This PR is one of four coordinated subagent-lifecycle PRs (#579, #576, #580, #581). The features are semantically independent but overlap textually in the agent core, so an explicit merge order is proposed in #583.

Proposed order: #579#576#580#581 (this PR: 3).

This branch's known conflicts: clean against current main; 4 core files with #576, 1 file with #581 (agent.ts). Already validated merged together with #581 on the integration branch referenced in the tracking issue.

After each sibling PR merges, I will rebase the remaining branches onto main and re-run the targeted test suites before updating the PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant