Skip to content

fix(recipe): reject non-finite values for declared float recipe settings - #233

Open
HeaTTap wants to merge 3 commits into
Human-Agent-Society:mainfrom
HeaTTap:fix/reject-non-finite-float-recipe-settings
Open

fix(recipe): reject non-finite values for declared float recipe settings#233
HeaTTap wants to merge 3 commits into
Human-Agent-Society:mainfrom
HeaTTap:fix/reject-non-finite-float-recipe-settings

Conversation

@HeaTTap

@HeaTTap HeaTTap commented Sep 4, 2026

Copy link
Copy Markdown

Motivation

Closes #225

Rejects NaN, positive infinity, and negative infinity for declared float recipe settings so invalid values fail fast during configuration resolution rather than silently altering sampling or blocking waits downstream.

Changes

  • In reef/recipe/config_fields.py, update _parse_float to check math.isfinite on parsed floats and raise RecipeConfigError if the value is non-finite.
  • In tests/reef_service/test_recipe_config_fields.py, add unit tests asserting NaN, positive infinity, and negative infinity are rejected from numeric config, string config, YAML, and environment fallback, while preserving parsing for valid finite numbers.

Compatibility and operational impact

None. Declared float recipe settings require finite numbers.

Verification

Ran:

  • pytest tests/reef_service/test_recipe_config_fields.py (41 passed)
  • python3 .github/scripts/check_python_design.py (passed)
  • python3 .github/scripts/check_python_statements.py (passed)
  • pre-commit checks on all files (passed)

AI assistance

None

Checklist

  • The change is focused and contains no unrelated cleanup.
  • Tests cover behavior changes, or this pull request does not change behavior.
  • Public interface changes include contract tests, or no public interface changes are present.
  • Affected user and developer documentation is updated, or no documentation update is required.
  • An accepted RFC is linked, or this change does not require an RFC.
  • Relevant pre-commit and test checks pass.
  • Non-trivial AI assistance is disclosed above, or none was used.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Merge Oncall: @BobbyZhouZijian

The merge oncall will route reviews and keep this pull request moving toward a clear decision.

@github-actions github-actions Bot added area: harness Harness integration, recipes, and evolution surfaces area: service Service APIs, deployment, and command-line interfaces labels Sep 4, 2026
@BobbyZhouZijian

Copy link
Copy Markdown
Contributor

Hi @HeaTTap , thanks for the PR. Could you resolve the CI failures?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: harness Harness integration, recipes, and evolution surfaces area: service Service APIs, deployment, and command-line interfaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Reject non-finite values for declared float recipe settings

2 participants