Skip to content

Handle empty transcript session keys#1070

Open
CodingFeng101 wants to merge 1 commit into
anthropics:mainfrom
CodingFeng101:codex/agent-small-fix
Open

Handle empty transcript session keys#1070
CodingFeng101 wants to merge 1 commit into
anthropics:mainfrom
CodingFeng101:codex/agent-small-fix

Conversation

@CodingFeng101

Copy link
Copy Markdown

What changed

This rejects empty transcript-derived session keys in file_path_to_session_key.

Why

A malformed transcript path such as project/.jsonl currently becomes a session key with an empty session_id, and project/session/subagents/.jsonl becomes a subpath with an empty leaf. Those keys are not useful for session mirroring and can leak malformed paths into a SessionStore implementation.

Validation

  • python -m pytest tests/test_transcript_mirror.py::TestFilePathToSessionKey -q
  • python -m ruff check src/claude_agent_sdk/_internal/session_store.py tests/test_transcript_mirror.py
  • 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.

1 participant