Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 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

Merge current upstream and preserve worker selection isolation

Rudy Celekli651126776ee4
diff --cc v3/@claude-flow/cli/src/commands/daemon.ts
index 981e44d994,a2e626067f..df4b35889c
--- a/v3/@claude-flow/cli/src/commands/daemon.ts
+++ b/v3/@claude-flow/cli/src/commands/daemon.ts
@@@ -13,6 -13,12 +13,10 @@@ import { dirname, join, resolve, isAbso
import { homedir } from 'os';
import * as fs from 'fs';
-// #1968 / #3547: shared validator for `--workers <list>`, used both when
-// reading the flag into DaemonConfig (below) and when forwarding it to the
-// forked background child's argv (startBackgroundDaemon). One pattern, one
-// place, so the two paths can't drift out of sync on what they accept.
++// Syntax guard for worker-name flags forwarded to a background child.
++// The start action validates the names against the daemon's supported workers.
+ const WORKERS_RE = /^[a-z][a-z0-9_-]*(,[a-z][a-z0-9_-]*)*$/;
+
// Start daemon subcommand
const startCommand: Command = {
name: 'start',
@@@ -133,6 -131,22 +129,15 @@@
}
}
- // #3547 (#1968 follow-up): `--workers` was forwarded to the forked
- // background child's argv (below, in startBackgroundDaemon) but never
- // read into DaemonConfig here, so WorkerDaemon always fell back to
- // DEFAULT_WORKERS (7 enabled) regardless of what was requested — in
- // both foreground mode (this same action, run directly) and background
- // mode (this same action, re-run in the forked child with --foreground
- // and the forwarded --workers flag).
- const rawWorkers = ctx.flags.workers as string | undefined;
- if (typeof rawWorkers === 'string' && rawWorkers.length > 0) {
- if (WORKERS_RE.test(rawWorkers)) {
- config.enabledWorkers = rawWorkers.split(',');
- } else if (!quiet) {
- output.printWarning(`Ignoring invalid --workers value: ${sanitize(rawWorkers)}`);
++ if (ctx.flags.workers !== undefined) {
++ try {
++ config.enabledWorkers = parseEnabledWorkers(ctx.flags.workers as string);
++ } catch (error) {
++ if (!quiet) output.printError((error as Error).message);
++ return { success: false, exitCode: 1 };
+ }
+ }
+
// Check if background daemon already running (skip if we ARE the daemon process)
//
// #2407 — without an atomic lockfile, N concurrent `daemon start` calls
diff --cc v3/@claude-flow/cli/src/services/worker-daemon.ts
index f49a22ca46,2bcb490eb1..9cdf553c2f
--- a/v3/@claude-flow/cli/src/services/worker-daemon.ts
+++ b/v3/@claude-flow/cli/src/services/worker-daemon.ts
@@@ -328,7 -323,8 +332,8 @@@ export class WorkerDaemon extends Event
aiWorkersEnabled: config?.aiWorkersEnabled
?? fileConfig.aiWorkersEnabled
?? (process.env.RUFLO_DAEMON_AI_WORKERS === '1'),
- workers: config?.workers ?? DEFAULT_WORKERS,
+ workers: (config?.workers ?? DEFAULT_WORKERS).map(worker => ({ ...worker })),
+ enabledWorkers: config?.enabledWorkers,
};
// #2935 — deferred from readDaemonConfigFromFile(): this.config (and