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

fix(config): parse signed and scientific numeric values

Rudy Celeklic00585f7bfa5
diff --git a/tests/config-numeric-scalars.test.mjs b/tests/config-numeric-scalars.test.mjs
new file mode 100644
index 0000000000..4c18951756
--- /dev/null
+++ b/tests/config-numeric-scalars.test.mjs
@@ -0,0 +1,10 @@
+import test from 'node:test';
+import assert from 'node:assert/strict';
+import { parseConfigValue } from '../v3/@claude-flow/cli/src/services/config-file-manager.ts';
+test('numeric configuration values preserve JSON number semantics', () => {
+ for (const value of ['-1', '-0.5', '1e3', '1E-3', ' 42 ']) assert.equal(parseConfigValue(value), JSON.parse(value));
+});
+test('non-numeric strings and existing structured scalars retain their semantics', () => {
+ for (const value of ['auto', 'Infinity', 'NaN', 'host']) assert.equal(parseConfigValue(value), value);
+ assert.deepEqual(parseConfigValue('[1,2]'), [1,2]); assert.equal(parseConfigValue('false'), false); assert.equal(parseConfigValue('123'), 123);
+});
diff --git a/v3/@claude-flow/cli/src/services/config-file-manager.ts b/v3/@claude-flow/cli/src/services/config-file-manager.ts
index 4e5f4d84e9..94f2463ada 100644
--- a/v3/@claude-flow/cli/src/services/config-file-manager.ts
+++ b/v3/@claude-flow/cli/src/services/config-file-manager.ts
@@ -282,7 +282,7 @@ export function parseConfigValue(value: string): unknown {
if (/^\d+\.\d+$/.test(value)) return parseFloat(value);
try {
const parsed = JSON.parse(value);
- if (typeof parsed === 'object') return parsed;
+ if (typeof parsed === 'object' || (typeof parsed === 'number' && Number.isFinite(parsed))) return parsed;
} catch { /* not JSON, use as string */ }
return value;
}