codec

command
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL