Skip to content

fix: Scheduled autotitling can overwrite concurrent session metadata - #982

Closed
sam-saffron-jarvis wants to merge 1 commit into
SamSaffron:mainfrom
sam-saffron-jarvis:feat/codereview-b9636d32
Closed

fix: Scheduled autotitling can overwrite concurrent session metadata#982
sam-saffron-jarvis wants to merge 1 commit into
SamSaffron:mainfrom
sam-saffron-jarvis:feat/codereview-b9636d32

Conversation

@sam-saffron-jarvis

Copy link
Copy Markdown
Contributor

What changed

  • Persist scheduled autotitles through the existing generated-title-only store API instead of a full session-row update.
  • Update the in-memory title fields only after persistence succeeds.
  • Add a focused SQLite-backed regression test that captures a stale candidate, changes its manual name, pinned state, model, status, and goal, then verifies autotitling changes only generated-title fields.
  • Assert that the command save path calls UpdateGeneratedTitle and never Update when the store supports the title-only capability.

Why this is high-value

The autotitle command loads all candidate sessions before making serial provider calls, so a later candidate can be stale for minutes. A full-row Update from that snapshot could silently revert user-visible changes made while the job was running, including a manual title, pin/status state, model selection, and goal. The title-only update removes that realistic race without changing title generation behavior.

Validation

  • gofmt -w cmd/sessions_autotitle.go cmd/sessions_autotitle_test.go
  • go build ./...
  • go test ./cmd -run '^TestUpdateAutotitleDoesNotClobberConcurrentSessionMetadata$' -count=1
  • go test ./... with an isolated HOME/XDG_CONFIG_HOME (passes; the normal agent home injects its global skill catalog into two unrelated cwd-skill tests)
  • git diff --check

@SamSaffron SamSaffron closed this Aug 2, 2026
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.

2 participants