Skip to content

Fix Gemini provider: honor configured model, repair fallback, surface… - #55

Open
AmirMTahmasbi wants to merge 4 commits into
YuvDwi:mainfrom
AmirMTahmasbi:claude/funny-johnson-3lly9m
Open

Fix Gemini provider: honor configured model, repair fallback, surface…#55
AmirMTahmasbi wants to merge 4 commits into
YuvDwi:mainfrom
AmirMTahmasbi:claude/funny-johnson-3lly9m

Conversation

@AmirMTahmasbi

Copy link
Copy Markdown

… 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

claude added 4 commits June 11, 2026 14:57
… 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
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.

2 participants