Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion PATCHES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Vendored local patches on serdes-ai 0.2.6

## Issue 79: stateless prompt-cache routing

The retained Responses client adds an optional `prompt_cache_key` request field and
construction-time setter. The host supplies the session label when caching is enabled,
including Codex HTTP. It also preserves optional `input_tokens_details.cached_tokens`
through both SSE completion assembly and JSON response conversion, which previously
discarded this counter. Anthropic usage counters now remain optional even when the
usage object or individual input/output fields are absent; no zero denominator is
fabricated. The stream parser's input carrier follows the type change without
changing its transport. No transport behavior changes. The upstream revision and licenses
remain unchanged; the aggregate `SERDES-AI-0.2.6.patch` contains this delta and fixture
updates. Cache usage interpretation and reporting live in the host provider layer.


`llxprt-code-rs` depends on serdes-ai `=0.2.6` through the path dependency
`vendor/serdes-ai` (`default-features = false, features = ["openai", "anthropic", "chatgpt-oauth"]`).
The retained crates are based on the 0.2.6 release. The Responses client is based on the tested `serdes-ai-responses` subtree at Git commit `bd6aefc96f699276afb6384257b101039a663b5f`. The local transport patches below adapt those sources into one offline build.
Expand Down Expand Up @@ -52,7 +66,7 @@ Each vendored crate archive is SerdesAI 0.2.6 from crates.io. Every shipped
| `serdes-ai-tools` | `ae4c635d97827560acaa8d3af32a78fc50fece538d1e4638c889c7588f490777` |
| `serdes-ai-toolsets` | `85e7ab76a1546ce6aa858c7a0fd438dd4235b3927fcf5a907bec26bacb6f2588` |

`SERDES-AI-0.2.6.patch` is the complete diff from those extracted archives and the retained Responses Git snapshot to `vendor/`, including path-dependency rewrites, the bounded client-only Responses selection, and source compatibility changes. Its SHA-256 is `0144b4e99ac63adf0daf17985a6e3fdb53d6c59f08c36c03b06308d519c3f660`.
`SERDES-AI-0.2.6.patch` is the complete diff from those extracted archives and the retained Responses Git snapshot to `vendor/`, including path-dependency rewrites, the bounded client-only Responses selection, and source compatibility changes. Its SHA-256 is `e7d278fa6b9364645b975d794eacb088db1400a96c0c8f751a40a683d8961cdf`.
`bash scripts/regenerate-serdes-patch.sh` recreates the patch from all 11 crates.io archives and the pinned Git snapshot in a temporary Git repository. It uses a committed archive baseline plus `git add -N` before the binary diff so
new files, modifications, and deletions are all represented.
The 11 exact crates.io archives and the Git archive of the Responses subtree are retained under `vendor-upstream/`. The snapshot identity and SHA-256 are recorded in `provenance/serdes-ai-responses-git.json`. To reproduce the vendored tree:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ Example success object:
## `--session` and `--turn` semantics (documented current behavior)

- `--session ID` is a directory name under `<config>/code-rs-sessions/`. Turn numbers
restart per session and are 1-based. Public OpenAI Responses uses this validated label as
`prompt_cache_key` unless prompt caching is `off`; it never uses it as response-continuation
state. The Codex WebSocket transport sends neither a session header nor a prompt-cache key.
restart per session and are 1-based. OpenAI Chat, public OpenAI Responses, and Codex HTTP
use this validated label as `prompt_cache_key` unless prompt caching is `off`; it is
independent of response-continuation state. See [prompt caching](docs/prompt-caching.md).
Omitting `--session` uses the literal label `default`. Do not use a sensitive value as a
session ID.
- No `--turn` runs the **next** turn: the first invocation of a session runs turn 1,
Expand Down
Loading
Loading