Skip to content

Comments

fix access priorities of each level in LeveledOptions (#1118)#6

Open
MitchLewis930 wants to merge 1 commit intopr_056_beforefrom
pr_056_after
Open

fix access priorities of each level in LeveledOptions (#1118)#6
MitchLewis930 wants to merge 1 commit intopr_056_beforefrom
pr_056_after

Conversation

@MitchLewis930
Copy link

@MitchLewis930 MitchLewis930 commented Jan 30, 2026

PR_056


Note

Low Risk
Small change to configuration option lookup order plus a targeted test; low risk but could affect how conflicting config values are resolved.

Overview
Fixes option resolution in LeveledOptions#[] so lookups prefer the most recently shifted/loaded option level (iterates @set in reverse), ensuring later config layers override earlier ones.

Adds a regression test verifying workers set via the DSL can be mutated/overwritten after load without being masked by earlier option layers.

Written by Cursor Bugbot for commit 8509829. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.


def [](key)
@set.each do |o|
@set.reverse_each do |o|
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flatten method uses inconsistent priority after [] change

Medium Severity

The [] method now uses reverse_each to give later levels higher priority (last wins), but the flatten method still uses forward @set.each with ||=, which gives earlier levels higher priority (first wins). This causes options[:key] and options.flatten[:key] to return different values when the same key exists in multiple levels, breaking consistency when flatten! is called.

Fix in Cursor Fix in Web

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.

2 participants