Skip to content

feat(claude-code): full-session retain with document upsert and configurable tags#695

Open
nicoloboschi wants to merge 1 commit intomainfrom
feature/claude-code-plugin-session-doc
Open

feat(claude-code): full-session retain with document upsert and configurable tags#695
nicoloboschi wants to merge 1 commit intomainfrom
feature/claude-code-plugin-session-doc

Conversation

@nicoloboschi
Copy link
Collaborator

Summary

  • Full-session retain mode (new default): retains the entire conversation transcript as a single document per session, using session_id as the document_id for upsert semantics. Previously each retain call created a new fragmented document with a timestamp-suffixed ID.
  • Configurable tags (retainTags): list of tags sent with each retain call, with template variable support ({session_id}, {bank_id}, {timestamp}). Default: ["{session_id}"].
  • Configurable metadata (retainMetadata): extra metadata merged with built-in fields, same template support.
  • Legacy chunked mode preserved via retainMode: "chunked" config.

Test plan

  • Existing 16 tests pass
  • New test: full-session mode uses session_id as document_id and includes all messages
  • New test: retainTags resolves template variables correctly
  • New test: retainMetadata merges with built-in metadata and resolves templates
  • Chunked mode test updated to explicitly set retainMode: "chunked"

…configurable tags

Switch default retain behavior from per-turn chunks to full-session upsert.
Each session is now retained as a single document (document_id = session_id)
that gets updated on every Stop event, instead of creating fragmented
documents with timestamp-suffixed IDs.

New config options:
- retainMode: "full-session" (default) or "chunked" (legacy)
- retainTags: list with template variable support ({session_id}, {bank_id}, {timestamp})
- retainMetadata: extra metadata dict merged with built-in fields, supports templates
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.

1 participant