Repository navigation
feat: proactive background subagent delegation (TaskWait lifecycle, fixer, permission scopes) - #4
Merged
Conversation
…the running cap to 10
…t lifecycle Task starts a subagent and returns immediately with a delegation id; the parent keeps working and converges with TaskWait (all/any/minCompleted), inspects with TaskList, and stops with TaskStop. The runtime owns a per-session delegation registry and aborts leftover delegates at run end, on parent abort, or on dispose. The base prompt gains a Delegation section naming positive trigger patterns, and the Task description leads with them.
…ble fixer builtin explorer is rewritten in the omo-slim style (Grep for patterns, Glob for discovery, parallel searches, <files>/<answer> report shape). A fourth builtin, fixer, implements multi-file changes from a complete spec with Read/Glob/Grep/Edit/Write/Bash under permission: accept-edits.
…ermission scope ToolsExecuteParams gains an optional permissionScope; the permission resolver uses it instead of the session's effective mode for that call. The contract modes' hard deny and the external-path gate stay in force, so accept-edits auto-allows in-workspace Write/Edit while Bash and external paths keep the session's behavior.
… status TaskWait/TaskList/TaskStop share the delegation presentation but are not delegation activity items, so the topology card's subagent counts stay accurate. The stopped outcome is recognized and localized in en and zh-CN.
|
@Tioit-Wang is attempting to deploy a commit to the vastsa's projects Team on Vercel. A member of the Team first needs to authorize it. |
…, E2E-142) Spec §5f/§5f.1 (agent runtime) and §10.2 (tools and permissions) describe the non-blocking lifecycle, the permission scope and the new builtins; the decisions log and the E2E plan gain D228 and E2E-142; zh-CN mirrors follow.
Tioit-Wang
force-pushed
the
feat/proactive-subagents
branch
from
August 14, 2026 21:11
8f972cd to
1dae48c
Compare
This was referenced Sep 13, 2026
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.
What
Makes subagent delegation a proactive, first-class orchestration capability instead of a rarely-used context-saving tool. The main agent is taught when to delegate (system prompt triggers), can keep working while delegates run (non-blocking
Task), and gets a full lifecycle vocabulary to converge on demand.This is the PI-Desktop side of a comparison against Proma's collaboration design (same Pi runtime under the hood) — the key gaps were prompt engineering (no positive trigger patterns, defensive tool description) and blocking semantics (
Taskawaited the delegate, so the parent could never work in parallel).Changes
Taskis now non-blocking: starts a subagent in the background and returns adelegationIdimmediately. New Agent-mode core tools drive the lifecycle (ADR 0089):TaskWait(delegationIds?, mode?, minCompleted?, timeoutSeconds?)— converge on running delegations (mode: "any"for early convergence; settled delegations re-readable by id)TaskList()/TaskStop(delegationIds?)— inspect / stop## Delegationsystem-prompt section with positive trigger patterns: parallel exploration, adversarial review, multi-file implementation, context-economy searches, batch shardingTasktool description rewritten to lead with those triggersexplorerrewritten in the omo-slim style (tool-choice guidance, parallel searches,<files>/<answer>report shape)fixer— write-capable implementation specialist (Read/Glob/Grep/Edit/Write/Bash,maxTurns: 40,<summary>/<changes>/<verification>report)permission: inherit | ask | accept-edits | auto): the sidecar attaches the scope to the delegate'stools.executecalls and host-core resolves them under that mode instead of the session's mode. The contract modes' hard deny and the external-path gate stay in force.fixerships withaccept-edits— writes inside the workspace without prompting, Bash and external paths keep the session's behavior.MAX_SUBAGENT_CONCURRENCYbecomes a per-session running cap of 10 (was 4 per batch);Taskfails with a tool error when the cap is reached.TaskWait/TaskList/TaskStopshare the delegation presentation but are excluded from the topology's subagent counts;stoppedoutcome recognized and localized (en/zh-CN).Validation
pnpm -r --if-present typecheck— all packages passpnpm -r --if-present lint— pass@pi-desktop/shared— 246 tests pass@pi-desktop/agent-runtime— 200 tests pass (new lifecycle suite: background start, TaskWait convergence all/any, cap enforcement, turn-end abort, permission-scope wiring)@pi-desktop/desktop— 651 pass, 1 fail:plugin-fs-scope.test.mjsfails only on Windows (p.endsWith("out/report.md")against backslash paths) — byte-identical to upstream/main and untouched by this branch (upstream CI runs Linux)host-core— 252 pass incl. new delegate-scope RPC test; 4 failures are pre-existing Windows-only tests (path separators, PowerShell lacksseq) — all intools::tests, untouched by this branchvitepress build)Docs
Commits
feat(shared): permission scope on subagent definitions, cap 10feat(agent-runtime): background delegation behind TaskWait lifecycle (+ prompt triggers)feat(agent-runtime): omo-slim-style explorer + write-capable fixerfeat(host-core): per-definition permission scope ontools.executefeat(desktop): lifecycle tool presentation + stopped status (en/zh-CN)docs: ADR 0089, D228, E2E-142 (+ zh-CN mirrors)