Skip to content

[OMEGA-450] Fix: Cli numeric config - #381

Merged
TossSky merged 4 commits into
singnet:mainfrom
timur-ashkenov:fix/cli-numeric-config
Oct 8, 2026
Merged

TossSky merged 4 commits into
singnet:mainfrom
timur-ashkenov:fix/cli-numeric-config

Conversation

@timur-ashkenov

Copy link
Copy Markdown
Collaborator

Description

Fixes #359.
Parse numeric CLI settings as numbers while keeping string settings unchanged. Reject numeric options without a value.

How Has This Been Tested?

Reproduced the issue on main: starting Omega with maxFeedback=25000 failed with an arithmetic error.
Repeated the same scenario with the fixes: Omega ran for three iterations successfully. Also checked YAML configuration and missing values.
95 Python tests and 42 MeTTa checks passed.

Checklist

  • PR contains autogenerated code
  • Self-review completed
  • Test scenarios above are passed with the version of the code from PR

@TossSky

TossSky commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Tested: b0ed507 built into an image, with v0.1.20 as the control. Agent on the Anthropic provider and the websocket channel, numeric settings passed as key=value after the image name.

What I checked

  • The bug reproduces on v0.1.20: maxFeedback=25000 stops the boot with is/2: Arithmetic: `'25000'/0' is not a function, and sleepInterval=6 fails on the first sleep with sleep/1: Type error: `float' expected, found `'6'' (an atom).
  • With the PR, maxFeedback=25000 sleepInterval=0.5 maxOutputToken=6000 maxNewInputLoops=6 maxWakeLoops=1 boots and answers a websocket message, with no provider errors in the log.
  • The value is used as a number: with sleepInterval=6 the iterations that make no LLM call are 6 s apart (17 of 17), while with the default they are 1 s apart (109 of 109).
  • A bare maxFeedback stops the boot with maxFeedback requires a numeric value; use maxFeedback=<number>.
  • Integers with or without a sign, decimals and exponent forms become numbers. String settings keep their text (IRC_channel=001, IRC_channel=123), and a bare boolean flag stays True.
  • Autotests/unit/test_config.py: 19 passed, and 8 of them fail against config.py from main. The new block in tests/src_config.metta passes in the PR image and fails on v0.1.20.
  • CI on b0ed507 runs both: the file is listed in run_mandatory, its 19 tests pass in the mandatory phase (185 passed), and src_config.metta is OK.

Non-numeric values still fail with the old error

maxFeedback=abc stays a string, and the boot stops with is/2: Arithmetic: `abc/0' is not a function, which does not name the setting. 025000, 1_000, inf and an empty value also stay strings. _command_line_value falls back to the string for a setting it already knows is numeric. Raising the same ValueError as for the bare form would give a clear error here too. Not a blocker, since it behaved the same before the PR.

Verdict: PASS

@TossSky
TossSky merged commit b78c774 into singnet:main Oct 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[OMEGA-450] Command-line configuration values arrive as strings, so a numeric knob set there breaks arithmetic

3 participants