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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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