fix: preserve active model tuning across context-window reloads (#6200) - #6209
Merged
Conversation
Owner
Author
|
Required code review was not completed before publication. This PR is intentionally left open and will not be merged until the required review completes. |
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.
Summary
Fixes
ensureContextWindowinserver/services/ollamaManager.jsso that a context-window reload composes on top of the currently applied launch environment (appliedLaunchEnvValues) instead of replacing it with{}. This ensures active model tuning knobs (such asOLLAMA_FLASH_ATTENTION,OLLAMA_KV_CACHE_TYPE) survive context-window reloads triggered by agent spawns (e.g.claude-ollamarequiring 128K context).Additionally, preserves the tuning's undo bookkeeping (
preTuningEnv) across non-tuning reloads and updates the baseline's context window, so that when a tuning sweep later completes and callsclearLaunchEnv(), it cleanly restores the untuned daemon with the updated context window rather than reverting it or stranding the tuning.Test plan
server/services/ollamaManager.test.jspass with Vitest.server/services/ollamaManager.test.js:preserves an active tuning across ensureContextWindow on a spawned processpreserves an active tuning and its undo bookkeeping across a service context-window reloadpreserves an active tuning when ensureContextWindow starts an offline daemonserver/lib/ollamaContext.test.js,server/lib/localModelTuning.test.js,server/services/ollamaAgentContext.test.js,server/services/localModelAssessments.test.js(all passing).Closes #6200