You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4dcbcda
Browse filesBrowse the repository at this point in the historyBrowse files
feat(bridge): record prompt-cache breakdown on llm_inference events (bridge-v0.3.3) (#3)
* feat(bridge): record prompt-cache breakdown on llm_inference events
The PyO3 bridge transport dropped the prompt-cache breakdown — korgex's
KorgBridgeClient already forwarded cache_read_tokens / cache_creation_tokens /
uncached_input_tokens (with a TypeError fallback), but record_llm_call didn't
accept them, so a cache hit was unprovable from a bridge-written journal while
the local-journal and HTTP transports carried it.
record_llm_call now takes the three optional cache params and folds them onto
the event args ONLY when caching is active (a read or a write happened),
mirroring src/korg_ledger.py::_llm_call_args. A cold turn keeps the legacy
two-field args, so older readers and the hash-chain over historical events are
undisturbed; field order is irrelevant since args are canonicalised with sorted
keys at hash time. Bump 0.3.2 -> 0.3.3.
Tests: +warm-breakdown / +creation-only cases; 19 bridge tests pass (incl. the
chain-integrity suite, so the new field verifies in-chain).
* docs(bridge): changelog + README for the cache breakdown
bridge-v0.3.3 entry (matching the existing per-bridge-version convention) and a
note in the korg-bridge README that record_llm_call carries the optional
prompt-cache breakdown, so a cache hit is provable from a bridge-written journal
at parity with korgex's local-journal and HTTP transports.
---------
Co-authored-by: ares <285551516+New1Direction@users.noreply.github.com>
-`record_llm_call` accepts the optional prompt-cache breakdown (`cache_read_tokens` / `cache_creation_tokens` / `uncached_input_tokens`) and folds it onto the event `args` — but only when caching is active. A prompt-cache hit is now provable from a bridge-written journal too, at parity with korgex's local-journal and HTTP transports. A cold turn keeps the legacy two-field `args`, so older readers and the hash-chain over historical events are undisturbed (field order is irrelevant — `args` canonicalize with sorted keys at hash time).
41
+
42
+
---
43
+
37
44
## [bridge-v0.3.2] — 2026-05-27
38
45
39
46
### Added
@@ -117,3 +124,4 @@ See [ROADMAP.md](ROADMAP.md) for planned features.
0 commit comments