feat: add Parallel Emission opt-in across protocol surfaces - #147
Open
spacexun2 wants to merge 4 commits into
Open
feat: add Parallel Emission opt-in across protocol surfaces#147spacexun2 wants to merge 4 commits into
spacexun2 wants to merge 4 commits into
Conversation
Register the agent-teams settings namespace (parallelToolCalls, default false) where the host provides the settings service, and branch the three protocol surfaces on the live value: the captain usage section reads it at assemble time, member personas freeze it at spawn, and assignment prompts read it at dispatch. The web client contributes a Plugins-tab checkbox card keyed by the namespace through type-only slot contracts, writing only parallelToolCalls and never the Agent Loop maxParallelToolCalls knob. Hosts without the settings service keep the serial protocol unchanged.
Pin the settings schema default, the persona/assignment/usage on and off branches, the type-only plugins-tab registration, and negative guards keeping maxParallelToolCalls out of this plugin. Drive a real create_task through the lifecycle harness to prove unknown dependency ids still fail loud, so same-response emission cannot smuggle forward references.
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
This implements Slice 1 — Parallel Emission of the split described in #62 (refs #62). Slice 2 (per-task probes, Next Probe At, Silent Kick / Captain Wake / Mailbox Wake) follows separately; nothing in that slice is touched here.
Parallel Emission is the opt-in ability for models that can emit several
agent_teams_*tool calls in one assistant message. It is a single boolean in the newagent-teamssettings namespace,parallelToolCalls, default off, surfaced as a 支持工具并行 checkbox on the plugin's Plugins-configuration card:agent-teamsnamespace with exactly one field (schema defaultfalse). Without the service (headless profiles, older hosts) the registration never happens, the switch readsfalse, and everything else is unaffected.create_taskcalls in one response; when off, the surfaces keep the serial protocol — member personas and assignment prompts are byte-identical to the previous text, and the usage section adds one explicit serial sentence ("Issue one agent_teams_* tool call per response ..."). Same-response calls still execute in order, so later creates can reference earlier ids from the same response — and dependency ids must still exist:create_taskrejects unknown dependencies exactly as before (pinned by a new lifecycle check; PR 通过消除 status 轮询和启用并行工具调用减少 token 浪费 #48's empty-dependency branch stays rejected).agent-teamsnamespace under thesettings.plugin.itemtype-only slot contract. Both client imports are type-only and all writes go through the cordissettingsScopeservice, so the bundle purity gate mechanically guarantees no cross-plugin value import. The checkbox is disabled when the namespace is not served or the settings document is read-only (memory mode). It never writesmaxParallelToolCalls— the Agent Loop execution pool stays on the Agent Loop card (negative source pins enforce this).Docs: one sentence in each README's Configuration section and a short section in
docs/usage.md.Validation
tsc -p tsconfig.json --noEmit,tsc -p tsconfig.client.json --noEmit, and the full build (clean-build+ bothtscpasses +tsdown, including the client bundle purity gate) pass.node scripts/verify.mjs: all 184 checks pass, including new pins for the settings schema default ({}resolvesparallelToolCalls: false), persona / assignment / usage on-vs-off branches, the type-only Plugins-tab registration keyed by the namespace, and negative guards keepingmaxParallelToolCallsout of this plugin's sources.node scripts/lifecycle-verify.mjsdrives the real compiledcreate_taskwith a never-created dependency id and asserts it fails loud (no forward references).fallback-tdd,member-failure-tdd(both harness modes),quality-gates-tdd,harness-compat-tdd,web-routes-verify,release-metadata,http-body,compatibility,doctor, andstress-verifyall pass;node --test scripts/compatibility.test.mjsadditionally skips its doctor-bin-symlink case on this machine (EPERM: operation not permitted, symlink— Windows without symlink privilege), reproduced identically on cleanmain.lifecycle-verifychecks (unfinished captain takeover returns to a member when the captain becomes idle,activity refines residency through the live Agent registry) fail intermittently on this machine on cleanmainas well (reproduced in a pristine worktree, plain and--modern-harnessvariants) — pre-existing timing flakiness, unrelated to this branch.Slice 2 follow-up will cover the per-task probe clock and the protocol rewrites around polling, wake, and end-of-turn.