Repository navigation
fix(ClueSolverPlugin): resolve cipher clue location on client thread (1.0.8) - #658
Merged
chsami merged 1 commit intoOct 19, 2026
Conversation
…(1.0.8) CipherClueTask.walkToLocation runs on the script executor and called CipherClue.getLocation directly. For the Eluned cipher the location provider calls Quest.getState, which asserts the client thread and threw IllegalStateException, failing the task. Resolve the location through runOnClientThreadOptional and keep the null check for a clean failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LjtEMzQHGuq4M1Mpqk9pPV
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
Error telemetry group 2647 reported 2 occurrences in 1 report, on ClueSolverPlugin 1.0.7 with Microbot 2.6.34. Logger:
ClueTask. Thread:pool-12-thread-1.Root cause
ClueSolverScript.startClueTaskrunstask.run()on the script executor, not on the client thread.CipherClueTask.walkToLocationcalledclue.getLocation(clueScrollPlugin)directly. For the Eluned (Prifddinas) cipher clue, RuneLite'sCipherCluegets the location from a provider that callsQuest.getState. That method only works on the client thread, so the call threw and the task failed before it started walking.Change
CipherClueTask.walkToLocationnow reads the location withMicrobot.getClientThread().runOnClientThreadOptional(() -> clue.getLocation(clueScrollPlugin)).orElse(null). This is the same patternClueTask.getPlayerLocationSafeuses. If the read throws or times out, the existing null check fails the task cleanly. The walker call still runs off the client thread.onGameTickis unchanged, because it already runs on the client thread.ClueSolverPluginversion goes from 1.0.7 to 1.0.8.Validation
CipherClueTaskTest:locationIsResolvedOnClientThreadBeforeWalking: the mockedgetLocationthrows "must be called on client thread" unless it is called insiderunOnClientThreadOptional. The test checks that the walker receives the location. With the fix stashed, this test fails, so it reproduces the bug.missingLocationFailsTaskWithoutWalking: a null location completes the task withfalseand never calls the walker../gradlew test --tests 'net.runelite.client.plugins.microbot.cluesolver.*': all cluesolver tests pass (Cipher 2/2, Anagram 3/3, RequirementHandler 5/5)../gradlew build -PpluginList=ClueSolverPlugin: BUILD SUCCESSFUL, andPluginManifestVersionTestpasses.Known gaps
getLocationfrom the executor (Cryptic, Emote, FairyRing, HotCold, and the Anagram, Coordinate, Map and Music constructors). Their RuneLite location providers only use static data orgetVarbitValue, so they don't hit this assertion today. They were left alone to keep this PR small.AnagramClueTask.handleDialoguecallsclue.getAnswer(...)from a background executor. For the 'EEK ZERO OP' anagram, the answer provider callsQuest.EAGLES_PEAK.getState. This hasn't shown up in telemetry yet and is tracked as a follow-up.🤖 Generated with Claude Code
https://claude.ai/code/session_01LjtEMzQHGuq4M1Mpqk9pPV