fix(config): comment out default max_steps/planner_max_steps in rendered project config#4228
Merged
esengine merged 1 commit intoJun 15, 2026
Conversation
…red project config Fixes esengine#4166 When planner_max_steps=0 is set in global config (e.g. via Desktop Settings), the project-level reasonix.toml generated by RenderTOML always wrote planner_max_steps=12 as an explicit value. Since project config has higher priority than global config in LoadForRoot(), the project's 12 silently overrides the user's 0. Comment out max_steps and planner_max_steps when they equal Default() values, same pattern already used for system_prompt, language, etc.
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.
Fixes #4166
Problem
When a user sets
planner_max_steps = 0in global config (e.g. via Desktop Settings), the project-levelreasonix.tomlgenerated byRenderTOMLalways writesplanner_max_steps = 12as an explicit value. Since project config has higher priority than global config inLoadForRoot()(flag > ./reasonix.toml > ~/.config/reasonix/config.toml > defaults), the project's12silently overrides the user's0.The same structural issue affects
max_steps, though it is currently harmless since both default and written value are0.Root Cause
render.go:167-168unconditionally wrote explicit values formax_stepsandplanner_max_steps, even when they equal built-in defaults. This created a project-level override that defeated user global settings.Fix
Comment out
max_stepsandplanner_max_stepswhen they equalDefault()values — same pattern already used forsystem_prompt,language,system_prompt_file, etc. in the same function.Before (always written):
After (commented out when at defaults):
Non-default values are still written explicitly, so intentional project-level overrides work as before.
Tests
TestRenderTOMLDefaultStepsCommentedOut— defaults render as comments in[agent]sectionTestRenderTOMLNonDefaultStepsWrittenExplicitly— non-defaults render as active TOMLTestRenderTOMLDefaultStepsDoNotOverrideGlobalConfig— proves the bug is fixed: project config with commented-out defaults does not override globalplanner_max_steps=0TestRenderTOMLRoundTripsto use non-default step values (consistent with other fields likelanguage,theme, etc.)Files Changed
internal/config/render.go— conditional comment-out for default step valuesinternal/config/render_test.go— 3 new tests + round-trip test update