686f6c61
c0aaa238f6
feat(compression): usage anchor survives DB reloads and process restarts (salvage #99585 )
...
The usage anchor (real usage.prompt_tokens + delta estimate of what was appended since)
identified the priced transcript by id() of the last message, so it was None on EVERY
gateway turn (history is re-read from the DB each turn) and in every fresh process
(--resume, desktop per-turn serve). Those are exactly the surfaces where the bytes/4
estimate then fired local compression against payloads the provider priced far under
threshold (#99421 , #104462 ).
- agent/usage_anchor.py owns the anchor: content fingerprint instead of id(), persisted on
the session row (model_config._usage_anchor) via set_usage_anchor(), restored on the first
resumed turn while the durable transcript still matches, cleared with the row on
compaction / codex-native rewrite / session reset.
- Callers repointed from model_metadata (the compat table follows).
Design and persistence slot from #99585 by @686f6c61; re-authored against the Sep 2026
layout (the branch predates the model_metadata / agent_init split).
2026-09-06 13:21:17 -07:00
..
2026-09-04 00:15:16 -07:00
2026-09-06 23:34:20 +05:30
2026-09-04 00:15:16 -07:00
2026-09-03 03:31:03 -07:00
2026-09-04 01:28:31 -07:00
2026-09-04 20:24:24 -04:00
2026-09-02 22:51:30 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 15:07:39 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 15:07:39 -07:00
2026-09-03 02:46:19 -07:00
2026-09-03 13:05:57 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 17:13:22 -07:00
2026-09-04 02:12:35 -07:00
2026-09-03 13:49:57 -07:00
2026-09-03 13:49:57 -07:00
2026-09-05 18:08:00 +05:30
2026-09-02 22:51:30 -07:00
2026-09-03 13:08:40 -07:00
2026-09-04 04:37:08 -07:00
2026-09-02 22:51:19 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 13:08:40 -07:00
2026-09-03 13:48:49 -07:00
2026-09-03 13:48:49 -07:00
2026-09-07 00:42:18 +05:30
2026-09-03 13:08:40 -07:00
2026-09-02 21:59:38 -07:00
2026-09-03 13:08:40 -07:00
2026-09-02 21:59:38 -07:00
2026-09-07 00:42:18 +05:30
2026-09-03 17:13:22 -07:00
2026-09-03 02:07:33 -07:00
2026-09-06 05:36:26 -07:00
2026-09-02 21:26:16 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 23:58:31 -07:00
2026-09-02 23:58:31 -07:00
2026-09-03 17:13:22 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 13:05:57 -07:00
2026-09-03 13:05:57 -07:00
2026-09-03 13:49:57 -07:00
2026-09-05 06:36:52 -07:00
2026-09-05 12:21:28 +05:30
2026-09-05 06:24:06 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 14:00:59 -07:00
2026-09-02 21:23:44 -07:00
2026-09-05 12:21:28 +05:30
2026-09-06 13:21:17 -07:00
2026-09-03 15:43:04 -07:00
2026-09-02 22:42:56 -07:00
2026-09-03 17:00:26 -07:00
2026-09-03 13:30:31 -07:00
2026-09-02 23:58:31 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 14:00:59 -07:00
2026-09-03 17:00:26 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 00:06:54 -07:00
2026-09-06 13:08:31 -07:00
2026-09-06 13:08:31 -07:00
2026-09-03 14:00:59 -07:00
2026-09-05 21:00:19 +05:30
2026-09-03 17:13:22 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 03:31:03 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 13:05:57 -07:00
2026-09-03 00:02:56 -07:00
2026-09-05 16:45:59 +05:30
2026-09-03 15:07:39 -07:00
2026-09-03 00:04:40 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 14:16:54 -07:00
2026-09-03 00:06:30 -07:00
2026-09-04 00:15:16 -07:00
2026-09-04 01:28:31 -07:00
2026-09-03 13:16:47 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 13:29:35 -07:00
2026-09-03 00:05:41 -07:00
2026-09-03 13:46:50 -07:00
2026-09-05 19:01:22 +05:30
2026-09-04 01:28:31 -07:00
2026-09-04 07:17:00 -07:00
2026-09-05 17:01:23 +05:30
2026-09-06 05:41:46 -07:00
2026-09-02 21:20:42 -07:00
2026-09-03 17:13:22 -07:00
2026-09-06 09:09:41 -07:00
2026-09-06 09:09:41 -07:00
2026-09-03 09:44:26 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 17:13:22 -07:00
2026-09-06 12:06:39 -07:00
2026-09-03 00:06:30 -07:00
2026-09-06 07:20:24 -07:00
2026-09-03 00:06:30 -07:00
2026-09-02 21:20:42 -07:00
2026-09-03 00:06:30 -07:00
2026-09-03 00:10:28 -07:00
2026-09-03 14:00:59 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 13:48:14 -07:00
2026-09-03 13:48:14 -07:00
2026-09-03 13:48:14 -07:00
2026-09-03 13:48:14 -07:00
2026-09-03 13:48:14 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 13:48:14 -07:00
2026-09-03 13:48:14 -07:00
2026-09-03 13:48:14 -07:00
2026-09-03 13:48:14 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 15:07:39 -07:00
2026-09-03 15:07:39 -07:00
2026-09-03 15:07:39 -07:00
2026-09-03 15:07:39 -07:00
2026-09-03 13:33:47 -07:00
2026-09-03 15:07:39 -07:00
2026-09-03 15:07:39 -07:00
2026-09-03 15:07:39 -07:00
2026-09-06 14:53:33 +05:30
2026-09-02 21:44:59 -07:00
2026-09-03 09:44:26 -07:00
2026-09-02 21:21:25 -07:00
2026-09-03 13:29:35 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 13:29:35 -07:00
2026-09-02 21:44:59 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 21:44:59 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 03:31:03 -07:00
2026-09-03 09:44:26 -07:00
2026-09-02 21:54:56 -07:00
2026-09-02 21:54:56 -07:00
2026-09-03 15:07:39 -07:00
2026-09-03 15:07:39 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 14:00:59 -07:00
2026-09-04 00:15:16 -07:00
2026-09-06 05:42:22 -07:00
2026-09-03 14:00:59 -07:00
2026-09-03 13:48:49 -07:00
2026-09-03 13:48:49 -07:00
2026-09-03 13:48:49 -07:00
2026-09-04 00:15:16 -07:00
2026-09-02 22:14:17 -07:00
2026-09-02 21:57:34 -07:00
2026-09-03 17:13:22 -07:00
2026-09-04 07:17:00 -07:00
2026-09-03 09:44:26 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 21:57:39 -07:00
2026-09-04 04:56:11 -07:00
2026-09-03 14:00:59 -07:00
2026-09-03 09:44:26 -07:00
2026-09-04 01:28:31 -07:00
2026-09-03 00:09:39 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-04 01:28:31 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-04 01:48:47 -07:00
2026-09-02 21:49:24 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 15:07:39 -07:00
2026-09-06 05:34:01 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 00:06:57 -07:00
2026-09-03 13:46:50 -07:00
2026-09-02 22:55:15 -07:00
2026-09-06 09:11:04 -07:00
2026-09-03 09:44:26 -07:00
2026-09-04 20:24:24 -04:00
2026-09-04 20:24:24 -04:00
2026-09-02 22:39:49 -07:00
2026-09-03 14:00:59 -07:00
2026-09-03 14:00:59 -07:00
2026-09-04 00:15:16 -07:00
2026-09-02 22:25:24 -07:00
2026-09-03 14:00:59 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 22:33:08 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 00:06:57 -07:00
2026-09-03 00:06:57 -07:00
2026-09-03 00:06:57 -07:00
2026-09-03 00:06:57 -07:00
2026-09-03 00:06:57 -07:00
2026-09-03 03:31:03 -07:00
2026-09-02 23:59:27 -07:00
2026-09-03 13:46:50 -07:00
2026-09-02 23:42:50 -07:00
2026-09-03 13:05:57 -07:00
2026-09-02 22:39:06 -07:00
2026-09-03 13:33:10 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 15:07:39 -07:00
2026-09-04 07:17:00 -07:00
2026-09-03 13:33:10 -07:00
2026-09-03 13:33:10 -07:00
2026-09-03 00:11:01 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 13:08:40 -07:00
2026-09-03 13:22:48 -07:00
2026-09-03 09:44:26 -07:00
2026-09-02 22:55:43 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 23:04:20 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 09:44:26 -07:00
2026-09-04 07:17:00 -07:00
2026-09-04 00:15:16 -07:00
2026-09-02 21:36:24 -07:00
2026-09-02 21:34:25 -07:00
2026-09-03 22:00:01 -07:00
2026-09-02 21:49:33 -07:00
2026-09-02 23:04:20 -07:00
2026-09-03 13:22:51 -07:00
2026-09-03 13:29:35 -07:00
2026-09-03 14:16:54 -07:00
2026-09-03 13:10:38 -07:00
2026-09-05 12:21:28 +05:30
2026-09-02 21:31:17 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 14:27:29 -07:00
2026-09-06 20:47:52 +05:30
2026-09-03 09:44:26 -07:00
2026-09-05 00:24:40 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 21:49:26 -07:00
2026-09-06 20:47:52 +05:30
2026-09-02 21:45:19 -07:00
2026-09-06 14:53:33 +05:30
2026-09-02 22:12:58 -07:00
2026-09-02 21:28:23 -07:00
2026-09-02 21:28:23 -07:00
2026-09-02 21:28:23 -07:00
2026-09-03 13:20:22 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 14:21:32 -07:00
2026-09-04 20:24:24 -04:00
2026-09-03 14:37:14 -07:00
2026-09-03 14:21:32 -07:00
2026-09-05 16:30:35 +05:30
2026-09-03 14:21:32 -07:00
2026-09-03 14:21:32 -07:00
2026-09-05 20:44:51 +05:30
2026-09-06 22:56:51 +05:30
2026-09-03 14:21:32 -07:00
2026-09-03 14:21:32 -07:00
2026-09-03 14:21:32 -07:00
2026-09-03 14:21:32 -07:00
2026-09-03 14:21:32 -07:00
2026-09-06 22:56:51 +05:30
2026-09-05 20:44:51 +05:30
2026-09-04 00:15:16 -07:00
2026-09-04 20:24:24 -04:00
2026-09-02 23:08:44 -07:00
2026-09-02 23:08:44 -07:00
2026-09-03 13:05:57 -07:00
2026-09-03 09:44:26 -07:00
2026-09-02 21:54:36 -07:00
2026-09-02 23:08:44 -07:00