Skip to content

fix(ingest): select current Claude transcript - #6379

Draft
ehz0ah wants to merge 1 commit into
volcengine:mainfrom
ehz0ah:fix/claude-code-twin-transcripts
Draft

ehz0ah wants to merge 1 commit into
volcengine:mainfrom
ehz0ah:fix/claude-code-twin-transcripts

Conversation

@ehz0ah

@ehz0ah ehz0ah commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • collapse Claude Code transcript twins that share one native session UUID
  • select the most recently modified append-only transcript, with deterministic size and path tie-breakers
  • document the behavior for symlinked project paths

Why

Claude Code can leave one session file under both the real-path and symlink-derived project directories. OpenViking currently discovers both files with the same native_session_id, so they share one byte-offset cursor. Because the files have different inodes, each poll treats the other file as a rotation and replays both transcripts from the beginning.

A deterministic source-pinned fixture reproduced the failure on current main: two transcript files produced one cursor row, and both current and stale messages were read again on the second sweep. With this change, discovery selects the current transcript and the second sweep reads zero messages.

External report: anthropics/claude-code#103806

Validation

  • pytest --confcutdir=tests/ingest -o addopts='' tests/ingest -q — 38 passed
  • ruff check openviking/ingest/sources/claude_code.py tests/ingest/test_parsers.py
  • ruff format --check openviking/ingest/sources/claude_code.py tests/ingest/test_parsers.py

@ZaynJarvis ZaynJarvis added the kernel Core server, runtime, storage, retrieval, SDK, and CLI. label Oct 21, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel Core server, runtime, storage, retrieval, SDK, and CLI.

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants