Skip to content

Enhance Rs2Walker route handling, gate traversal, and recovery logic#1817

Open
infuse21 wants to merge 9 commits into
chsami:developmentfrom
infuse21:development
Open

Enhance Rs2Walker route handling, gate traversal, and recovery logic#1817
infuse21 wants to merge 9 commits into
chsami:developmentfrom
infuse21:development

Conversation

@infuse21

@infuse21 infuse21 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Reduced long-route stalls by clearing interim targets when route progress goes stale.

Added immediate route-aligned continuation clicks after interim targets clear, so the walker keeps moving instead of waiting for idle recovery.

Made continuation clicks tail-exempt to avoid long routes hitting MAX_PROCESS_WALK_TAIL_ITERATIONS while still progressing.

Tightened interim pre-click distance to reduce rapid repeated clicking.

Changed minimap fallback behavior so outside-clip route clicks stay on the raw path instead of picking arbitrary reachable tiles away from the route.

Improved tight-room/door recovery by suppressing broad optimistic recovery when unresolved route doors are still nearby.

Avoided blacklisting fallback doors after wrong-way traversal, since the same door can become valid again after player movement.

Added faster failed-landing detection for adjacent same-plane shortcuts, including stepping stones that fail and move the player to the wrong tile.

Removed a new client-thread guardrail violation in the shortcut landing helper.

Regenerated the client-thread guardrail baseline after Rs2Walker lambda-name drift.

Added unit coverage for stale interim-target clearing.

Updated movement entity docs with the new walker gotchas and recovery

so far no issues

infuse21 added 6 commits July 6, 2026 17:06
…terim recovery

This PR hardens Rs2Walker against several movement stalls and route-object edge cases found during live walking tests.
Changes
•
Improved small gate / door detection on raw path segments.
•
Added generic detection for diagonal gate crossings, including corner cases where the smoothed path crosses a gate edge diagonally.
•
Prevented door-like catalog transports, such as Open Gate, from being incorrectly treated as generic transports.
•
Added pending door/gate scans before direct minimap clicks, route checkpoint clicks, interim movement waits, and unreachable recovery.
•
Expanded raw-path door scanning to include nearby previous raw edges when the player starts slightly off-path near a gate.
•
Added range gating before interacting with future door/gate objects so the walker does not mark a far-away gate as handled.
•
Fixed false “gate opened” handling where the walker clicked near a gate, failed to open it, but still treated it as successful.
•
Reworked post-door edge nudging so it only counts as successful if the player actually reaches or crosses the target door edge.
•
Added unresolved nudge logging with door_edge_nudge_unresolved.
•
Improved doorStillHasAction to rescan nearby/segment objects instead of relying only on the exact probe tile.
•
Added stale sticky interim cleanup:
◦
clears interim checkpoint when the player is already close enough
◦
clears expired interim checkpoints
◦
clears invalid interim checkpoints
◦
clears interim state on stall recalculation
•
Added interim_clear diagnostic logging.
•
Documented movement gotchas for gate edge handling and sticky interim cleanup in docs/entity-guides/movement.md.
•
Added unit tests for:
◦
diagonal gate segment detection
◦
wrong-neighbor door-edge nudge rejection
◦
successful door-edge nudge resolution
◦
stale interim checkpoint cleanup

currently Testing for regression
This PR adjusts Rs2Walker unreachable-tile recovery so it behaves better around tight door clusters.
Changes:
•
Suppresses broad optimistic minimap recovery when an unresolved door-like object is still present on the nearby raw route.
•
Adds a raw-path door scan before unreachable recovery clicks, using a small backtrack/lookahead window.
•
Logs door_recovery_suppressed when recovery is skipped because a nearby route door should be retried instead.
•
Stops session-blacklisting path-adjacent fallback doors after one wrong-way traversal.
•
Still keeps normal segment-door blacklisting behavior intact.
mproves Rs2Walker behavior on long routes and tight/shortcut-heavy paths.
Changes include:
•
Clear interim targets earlier when route progress goes stale, reducing visible stop/start pauses.
•
Issue immediate route-aligned continuation clicks when an interim target is reached, without consuming tail-loop budget.
•
Keep outside-minimap fallback clicks constrained to the raw path instead of choosing generic reachable tiles off-route.
•
Reduce interim pre-click distance to limit rapid re-clicking while still keeping movement flowing.
•
Detect failed adjacent same-plane shortcut landings faster, including stepping-stone style failures where the player settles on the wrong tile.
•
Add unit coverage for stale interim progress clearing.
•
Document movement gotchas for route fallback, stale interim targets, tail-exempt continuation clicks, and adjacent shortcut failures.
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f162624c-f2c4-4ae3-9e1c-1908041411de

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This PR extends Rs2Walker with new recovery heuristics: idle-nudge detection during active routes, stall-recalculation clicks, interim-target reach/expiry clearing, and gating for redundant segment probing near recent transports/doors. It adds door-like object classification distinguishing catalog transport edges from true doors, a door edge cross-nudge mechanism, and a post-handle object landing verifier. Minimap click handling gains raw-path fallback clicking and clickability checks, with shortened retry waits. Documentation, unit tests, and thread-safety baseline entries were updated accordingly. No public API signatures changed.

