feat: make AgentSwarm the preferred parallel path - #107
Merged
Merged
Conversation
A prompt-only nudge (v0.39.1-MB.1.41) did not change tool selection. The bias is structural: AgentSwarm could only express homogeneous item batches, its own description routed differently-shaped work to Agent, and the swarm-mode workflow reminder was off by default. - Reword the swarm choice as a MUST in agent.md, the explore profile, and both system prompts; drop the AgentSwarm "use separate Agent calls" redirect. - Add a `prompts` input to AgentSwarm so differently-shaped subtasks run as one swarm. - Default `default_swarm_mode` to true so new sessions start in swarm mode. - Drop the AgentSwarm sole-tool-call veto; it conflicted with the system prompt's parallel-tool-call directive.
default_swarm_mode = true made session create materialize the main agent in order to enter swarm mode, which broke the lazy-materialization invariant and 39 tests across node-sdk, kap-server, klient, and the vscode harness. Record the intent on the session swarm service instead, and let the main agent's swarm service enter swarm mode once when that agent is created; a resumed session still restores its own swarm state. Also fix the affected tests: set default_swarm_mode off where swarm state is incidental, and assert the new default where it is the subject.
The harness's file-import tests assert a fresh session's exact context. With default_swarm_mode now true, a fresh session starts in swarm mode and its reminder enters the history, so those assertions fail. Swarm state is incidental to these tests, so disable it in the fixture config.
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.
Related Issue
default_swarm_mode.Problem
After the 0.39.1 sync, the agent prefers a single sequential
Agentover the parallelAgentSwarmeven with swarm mode on. A review found the bias is structural in the two tool definitions, not the system prompt:AgentSwarmrequires ≥2 homogeneousitemsplus one{{item}}template, its own description told the model to "make separateAgentcalls" for differently-shaped tasks, and the swarm-mode workflow reminder was off by default.What changed
agent.md(both engines), theexploreprofile'swhenToUse, and both system prompts; theagent-swarm.mdline redirecting differently-shaped work toAgentis gone.AgentSwarmgained apromptsinput (≥2 distinct full prompts), so differently-shaped subtasks run as one swarm.default_swarm_modenow defaults totrue, so new sessions start in swarm mode.AgentSwarmsole-tool-call veto was removed (it conflicted with the system prompt's parallel-tool-call directive), and theagent-swarm-exclusive-denypolicy is deleted.Checklist
minor).Permission.md); regenerated the tool snapshots and the config manifest.