fix: reject empty self_fusion.temperature_spread at config load - #148
Open
shrdgn wants to merge 1 commit into
Open
fix: reject empty self_fusion.temperature_spread at config load#148shrdgn wants to merge 1 commit into
shrdgn wants to merge 1 commit into
Conversation
An empty list loads fine but crashes every self_fusion request with an unhandled ZeroDivisionError in panel.py's `spread[index % len(spread)]` lookup. Require at least one entry so this fails fast and clearly at config load instead of mid-request. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EdA4xCCD6tTs2Z1atpfdB7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
SelfFusionConfig.temperature_spread(openfusion/config.py) accepted an empty list with no validation. A config likeself_fusion: {temperature_spread: []}— a plausible attempt to disable temperature variation — loads without error, but crashes everyself_fusionrequest deep insidepanel.py:This adds
min_length=1to the field so an empty list fails fast and clearly at config load (aValidationError), instead of crashing mid-request with an unhandledZeroDivisionError.How it was tested
ruff check .passes (new code only — two pre-existing formatting diffs elsewhere in the touched files are unrelated to this change and left as-is)pytest -qpasses (no live network) — rantests/test_config.pyandtests/test_panel.pytest_self_fusion_rejects_empty_temperature_spread)bench/run.pynumber — not applicable, this is a validation-only fix with no behavior change for valid configsNotes for reviewers
Found via an automated repo-review scheduled task. Scoped narrowly to the validation gap; no other behavior changes.
Generated by Claude Code