Fix Gemini provider: honor configured model, repair fallback, surface… - #55
Open
AmirMTahmasbi wants to merge 4 commits into
Open
Fix Gemini provider: honor configured model, repair fallback, surface…#55AmirMTahmasbi wants to merge 4 commits into
AmirMTahmasbi wants to merge 4 commits into
Conversation
… feedback
The async LLM path (the one /steve tell actually uses) ignored the configured
model and always called the now-deprecated gemini-1.5-flash endpoint, so every
plan request failed and Steves fell back to idle-follow.
- AsyncGeminiClient: resolve the model from request params (i.e. config) instead
of the value hardcoded at construction; guard against non-Gemini model names;
disable "thinking" for 2.5 Flash so it doesn't exhaust the token budget on
hidden reasoning and return an empty MAX_TOKENS response.
- TaskPlanner: pass the configured Gemini model instead of hardcoding
gemini-1.5-flash.
- LLMFallbackHandler: emit responses in the schema the parser/actions expect
(args nested under "parameters", correct keys) so fallback tasks aren't
silently dropped; unmatched input now yields no tasks instead of an
unsupported "wait" action.
- Add a minimal server->client network channel so agent feedback ("Thinking...",
errors) generated server-side actually reaches the client side panel.
https://claude.ai/code/session_01BzsDCjkSNZ6TPaMrkKv9JJ
resilience4j, caffeine and commons-codec were declared as `implementation`
dependencies but never packaged into the mod jar, so they were absent at
runtime in a real Minecraft install. The first user command lazily builds
TaskPlanner -> ResilientLLMClient/LLMCache, which threw NoClassDefFoundError
("Sorry, I'm having trouble with my AI systems!") and prevented any planning.
Add the Shadow plugin and bundle those small libraries into the jar via a
dedicated `shade` configuration; the shaded jar is reobfuscated and becomes
the default mod artifact. GraalVM is intentionally left out (large, and not
used on the runtime agent path).
https://claude.ai/code/session_01BzsDCjkSNZ6TPaMrkKv9JJ
The NoClassDefFoundError that silently broke ALL planning came from TaskPlanner building LLMCache (Caffeine) and ResilientLLMClient (resilience4j) in its constructor. Forge's module classloader never places these `implementation` libraries on the runtime classpath, so the planner threw before any LLM call — in dev (runClient) and in the installed jar alike. Bundling them was fighting the module system. Fix: TaskPlanner now uses the plain async HTTP clients directly (java.net.http + Gson only, zero external deps) and keeps the dependency-free LLMFallbackHandler for graceful degradation when a call fails. The resilience/cache classes remain in the tree (compileOnly) but are no longer loaded at runtime. Also reverts the Shadow bundling from the previous commit (which caused the launch crash) and moves the heavy libs to compileOnly. https://claude.ai/code/session_01BzsDCjkSNZ6TPaMrkKv9JJ
Primary fix (stuck on "Thinking..."): SteveCommands.tellSteve ran processNaturalLanguageCommand on a freshly spawned thread, but the planning fields (isPlanning/planningFuture) are read by the entity tick thread. Being non-volatile, the completed plan was sometimes never observed, so the panel stayed on "Thinking..." forever. planTasksAsync is already non-blocking, so run it directly on the server thread and mark the shared fields volatile. Combat/hunting: - "hunt an animal" returned attack target "hostile", which only matches Monsters; with no monsters around the Steve stood still for the full 30s and then reported SUCCESS. CombatAction now matches passive Animals for "animal", reports failure honestly when nothing was hit, and gives up within ~5s (with feedback) when there is no valid target nearby. - PromptBuilder now instructs the model to target a specific animal or "animal" when hunting for food, instead of always "hostile". https://claude.ai/code/session_01BzsDCjkSNZ6TPaMrkKv9JJ
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.
… feedback
The async LLM path (the one /steve tell actually uses) ignored the configured model and always called the now-deprecated gemini-1.5-flash endpoint, so every plan request failed and Steves fell back to idle-follow.
https://claude.ai/code/session_01BzsDCjkSNZ6TPaMrkKv9JJ