Conversation
Usage already computed cache_write internally (app/agent/usage.py), but the conductor telemetry hook only ever read cache_read off the usage dict — cache-write activity was silently dropped instead of reaching conductor's cache-accounting pipeline. Forwards it the same way cache_read already is, and extends the queueing test to assert it lands in the enqueued event. Companion change on the conductor side (evo-conductor repo) adds the cache_write_tokens field this now populates, plus the storage/aggregate work that uses it.
16 tasks
Member
|
Already Fixed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Forwards
cache_write_tokensfrom the agent's usage counters to Conductor's telemetry hook.usage_to_dictalready computedcache_writeinternally, but the Conductor telemetry hook only ever readcache_readoff the usage dict — cache-write activity was silently dropped instead of reaching Conductor's cache-accounting pipeline.This is the evoflux-side half of a paired change. The Conductor-side half (schema, storage, aggregate rollups, and the UI that displays cache writes and net cache savings) is in evoelsewhere/evo-conductor#6 — merge both together, since Conductor's new column stays
0for every event until this side ships.What changed
app/conductor/constants/telemetry.py: addedTelemetryField.CACHE_WRITE_TOKENS, included inTELEMETRY_NUMERIC_TOKEN_FIELDS.app/agent/hooks/conductor_telemetry.py:wrap_model_call's success path now passescache_write_tokens=_counter(usage.get("cache_write"))into_record(...);_recordgained the parameter and enqueues it.Checklist
cache_write_tokensdefaults to0via_counter(None)when a provider's usage dict has nocache_writekey, so nothing breaks for providers that don't report it.tests/conductor/test_telemetry.py::test_hook_queues_only_safe_model_and_tool_metadatato assert the new field is actually forwarded (cache_write: 15in the mock usage →TelemetryField.CACHE_WRITE_TOKENS == 15in the enqueued event), not just that nothing crashed.Test evidence