Possibly related PRs

  • chsami/Microbot#1811: Both modify Rs2Walker's handleDoors(...) and wallDoorTouchesSegment(...) to ensure correct blocked/on-path edge detection.
  • chsami/Microbot#1775: Both add catalog-backed transport edge/object detection to gate door-like scans in Rs2Walker.
  • chsami/Microbot#1769: Both modify the walker door-await/door-utils pipeline and related tests in the same door/action handling path.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main walker, gate traversal, and recovery changes in this PR.
Description check ✅ Passed The description aligns with the route-handling, recovery, docs, and test updates in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/Rs2Walker.java (1)

4438-4479: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Resolve impostors when checking whether the door action still exists.

Line 4477 uses the base composition, while the door probe path uses resolveCompositionForDoorProbe(...). For impostor-backed doors, this can read stale actions after interaction and incorrectly skip markStationaryDoorOpened(...) / edge nudging.

Proposed fix
-        ObjectComposition composition = Rs2GameObject.convertToObjectComposition(object);
+        ObjectComposition composition = resolveCompositionForDoorProbe(object);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/Rs2Walker.java`
around lines 4438 - 4479, The door-action validation in
doorStillHasAction()/doorObjectStillHasAction() is using the base
ObjectComposition, which can miss impostor-backed state changes after
interaction. Update the composition lookup to resolve the door via
resolveCompositionForDoorProbe(...) before calling getDoorAction(...), so checks
against action freshness use the same impostor-aware path as the probe logic and
don’t incorrectly suppress markStationaryDoorOpened(...) or edge nudging.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/Rs2Walker.java`:
- Around line 1248-1252: The active route idle nudge path in Rs2Walker is
resetting the stall clock even when the click does not cause movement, which can
delay the stall recovery logic. Update the handling around
shouldIssueActiveRouteIdleNudge(), tryIssueRouteRecoveryClick(), and the
lastMovedTimeMs update so that “active route idle nudge” clicks do not count as
movement unless actual position progress is detected, and keep the
isStuckTooLong() stall check able to run/recalculate promptly.
- Around line 2621-2635: Guard rawPath before using it in
tryIssueRouteContinuationClick: the current getClosestTileIndex(rawPath) call
can run when rawPath is null. Update the early return check in this method so it
also skips the raw-path lookup when rawPath is absent, while still allowing the
rest of the route-continuation logic to proceed. Keep the door-recovery check in
tryIssueRouteContinuationClick aligned with the existing “no raw path” behavior
and avoid forcing a failure path through the catch block.
- Around line 4986-4995: The door-action whitelist in isDoorLikeTransportAction
is missing several traversal actions already recognized by DOOR_ACTION_PRIORITY,
causing some catalog-backed door/gate rows to be misclassified. Update the
action check in Rs2Walker so it stays aligned with the priority list by
including the same door-traversal verbs (such as pay-toll, pick-lock,
climb-over, squeeze-through, and other matching variants) alongside the existing
open/pass/go-through/walk-through prefixes.

---

Outside diff comments:
In
`@runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/Rs2Walker.java`:
- Around line 4438-4479: The door-action validation in
doorStillHasAction()/doorObjectStillHasAction() is using the base
ObjectComposition, which can miss impostor-backed state changes after
interaction. Update the composition lookup to resolve the door via
resolveCompositionForDoorProbe(...) before calling getDoorAction(...), so checks
against action freshness use the same impostor-aware path as the probe logic and
don’t incorrectly suppress markStationaryDoorOpened(...) or edge nudging.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3e3ba561-fd07-48e6-a3e7-ee3be18468c7

📥 Commits

Reviewing files that changed from the base of the PR and between ee3efdf and 83b0813.

📒 Files selected for processing (4)
  • docs/entity-guides/movement.md
  • runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/Rs2Walker.java
  • runelite-client/src/test/java/net/runelite/client/plugins/microbot/util/walker/Rs2WalkerUnitTest.java
  • runelite-client/src/test/resources/threadsafety/client-thread-guardrail-baseline.txt

infuse21 added 3 commits July 7, 2026 01:21
his PR addresses review findings in Rs2Walker with minimal scoped changes.
Changes:
•
Prevent active route idle nudges from resetting lastMovedTimeMs, so failed nudge clicks do not delay stall recalculation.
•
Guard rawPath before raw-path door scanning in route continuation clicks.
•
Use impostor-aware door composition resolution when checking whether a door action is still present after interaction.
•
Align catalog-backed door transport action detection with DOOR_ACTION_PRIORITY, covering traversal actions like pay-toll, pick-lock, climb-over, squeeze-through, cross, and force.
Increased interim pre-click range when run is enabled so the walker queues the next movement earlier.
•
Added route-progress stabilization to prevent folded/switchback paths, such as White Wolf Mountain, from snapping back to an earlier nearby path branch.
•
Capped post-transport door scan timing so failed door probes do not consume long waits before movement resumes.
•
Added walker unit coverage for the switchback/backtracking regression.
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.

1 participant