Problem
The Gemini provider currently converts every non-assistant role into user, so system messages are not preserved as system instructions.
Current behavior
GeminiProvider.createProviderRequest() maps roles like this:
assistant -> model
- everything else ->
user
That means any system message created by:
llm:chat-with-template
- manually injected history via
llm:set-history
- future prompt-steering features
is downgraded to a plain user message before it reaches Gemini.
Why this matters
System prompts are part of the extension’s advertised interaction model. Other providers preserve them, but Gemini currently does not. That creates provider-specific behavior differences for the same NetLogo code:
- template steering becomes weaker or inconsistent on Gemini
- system persona/history instructions are interpreted as ordinary user text
- cross-provider experiments are no longer comparable
Affected code
src/main/providers/GeminiProvider.scala
Suggested fix directions
- Handle
system prompts using Gemini’s dedicated instruction mechanism instead of flattening them into user messages.
- If Gemini requires a different request shape, split system instructions from conversational contents before serialization.
- Add provider-level tests covering a request with
system, user, and assistant messages so the serialized request can be validated without live API calls.
Problem
The Gemini provider currently converts every non-
assistantrole intouser, sosystemmessages are not preserved as system instructions.Current behavior
GeminiProvider.createProviderRequest()maps roles like this:assistant->modeluserThat means any
systemmessage created by:llm:chat-with-templatellm:set-historyis downgraded to a plain user message before it reaches Gemini.
Why this matters
System prompts are part of the extension’s advertised interaction model. Other providers preserve them, but Gemini currently does not. That creates provider-specific behavior differences for the same NetLogo code:
Affected code
src/main/providers/GeminiProvider.scalaSuggested fix directions
systemprompts using Gemini’s dedicated instruction mechanism instead of flattening them intousermessages.system,user, andassistantmessages so the serialized request can be validated without live API calls.