fix(autostart.lic): load dependency before DR scripts#2312
Merged
mrhoribu merged 1 commit intoelanthia-online:masterfrom May 6, 2026
Merged
Conversation
v0.68 moved the YAML autostart loop before the DR dependency block, causing tome/moonwatch/etc. to start before dependency.lic defines the parse_args() bridge function. Swap the blocks to restore the v0.67 ordering: dependency first, then user scripts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
📝 WalkthroughWalkthroughThe PR updates ChangesDragonRealms Dependency Prelude and Autostart Refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
mrhoribu
approved these changes
May 6, 2026
3 tasks
mrhoribu
pushed a commit
that referenced
this pull request
May 6, 2026
…ipts (#2315) ## Summary - [#2312](#2312) fixed the ordering (dependency before autostart scripts) but `start_scripts_if_available` is async -- it only waits 0.25s before moving on - `dependency.lic` takes longer than that, so `parse_args()` is still undefined when autostart scripts begin - Switches to `Script.run('dependency')`, which blocks until the script fully exits the `@@running` list ## Root cause `start_scripts_if_available` (lich-5 `global_defs.rb:42-57`) calls `start_script` then polls for up to 0.25s: ```ruby start_script(script_name) pause 0.05 snapshot = Time.now until !Script.running?(script_name) || Time.now - snapshot > 0.25 pause 0.05 end ``` `Script.run` (`script.rb:365-369`) blocks indefinitely until the script finishes: ```ruby def Script.run(*args) if (s = @@elevated_script_start.call(args)) sleep 0.1 while @@running.include?(s) end end ``` ## Test plan - [ ] Login to DR and verify dependency fully loads before tome/moonwatch start - [ ] Verify `parse_args()` errors no longer appear on startup - [ ] Verify non-DR games are unaffected (they skip the DR block entirely) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
dependency.licloadsparse_args(), a bridge function defined independency.lic:148that wrapsArgParser.new.parse_args(...)-- it is not provided by lich-5 coreRoot cause
v0.67 (correct order):
v0.68 (broken order):
Errors observed
Test plan
parse_args()errors no longer appear on startup🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Refactor