Documentation
¶
Overview ¶
threads/codec looks underneath the Thread abstraction at the driver-owned session codec.
In v1 there are only two consumer-visible identity layers: the thread key the host chose, and the run ID the SDK assigned. The provider session id is an implementation detail the SDK persists and replays on its own — hosts never have to hold it. This example is the audit hatch for the rare case where you *do* need to look: a driver that implements driver.SessionCodecProvider exposes how it normalizes a session into stable parameters and how it derives the resume guard fingerprint.
The v1 driver value returned by codex.Driver / claude.Driver / cursor.Driver / codebuddy.Driver promotes every optional capability interface of the underlying adapter, so a plain type assertion is all it takes.
No CLI process is started: the codec is pure data mapping, so this example runs anywhere.
Usage:
go run ./examples/threads/codec -agent=codex