Skip to content

fix: atomically write forked session transcripts#960

Open
MukundaKatta wants to merge 1 commit into
anthropics:mainfrom
MukundaKatta:codex/atomic-fork-session-write
Open

fix: atomically write forked session transcripts#960
MukundaKatta wants to merge 1 commit into
anthropics:mainfrom
MukundaKatta:codex/atomic-fork-session-write

Conversation

@MukundaKatta
Copy link
Copy Markdown

Fixes #906.\n\nUpdates fork_session() to write forked transcripts through a temporary sibling file and publish them with an atomic replace only after the full payload is written. Failed writes now clean up the temp file instead of leaving a partial fork transcript.\n\nValidation:\n- uv run --extra dev pytest tests/test_session_mutations.py -q\n- uv run --extra dev ruff check src/claude_agent_sdk/_internal/session_mutations.py tests/test_session_mutations.py\n- git diff --check

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.

fork_session() write is non-atomic; crash mid-write leaves orphan transcript

1 participant