NetLogo / NetLogo/Netlogo-LLM-Extension
bug: model override registry leaks across model directories
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 1
- Forks
- 0
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 4
Description
Problem
ModelRegistry keeps override state in a mutable global map and does not clear provider overrides when a later model directory has no override file. This makes custom model registries sticky across unrelated NetLogo models in the same JVM session.
Current behavior
ModelRegistry.loadOverride(modelDir)merges override models into the sharedprovidersmap.- If the next model directory has no
models-override.yaml, the method returnsNoneand leaves the prior merged state intact. - There is no reset-to-bundled step when switching models or loading config from a directory without overrides.
Why this matters
This can leak one model’s custom registry into another model that never opted into it:
llm:list-modelscan show stale custom modelsllm:set-modelvalidation can succeed for models that should not exist in the current model directory- cross-model testing in one NetLogo session becomes non-deterministic
Affected code
src/main/providers/ModelRegistry.scalasrc/main/config/ModelRegistryLoader.scalasrc/main/LLMExtension.scala(load-configandlist-modelspaths)
Suggested fix directions
- Separate bundled registry state from active override state.
- Recompute the effective registry from bundled + current-directory override each time the model directory changes.
- Explicitly clear overrides when no override file exists in the current directory.
- Add regression coverage for: model A with override -> model B without override ->
llm:list-modelsmust revert to bundled models.
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 by tracing ModelRegistry.loadOverride in src/main/providers/ModelRegistry.scala and how ModelRegistryLoader.scala and LLMExtension.scala handle load-config and list-models. Compare the bundled and active provider state when moving from a model directory with models-override.yaml to one without it. Done means overrides no longer leak and regression coverage verifies that llm:list-models returns bundled models for the second directory.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100