NetLogo / NetLogo/Netlogo-LLM-Extension
bug: Gemini provider drops system-message semantics
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 1
- Forks
- 0
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 4
Description
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
systemprompts using Gemini’s dedicated instruction mechanism instead of flattening them intousermessages. - 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, andassistantmessages so the serialized request can be validated without live API calls.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/main/providers/GeminiProvider.scala at GeminiProvider.createProviderRequest(), then inspect how Gemini serializes system, user, and assistant roles. Add provider-level coverage for all three message types without live API calls, and consider the request complete when system instructions remain distinct rather than being flattened into user messages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- ai, api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100