Skip to content

fix(autostart.lic): block on dependency with Script.run before DR scripts#2315

Merged
mrhoribu merged 1 commit intoelanthia-online:masterfrom
MahtraDR:fix/autostart-dependency-script-run
May 6, 2026
Merged

fix(autostart.lic): block on dependency with Script.run before DR scripts#2315
mrhoribu merged 1 commit intoelanthia-online:masterfrom
MahtraDR:fix/autostart-dependency-script-run

Conversation

@MahtraDR
Copy link
Copy Markdown
Contributor

@MahtraDR MahtraDR commented May 6, 2026

Summary

  • #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:

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:

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

…cripts start

start_scripts_if_available only waits 0.25s for a script to complete.
dependency.lic takes longer, so parse_args() is still undefined when
autostart scripts begin. Script.run blocks until the script exits the
@@running list, guaranteeing the bridge is available.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

Warning

Rate limit exceeded

@MahtraDR has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 35 minutes and 14 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 646f96ce-bdba-40c1-81ee-ec3c6c7937a3

📥 Commits

Reviewing files that changed from the base of the PR and between 9a8a2f9 and 4a7206d.

📒 Files selected for processing (1)
  • scripts/autostart.lic
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mrhoribu mrhoribu merged commit f691c6d into elanthia-online:master May 6, 2026
4 checks passed
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