Repository navigation
fix(TowerOfLifeCC): run summon query on client thread (1.1.5) - #653
Merged
chsami merged 1 commit intoOct 18, 2026
Merged
Conversation
The summoned-creature lookup filtered NPCs on Actor.getInteracting(), which asserts the client thread, but the query was evaluated by nearest() on the script executor inside sleepUntil, throwing IllegalStateException "must be called on client thread" and never detecting the summoned creature. Evaluate it with nearestOnClientThread(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LjtEMzQHGuq4M1Mpqk9pPV
3 tasks done
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.
Problem
Client error telemetry group 2590 (6 occurrences, Microbot 2.6.33, TowerOfLifeCC 1.1.4, thread
TowerOfLifeCCScript-N) reports:Each poll inside the 5s
sleepUntilthrows, so summoned-creature detection never succeeds while it fails.Root cause
The summon query in
HandleCreaturefilters with rawnpc.getNpc().getInteracting(), which asserts the client thread. It skips the thread-safeRs2ActorModel.getInteracting()wrapper..nearest()evaluates that predicate on the script executor thread.Change
findSummonedCreature(). The filter is unchanged, and the method now ends with.nearestOnClientThread(), the existing client helper (Microbot.getClientThread().invoke(() -> nearest())). This runs the filter and the distance pass in one client-thread hop.sleepUntilcalls the new method. If the invoke fails it returns null, which keeps polling, the same as the old "not found yet" behaviour.TowerOfLifeCCPluginversion from 1.1.4 to 1.1.5.Validation
TowerOfLifeCCSummonQueryTest(3 cases) uses a mocked NPC whosegetInteracting()throws unless it is reached through the client-thread path. The cases: the query usesnearestOnClientThreadand never callsnearest(); a creature targeting the local player is accepted; a creature targeting another actor is rejected..nearest()back makes all 3 tests fail with the productionIllegalStateException.PluginManifestVersionTestpassed, andbuild -PpluginList=TowerOfLifeCCPluginsucceeded.Known gaps
nearestOnClientThreaditself, so it checks which method is called and does not exercise the real client-thread hop.🤖 Generated with Claude Code
https://claude.ai/code/session_01LjtEMzQHGuq4M1Mpqk9pPV