Skip to content

Commit 3947200

Browse files
committed
docs+build: sdist includes examples/, README notes Redis key separator + Postgres schema divergence
1 parent 8fd99d5 commit 3947200

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

examples/session_stores/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ through the relevant items below.
7474
- Lists are unbounded; implement TTL via `EXPIRE` in a subclass if needed.
7575
- Redis Cluster: keys with the same `{project_key}:{session_id}` prefix should
7676
hash to the same slot — wrap in `{...}` hash tags if using Cluster.
77+
- If you derive `project_key` or `session_id` outside the SDK, ensure they
78+
cannot contain `:` (the key separator) — collisions would mix data across
79+
keys. The SDK's own `project_key_for_directory()` and UUID session IDs are
80+
already safe.
7781

7882
### Postgres
7983

@@ -349,6 +353,12 @@ CREATE INDEX IF NOT EXISTS claude_session_store_list_idx
349353
`append()` is a single multi-row `INSERT ... SELECT unnest($entries::jsonb[])`;
350354
`load()` is `SELECT entry ... ORDER BY seq`.
351355

356+
Note: this schema differs from the TypeScript SDK's Postgres reference adapter
357+
(which defaults to table `claude_session_entries`, uses `NULL` rather than
358+
`''` as the main-transcript subpath sentinel, and stores `created_at
359+
TIMESTAMPTZ` rather than epoch-ms `mtime`). Sharing one Postgres table across
360+
the two SDKs requires aligning on a single schema first.
361+
352362
### JSONB key ordering
353363

354364
Entries are stored as `jsonb`, which **reorders object keys** on read-back

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ only-include = ["src/claude_agent_sdk"]
6666
include = [
6767
"/src",
6868
"/tests",
69+
"/examples",
6970
"/README.md",
7071
"/LICENSE",
7172
]

0 commit comments

Comments
 (0)