Skip to content

fix(session): hydrate SquadSessionID from legacy conversation_id key#73

Open
SAY-5 wants to merge 1 commit into
tstapler:mainfrom
SAY-5:fix/squad-session-id-legacy-key-38
Open

fix(session): hydrate SquadSessionID from legacy conversation_id key#73
SAY-5 wants to merge 1 commit into
tstapler:mainfrom
SAY-5:fix/squad-session-id-legacy-key-38

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 12, 2026

Summary

Fixes #38. The previous ConversationID field used the JSON tag conversation_id; after renaming it to SquadSessionID with tag squad_session_id, persisted state written before the rename failed to hydrate the field on next load.

Changes

session/storage.go — add a custom UnmarshalJSON on ClaudeSessionData that reads the legacy conversation_id key as a fallback for squad_session_id. squad_session_id still wins when both keys are present, so newly written state is unaffected.

Test plan

  • go test ./session -run TestClaudeSessionData_UnmarshalJSON — three cases: legacy-only key hydrates, new key wins over legacy, new-only format still works.
  • go vet ./session clean.

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.

bug: SquadSessionID JSON tag breaks backward compat with persisted state

1 participant