π The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
TypeScript agentic-aiagentic-frameworkagentic-workflowagentsai-agentsai-assistantai-skillsautonomous-agentsclaudecodexdsh-pluginharnessmcp-servermulti-agentmulti-agent-systemsnpmskillsswarmswarm-intelligencetypescript
fix(ruflo-console): submit the mission plan from a file (Windows "command line is too long") (#4506)
Mario Jauvin64b4fb9768d1
diff --git a/plugins/ruflo-console/.claude-plugin/plugin.json b/plugins/ruflo-console/.claude-plugin/plugin.jsonindex 8c3ace2acb..d4db706fe7 100644--- a/plugins/ruflo-console/.claude-plugin/plugin.json+++ b/plugins/ruflo-console/.claude-plugin/plugin.json@@ -1,7 +1,7 @@{"name": "ruflo-console","description": "ruflo's cockpit inside Claude Code and the one /ruflo command for every ruflo mod (function hooks, early access). Views: overview with health alerts, swarm topology graph, claims flow with TTL rings, federation map, plugin health matrix, learning curve and pipeline, MetaHarness radar and audit trend, memory, cost gauge, agent timeline, approvals queue, event stream, a main menu, an x.ruv.io federation board, an AI terminal (codex, claude or both in remembered sessions, streamed), Skills (npx skills), a Hive-Mind view, a MetaHarness lab, agent drill-down; a command palette for confirm-gated actions through the ruflo CLI; a band above the prompt. Reads ruflo's files and the CLI's local JSON; anything not measured reads n/a. The one network call it makes by itself is a daily read of the published plugin.json at github.com/ruvnet/ruflo to offer an update (Settings \u2192 Updates: ask, auto, or off); it installs only through Claude Code's own claude plugin update, and never a new major version without asking.",- "version": "0.49.3",+ "version": "0.49.4","author": {"name": "ruvnet","url": "https://github.com/ruvnet"diff --git a/plugins/ruflo-console/CHANGELOG.md b/plugins/ruflo-console/CHANGELOG.mdindex bdd994df0d..d53e614ed6 100644--- a/plugins/ruflo-console/CHANGELOG.md+++ b/plugins/ruflo-console/CHANGELOG.md@@ -2,6 +2,9 @@Newest first. One `## <version> β <date>` heading per version, then `feat:`, `fix:`, `breaking:` and `chore:` bullets (ADR-478). Built from git history; older versions: `git log -- plugins/ruflo-console`.+## 0.49.4 β 2026-10-26+- fix: creating a mission no longer fails on Windows with "The command line is too long." The plan (about 7 KB, with about 750 quotes) was passed as one `mcp exec -p` argument, which passes cmd.exe's 8191-character line once Windows argv quoting escapes it; the goal's length did not matter. The plan now goes in a file under `.claude-flow/missions/` and is submitted with `ruflo mission plan --plan-file` (same service and answer as `mission_plan`). It is the same on every platform: the file is written through `write-via` (the host file API on Windows).+## 0.49.3 β 2026-10-25- fix: the install record for a plugin installed more than once no longer comes from another project (#4496). With no record for this folder and no user-scope record the console now reports "not installed here" instead of showing the first record's version and install folder, and among records that apply the one with the longest `projectPath` wins, so a record for the exact project beats one for a parent folder.diff --git a/plugins/ruflo-console/hooks/mission-create.ts b/plugins/ruflo-console/hooks/mission-create.tsindex d85eff8194..f94226fe19 100644--- a/plugins/ruflo-console/hooks/mission-create.ts+++ b/plugins/ruflo-console/hooks/mission-create.ts@@ -20,6 +20,8 @@ import { PROJECT, under } from './data/files'import { readAttempt, type Attempt, type RunRead } from './data/mcp-run'import { parseMissions } from './data/missions'import { parseTasks, plain, recordOf, type TaskRecord } from './data/parse'+import { writeFlavorReady } from './data/write-flavor'+import { writeVia } from './data/write-via'import { stageOf, toMissionPlan, type Profile } from './goap'import { checkLimit, MISSION_OBJECTIVE_MAX } from './full-text'import type { Host } from './host'@@ -29,6 +31,17 @@ import { CLI_PREFIXES, type State } from './state'export const argvOf = (state: State, tool: string, params: unknown): string[] => [...CLI_PREFIXES[state.options.cli], 'mcp', 'exec', '-t', tool, '-p', JSON.stringify(params)]+/**+ * The mission plan is ~7 KB with ~750 quotes, so as one `-p` argument it passes cmd.exe's 8191-character line once Windows argv quoting+ * has escaped it ("The command line is too long."). It goes in a file instead, read by `ruflo mission plan --plan-file` (same MissionService+ * as the mission_plan tool, same answer shape; the CLI prints the answer as bare JSON, with no `Result:` line).+ */+export const planFileOf = (state: State, stamp: string): string => under(state.cwd, `.claude-flow/missions/console-plan-${stamp}.json`)++export const planArgv = (state: State, params: { requestId: string; missionId: string; expectedRevision: number }, file: string): string[] => [+ ...CLI_PREFIXES[state.options.cli], 'mission', 'plan', '--mission', params.missionId, '--expected-revision', String(params.expectedRevision), '--request-id', params.requestId, '--plan-file', file,+]+export const taskType = (profile: Profile) => (profile === 'bugfix' ? 'bugfix' : profile === 'refactor' ? 'refactor' : profile === 'research' ? 'research' : 'feature')/**@@ -174,7 +187,24 @@ export function createSpec(state: State, host: Host, onDone: () => void): Actionif (ms <= 0) return outOfTime- const run = await within<RunRead>(host.run(argvOf(state, tool, params), ms + HOST_GRACE_MS).catch((error: unknown) => ({ error })), ms, { timedOutMs: ms })+ const start = async (): Promise<RunRead> => {+ if (tool !== 'mission_plan') return host.run(argvOf(state, tool, params), ms + HOST_GRACE_MS)++ const file = planFileOf(state, stamp)+ const written = await writeVia(await writeFlavorReady(), host, { kind: 'replace', path: file, text: JSON.stringify(body), hasDir: false })++ if (written.exitCode !== 0) return { error: new Error(`the plan file could not be written: ${written.stderr}`) }++ const run = await host.run(planArgv(state, params as { requestId: string; missionId: string; expectedRevision: number }, file), ms + HOST_GRACE_MS)++ // readAttempt reads what `mcp exec` prints after its `Result:` line; `mission plan` prints just the answer (JSON from a line-start brace;+ // a daemon notice such as `[INFO] Started β¦` may come before it). Output with no such answer is left as it is, for the failure reading.+ const answerAt = run.stdout.search(/^\{/m)++ return answerAt < 0 ? run : { ...run, stdout: `Result:+${run.stdout.slice(answerAt)}` }+ }+ const run = await within<RunRead>(start().catch((error: unknown) => ({ error })), ms, { timedOutMs: ms })return readAttempt(run, isDone)}diff --git a/plugins/ruflo-console/hooks/version.ts b/plugins/ruflo-console/hooks/version.tsindex b8407cd205..8c1e3b0b75 100644--- a/plugins/ruflo-console/hooks/version.ts+++ b/plugins/ruflo-console/hooks/version.ts@@ -2,4 +2,4 @@* The console's version, shown on the header so a person can tell which build is running. Kept equal to the plugin's manifest* (`.claude-plugin/plugin.json`); tests/version.spec.ts fails if the two drift.*/-export const CONSOLE_VERSION = '0.49.3'+export const CONSOLE_VERSION = '0.49.4'diff --git a/plugins/ruflo-console/scripts/smoke.sh b/plugins/ruflo-console/scripts/smoke.shindex 6a451563e5..4709092dd6 100755--- a/plugins/ruflo-console/scripts/smoke.sh+++ b/plugins/ruflo-console/scripts/smoke.sh@@ -11,9 +11,9 @@ step() { printf "β %s ... " "$1"; }ok() { printf "PASS\n"; PASS=$((PASS+1)); }bad() { printf "FAIL: %s\n" "$1"; FAIL=$((FAIL+1)); }-step "1. plugin.json declares ruflo-console 0.49.3"+step "1. plugin.json declares ruflo-console 0.49.4"grep -q '"name": "ruflo-console"' "$ROOT/.claude-plugin/plugin.json" \- && grep -q '"version": "0.49.3"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"+ && grep -q '"version": "0.49.4"' "$ROOT/.claude-plugin/plugin.json" && ok || bad "name/version"step "2. hooks.json names exactly one module and no classic hook commands"grep -q '"modules": \["./register.ts"\]' "$HOOKS/hooks.json" && ! grep -q '"command"' "$HOOKS/hooks.json" \diff --git a/plugins/ruflo-console/tests/fixtures/mission-cli-real.ts b/plugins/ruflo-console/tests/fixtures/mission-cli-real.tsindex 23b2cf5460..50662ef1ac 100644--- a/plugins/ruflo-console/tests/fixtures/mission-cli-real.ts+++ b/plugins/ruflo-console/tests/fixtures/mission-cli-real.ts@@ -56,8 +56,21 @@ export function hostOf(world: World, special: Special = () => undefined): Host {return {run: async (argv: readonly string[]) => {- const tool = argv[argv.indexOf('-t') + 1] as string- const params = JSON.parse(argv[argv.indexOf('-p') + 1] as string) as Record<string, unknown>+ // The plan goes in a file (`ruflo mission plan --plan-file`, which prints the bare answer JSON), not as an `mcp exec -p` argument.+ const viaFile = argv[argv.indexOf('mission') + 1] === 'plan'+ const flag = (name: string) => argv[argv.indexOf(name) + 1] as string++ // Anything else without `-t` is the plan file's write (the gnu and posix flavors write by argv).+ if (!viaFile && argv.indexOf('-t') < 0) return { exitCode: 0, stdout: '', stderr: '' }++ const tool = viaFile ? 'mission_plan' : (argv[argv.indexOf('-t') + 1] as string)+ const params = viaFile ? { requestId: flag('--request-id'), missionId: flag('--mission'), expectedRevision: Number(flag('--expected-revision')) } : (JSON.parse(argv[argv.indexOf('-p') + 1] as string) as Record<string, unknown>)+ const bare = (reply: Run): Run => {+ const marker = '\nResult:\n'+ const at = reply.stdout.indexOf(marker)++ return viaFile && at >= 0 ? { ...reply, stdout: reply.stdout.slice(at + marker.length) } : reply+ }const key = tool === 'task_create' ? `${tool}:${String((params.tags as string[])[1])}` : tool === 'task_cancel' ? `${tool}:${String(params.taskId)}` : toolconst nth = (seen.get(key) ?? 0) + 1@@ -67,29 +80,29 @@ export function hostOf(world: World, special: Special = () => undefined): Host {const out = await special(tool, params, nth, world)if (out instanceof Error) throw out- if (out !== undefined) return out- if (tool === 'mission_create') return answer(params, { ok: true, data: { missionId: ID, revision: 1, state: 'draft', deduplicated: false } }, tool, real('m-create'))- if (tool === 'mission_plan') return answer(params, { ok: true, data: { missionId: ID, revision: 2, state: 'planned', deduplicated: false, sequence: 2, planDigest: 'sha256:abc' } }, tool, real('m-plan-ok'))+ if (out !== undefined) return bare(out)+ if (tool === 'mission_create') return bare(answer(params, { ok: true, data: { missionId: ID, revision: 1, state: 'draft', deduplicated: false } }, tool, real('m-create')))+ if (tool === 'mission_plan') return bare(answer(params, { ok: true, data: { missionId: ID, revision: 2, state: 'planned', deduplicated: false, sequence: 2, planDigest: 'sha256:abc' } }, tool, real('m-plan-ok')))if (tool === 'task_create') {const taskId = make(params)- return answer(params, { ...world.store[taskId], priority: 'normal' }, tool)+ return bare(answer(params, { ...world.store[taskId], priority: 'normal' }, tool))}if (tool === 'task_cancel') {const task = world.store[String(params.taskId)]- if (task === undefined) return answer(params, { success: false, taskId: params.taskId, error: 'Task not found' }, tool, real('t-cancel-missing'))+ if (task === undefined) return bare(answer(params, { success: false, taskId: params.taskId, error: 'Task not found' }, tool, real('t-cancel-missing')))task.status = 'cancelled'- return answer(params, { success: true, taskId: params.taskId, status: 'cancelled', cancelledAt: new Date().toISOString() }, tool, real('t-cancel'))+ return bare(answer(params, { success: true, taskId: params.taskId, status: 'cancelled', cancelledAt: new Date().toISOString() }, tool, real('t-cancel')))}if (tool === 'mission_request_action') {world.mission = 'cancelled'- return answer(params, { ok: true, data: { missionId: ID, revision: 4, state: 'cancelled', deduplicated: false, sequence: 4 } }, tool, real('m-cancel-ok'))+ return bare(answer(params, { ok: true, data: { missionId: ID, revision: 4, state: 'cancelled', deduplicated: false, sequence: 4 } }, tool, real('m-cancel-ok')))}- return answer(params, { ok: true }, tool)+ return bare(answer(params, { ok: true }, tool))},fs: {read: async (path: string) => {@@ -101,6 +114,9 @@ export function hostOf(world: World, special: Special = () => undefined): Host {},stat: async () => undefined,list: async () => [],+ // The plan file's write where the host's file API does it (Windows); elsewhere it is an argv with no `-t` (handled in `run`).+ write: async () => undefined,+ exists: async () => false,},// The backoff waits go through the host's clock: recorded, and they return at once (after the test's hook). Read time limits never fire.after: (ms: number, fn: () => void) => {diff --git a/plugins/ruflo-console/tests/mission-control.spec.ts b/plugins/ruflo-console/tests/mission-control.spec.tsindex 36eb02e873..81871fd7bf 100644--- a/plugins/ruflo-console/tests/mission-control.spec.ts+++ b/plugins/ruflo-console/tests/mission-control.spec.ts@@ -13,19 +13,33 @@ import { missionPart } from '../hooks/views/bar'const ID = 'msn_0123456789abcdef01234567'const out = (data: unknown) => `[INFO] Executing tool\nResult:\n${JSON.stringify(data, null, 2)}\n[INFO] done`-type Calls = { runs: string[][]; prompts: string[]; fills: string[]; slashes: string[]; stored: Map<string, unknown> }+type Calls = { runs: string[][]; prompts: string[]; fills: string[]; slashes: string[]; stored: Map<string, unknown>; writes: string[] }function hostOf(calls: Calls, answer: (tool: string, params: Record<string, unknown>) => unknown = () => ({ ok: true })): Host {return {- run: async (argv: readonly string[]) => {+ run: async (argv: readonly string[], _ms?: number, stdin?: string) => {+ // The plan goes in a file (the gnu and posix write flavors take it on stdin) and is read by `mission plan --plan-file`, which prints the bare answer.+ if (argv[argv.indexOf('mission') + 1] === 'plan') {+ calls.runs.push([...argv])++ return { exitCode: 0, stdout: JSON.stringify(answer('mission_plan', {}), null, 2), stderr: '' }+ }+ if (argv.indexOf('-t') < 0) {+ if (stdin !== undefined) calls.writes.push(stdin)++ return { exitCode: 0, stdout: '', stderr: '' }+ }+calls.runs.push([...argv])const at = argv.indexOf('-t')- const tool = at >= 0 ? (argv[at + 1] as string) : ''- const params = at >= 0 ? (JSON.parse(argv[argv.indexOf('-p') + 1] as string) as Record<string, unknown>) : {}+ const tool = argv[at + 1] as string+ const params = JSON.parse(argv[argv.indexOf('-p') + 1] as string) as Record<string, unknown>return { exitCode: 0, stdout: out(answer(tool, params)), stderr: '' }},+ // Windows writes the plan file through the host's file API, the other flavors through argv with the text on stdin (above).+ fs: { write: async (_path: string, text: string) => void calls.writes.push(text), exists: async () => false, stat: async () => undefined },storeGet: async (key: string) => calls.stored.get(key),storeSet: async (key: string, value: unknown) => void calls.stored.set(key, value),invalidate: () => undefined,@@ -37,7 +51,7 @@ function hostOf(calls: Calls, answer: (tool: string, params: Record<string, unkn} as unknown as Host}-const fresh = (): Calls => ({ runs: [], prompts: [], fills: [], slashes: [], stored: new Map() })+const fresh = (): Calls => ({ runs: [], prompts: [], fills: [], slashes: [], stored: new Map(), writes: [] })const task = (id: string, status: string, tags: string[], extra: Partial<TaskRecord> = {}): TaskRecord => ({ id, type: 'feature', description: '', status, assignedTo: [], tags, ...extra })/** A mission of three tasks whose ruflo task ids are r1..r3: t1 β t2 β t3, with t2 and t3 both after t1. */@@ -152,11 +166,12 @@ describe('mission control: goal, plan, create', () => {expect(calls.runs).toEqual([]) // building the spec runs nothingawait spec.run?.()- const tools = calls.runs.map(argv => argv[argv.indexOf('-t') + 1])+ const tools = calls.runs.map(argv => (argv[argv.indexOf('mission') + 1] === 'plan' ? 'mission_plan' : argv[argv.indexOf('-t') + 1]))const tasks = mcOf(state).planned?.steps.length ?? 0expect(tools).toEqual(['mission_create', 'mission_plan', ...Array(tasks).fill('task_create')])- expect(calls.runs.every(argv => argv.includes('mcp') && argv.includes('exec'))).toBe(true)+ expect(calls.runs.every(argv => (argv.includes('mcp') && argv.includes('exec')) || (argv.includes('mission') && argv.includes('plan') && argv.includes('--plan-file')))).toBe(true)+ expect(calls.runs[1]?.join(' ')).not.toContain('"tasks"') // the plan is never an argument: it would pass the Windows command-line limitconst mission = activeMission(state) as MissionRecord@@ -167,9 +182,9 @@ describe('mission control: goal, plan, create', () => {expect(mission.events.map(event => event.seq)).toEqual([1, 2, 3])expect(calls.stored.get('mission-ledger')).toBeDefined()- const plan = JSON.parse(calls.runs[1]?.[calls.runs[1].indexOf('-p') + 1] as string) as { plan: { tasks: { executor: { mode: string } }[] } }+ const plan = JSON.parse(calls.writes[0] as string) as { tasks: { executor: { mode: string } }[] }- expect(plan.plan.tasks.every(candidate => candidate.executor.mode === 'session-bound')).toBe(true)+ expect(plan.tasks.every(candidate => candidate.executor.mode === 'session-bound')).toBe(true)})it('create stops and says why when the mission record refuses; no task is created', async () => {