Skip to content

feat(ollama): add session persistence - #683

Draft
hugosmoreira wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
hugosmoreira:fix/ollama-session-persistence
Draft

feat(ollama): add session persistence#683
hugosmoreira wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
hugosmoreira:fix/ollama-session-persistence

Conversation

@hugosmoreira

Copy link
Copy Markdown

Summary

  • restore persisted user, model, and agent messages into Ollama chat history
  • preserve the configured Ollama system prompt while replacing stale conversation state
  • skip unsupported or empty session records consistently with the other providers
  • add regression coverage for role conversion, invalid records, repeated initialization, and session clearing

Why

Ollama previously ignored persisted messages in Initialize, so loading or switching sessions could not restore the conversation. This converts stored API messages into Ollama messages while retaining the system prompt that Ollama keeps in its history.

Validation

  • go test ./gollm -run '^TestOllama' -count=1
  • go test -race ./gollm -run '^TestOllama' -count=1
  • go test ./pkg/agent ./pkg/sessions -count=1
  • go test ./... -count=1
  • go test ./... -count=1 in kubectl-utils
  • repository presubmits: build, vet, format, module tidiness, autogeneration, and mocks

Closes #464

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.

[Feature]: Add session persistence for Ollama

1 participant