Skip to content

feat: Add incremental conversation persistence for live visibility during agent loops#27

Merged
vinodvx merged 2 commits into
mainfrom
feat/conversation-incremental-save
Jun 12, 2026
Merged

feat: Add incremental conversation persistence for live visibility during agent loops#27
vinodvx merged 2 commits into
mainfrom
feat/conversation-incremental-save

Conversation

@vinodvx

@vinodvx vinodvx commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Description

Adds EnableConversationSaveOnIteration to flush conversation messages after each tool round (not only at run end), so Redis/UI can observe progress while a multi-step run is still in flight.

Changes

  • Config: EnableConversationSaveOnIteration() on agent/worker; wired through AgentExecution.Session
  • Local runtime: conversationMemoryEnabled guard; persistedMessageCount saves only new messages (no duplicate history writes, no mid-run refetch)
  • Temporal runtime: per-iteration save + workflow clear; end-of-run saves remainder; same guard on fetch/persist paths
  • Examples infra: Redis in docker-compose.yml; infra:redis:up/down in Taskfile and infra:deps
  • agent_with_conversation: Redis store (REDIS_ADDR), optional incremental save in example
  • Docs: README conversation section, examples README (Redis + env vars)

Test plan

  • go test ./internal/runtime/local/... ./internal/runtime/temporal/...
  • task infra:redis:up then go run ./agent_with_conversation (multi-turn)
  • Temporal worker with EnableConversationSaveOnIteration — verify Redis updates between tool rounds

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactor / chore

Related issues

Closes #26

Checklist

  • I have run make check
  • I have run task examples:all
  • I have run make tidy if I added or removed dependencies
  • Commit messages follow conventional commits (e.g. feat:, fix:, docs:)
  • I have added/updated tests for my changes
  • Documentation is updated if needed

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 29.26829% with 29 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/runtime/temporal/agent_workflow.go 14.28% 15 Missing and 3 partials ⚠️
internal/runtime/local/agent_loop.go 40.00% 7 Missing and 2 partials ⚠️
pkg/agent/config.go 60.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@vinodvx vinodvx merged commit 6765048 into main Jun 12, 2026
2 of 3 checks passed
@vinodvx vinodvx deleted the feat/conversation-incremental-save branch June 12, 2026 06:52
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.

Incremental conversation persistence for live visibility during agent loops

1 participant