Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideIntroduces a revive-loop watchdog plugin that prevents indefinite DarkBot refresh loops by taking ownership of a pause after a configurable destroyed-state timeout and automatically releasing it once the ship is alive, with manifest registration and state-change logging. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
What do you mean with no changes? |
Sourcery withdrew this approval because the latest commits introduced blocking findings.
Sourcery withdrew this approval because the latest commits introduced blocking findings.
dm94
left a comment
There was a problem hiding this comment.
Automated Review
*This review was generated by an automated code analysis tool. The logic was verified against the actual DarkBot
dc48506543and DarkBotAPI0.9.8sources to confirm correctness against the bot's behavior lifecycle.
Logic Verification ✅
The core design is sound and well-researched:
- Pause trigger is correct: While destroyed,
GuiManager.canTickModule()returnsfalse(GuiManager.java:288–309), soonStoppedBehavior()runs instead ofonTickBehavior()even thoughbot.isRunning()remainstrue. ThedeadSincetimer accumulates as intended. - Manual pause preserved: If the user pauses the bot manually (
isRunning() == false),pauseForStuckLoop()returns early — no ownership taken, no resume. - Timer persists across refresh cycles:
RepairManager.tick()keepsdestroyed == truewhilehero.address == 0during game loading (RepairManager.java:115–121, 180–189), so the threshold counter correctly spans multiple refresh attempts. - Constructor injection pattern is valid — DarkBot supports direct singleton injection (
HeroAPI,BotAPI,RepairAPI).
Issues Requiring Changes
| enabledByDefault = true) | ||
| public class ReviveLoopWatchdog implements Behavior, Configurable<ReviveLoopWatchdog.Config> { | ||
|
|
||
| private static final Logger LOGGER = Logger.getLogger(ReviveLoopWatchdog.class.getName()); |
There was a problem hiding this comment.
Convention: Logger vs System.out.println()
This repo uses System.out.println() for all plugin logging (see AGENTS.md and all existing plugins: FixPetStuck.java:127, OreSeller.java:183, Autobuy.java:614, etc.). Using java.util.logging.Logger here is functionally fine but breaks the established convention.
Consider replacing with:
System.out.println("Revive Loop Watchdog: ...");to stay consistent with the rest of the SharedPlugin codebase.
|
|
||
| @Feature(name = "Revive Loop Watchdog", description = | ||
| "Detects the stuck-on-revive refresh loop bug, pauses the bot, and auto-resumes once it recovers.", | ||
| enabledByDefault = true) |
There was a problem hiding this comment.
enabledByDefault = true deviates from repo convention
No other feature in SharedPlugin has enabledByDefault = true. A behavior that globally pauses the bot on by default is a stronger commitment than anything else in this repo (even higher-risk features like SimpleGalaxyGate and OreSeller default to false).
Since the DarkBot core already refreshes at 90s stuck, consider setting enabledByDefault = false so users opt-in explicitly. This is a policy suggestion rather than a strict requirement — worth a discussion.
|




Adds a new feature under dev.shared.halizeur.revive_loop_watchdog.
Detects DarkBot's known stuck-on-revive refresh loop bug (see darkbot-reloaded/DarkBot #391, #455). If the ship stays destroyed continuously past a configurable threshold (default 3 min), it pauses the bot instead of refreshing indefinitely, then automatically resumes once the game finishes loading and the ship is confirmed alive again. Only takes ownership of the pause if the bot was actually running at the time (won't interfere with a manual pause). All state changes are logged.
Compiled and tested against darkbot-impl 0.9.8 / DarkBot dc48506543, matching this repo's pinned versions.
This is a split-out from #200 per dm94's request for one feature per PR. The second feature (Death Rate Profile Switcher) will follow in a separate PR.
Summary by Sourcery
Add a configurable watchdog that prevents DarkBot from endlessly refreshing during a stuck revive loop while preserving manual pauses and automatically recovering once the ship is alive.
New Features:
Enhancements:
Documentation: