Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

test(cli): align Swarm skill e2e fixture with current CLI (#1636)

0xken15f36ba7149a70
diff --git a/cli/e2e/harness/fakeEngine.mjs b/cli/e2e/harness/fakeEngine.mjs
index 83a0475e7..257c40e5f 100644
--- a/cli/e2e/harness/fakeEngine.mjs
+++ b/cli/e2e/harness/fakeEngine.mjs
@@ -185,6 +185,12 @@ export async function run(engine, config = {}, { native = false } = {}) {
: `error: unexpected argument '${refused}' found\n\nUsage: codex [OPTIONS] [PROMPT]\n\nFor more information, try '--help'.\n`)
process.exit(engine === 'claude' ? 1 : 2)
}
+ // Resume checks for a live background job before opening a pane. This is a
+ // CLI query, not an agent launch: keep it out of the launch-argv ledger.
+ if (engine === 'claude' && args.length === 2 && args[0] === 'agents' && args[1] === '--json') {
+ process.stdout.write('[]\n')
+ return
+ }
// Every launch's argv, for a test to read what an agent was started with.
if (config.root) appendFileSync(join(config.root, 'launch-argv'), `${JSON.stringify({ engine, args })}\n`)
// The process table shows it as it shows the real CLI: named `claude` or `codex`, with the command line
diff --git a/cli/e2e/swarmLegacySkills.e2e.ts b/cli/e2e/swarmLegacySkills.e2e.ts
index 8e209eabb..dcdce3011 100644
--- a/cli/e2e/swarmLegacySkills.e2e.ts
+++ b/cli/e2e/swarmLegacySkills.e2e.ts
@@ -55,7 +55,7 @@ it('old Lead and worker restarts and stopped resume gain only their skill; perso
const launch = await until('restarted engine argv', () => argv().slice(before).find(row => row.engine === engine) ?? null, 30_000)
if (role) {
expect(launch.args.join(' ')).toContain(`swarm-${role}/SKILL.md`)
- expect(saved(ids[name]!).swarmSkill).toEqual({ role, key: ids[name] })
+ expect(saved(ids[name]!).swarmSkill).toEqual({ role, key: ids[name], mode: 'orchestration' })
} else {
expect(launch.args.join(' ')).not.toContain('/swarm/skills/')
expect(saved(ids[name]!).swarmSkill).toBeUndefined()
@@ -67,7 +67,7 @@ it('old Lead and worker restarts and stopped resume gain only their skill; perso
expect(resumed.error, JSON.stringify(resumed)).toBeUndefined()
const launch = await until('resumed worker argv', () => argv().slice(before).find(row => row.engine === 'claude') ?? null, 30_000)
expect(launch.args.join(' ')).toContain('swarm-dev/SKILL.md')
- expect(saved(ids.resumed!).swarmSkill).toEqual({ role: 'dev', key: ids.resumed })
+ expect(saved(ids.resumed!).swarmSkill).toEqual({ role: 'dev', key: ids.resumed, mode: 'orchestration' })
expect(readFileSync(join(cwd, '.harness', '.gitignore'), 'utf8')).toContain('runtime/')
expect(readFileSync(join(cwd, 'AGENTS.md'), 'utf8')).toBe('Project rules stay here\n')
expect(readdirSync(join(cwd, '.harness', 'runtime'))).toHaveLength(3)