teknium1
444066b82c
fix: exclude display-only message fields from token estimates
...
Edit tool rows now carry display_metadata.tool_result_metadata.inline_diff
(~9KB of ANSI per edit) on the live message dict. build_api_messages strips
display_kind/display_metadata/_row_id before the wire, but the local
estimator's wire shadow only dropped PERSISTENCE_ONLY_MESSAGE_FIELDS
({"timestamp"}), so estimate_messages_tokens_rough and
estimate_request_tokens_rough priced the diff: one edit row went from 32 to
2527 estimated tokens (100 edits: 3100 -> 252600). That inflates compaction
preflight, post-tool checks and turn-overflow scoring, compacts early and
breaks the prompt cache.
PERSISTENCE_ONLY_MESSAGE_FIELDS (agent/message_metadata.py) is now the single
set of local-only fields: timestamp, display_kind, display_metadata, _row_id.
build_api_messages pops exactly that set and the estimator shadow drops it,
so the two can no longer drift. The iteration-limit summary path
(_iteration_summary_api_messages) hand-builds its wire messages and stripped
timestamp but not display_*; its key set now unions the same constant, so
the inline diff never reaches the provider there either (strict gateways
reject unknown keys). The tail-budget walk (_estimate_msg_budget_tokens) is
allowlist-based and already ignored these fields.
2026-09-23 22:45:56 -07:00
..
2026-09-20 18:54:24 -07:00
2026-09-18 10:22:14 -07:00
2026-09-19 16:20:29 +05:30
2026-09-23 19:26:00 -07:00
2026-09-15 04:56:01 -07:00
2026-09-23 18:29:35 -05:00
2026-09-23 22:45:56 -07:00
2026-09-23 21:28:38 +05:30
2026-09-22 01:19:12 -07:00
2026-09-23 13:40:44 -04:00
2026-09-21 09:55:40 -07:00
2026-09-19 09:56:12 -07:00
2026-09-17 08:53:15 -07:00
2026-09-23 22:42:14 -07:00
2026-09-17 08:45:46 -07:00
2026-09-17 09:07:51 -07:00
2026-09-22 01:19:12 -07:00
2026-09-23 15:13:16 -07:00
2026-09-17 09:11:38 -07:00
2026-09-23 18:29:35 -05:00
2026-09-19 09:28:45 -07:00
2026-09-20 12:09:47 -07:00
2026-09-23 15:00:46 -05:00
2026-09-20 12:09:47 -07:00
2026-09-23 18:29:35 -05:00
2026-09-20 14:29:39 -07:00
2026-09-23 22:45:56 -07:00
2026-09-19 09:53:48 -07:00
2026-09-19 09:53:48 -07:00
2026-09-19 09:53:48 -07:00
2026-09-23 16:27:37 -07:00
2026-09-19 09:28:13 -07:00
2026-09-23 21:28:38 +05:30
2026-09-19 20:44:24 -07:00
2026-09-19 20:44:24 -07:00
2026-09-23 17:06:48 -07:00
2026-09-23 18:52:49 -05:00
2026-09-23 01:11:58 -07:00
2026-09-20 15:50:49 -07:00
2026-09-23 10:44:29 -07:00
2026-09-21 23:38:16 -07:00
2026-09-16 17:17:47 -07:00
2026-09-19 10:28:34 -07:00
2026-09-20 19:45:30 -07:00
2026-09-23 01:11:58 -07:00
2026-09-23 23:06:15 +05:30
2026-09-23 23:06:15 +05:30
2026-09-23 17:06:48 -07:00
2026-09-19 10:44:26 -07:00
2026-09-21 09:55:40 -07:00
2026-09-19 09:37:23 -07:00
2026-09-19 21:24:05 -07:00
2026-09-21 09:55:40 -07:00
2026-09-18 20:55:24 -07:00
2026-09-20 14:02:17 +05:30
2026-09-19 09:20:54 -07:00
2026-09-22 12:52:49 +05:30
2026-09-16 17:48:48 -07:00
2026-09-23 22:45:56 -07:00
2026-09-23 10:40:08 -07:00
2026-09-19 10:54:43 -07:00
2026-09-20 17:00:43 -07:00
2026-09-23 13:40:45 -04:00
2026-09-18 10:08:58 -07:00
2026-09-23 22:42:14 -07:00
2026-09-24 00:30:45 +00:00
2026-09-17 13:52:36 +05:30
2026-09-19 20:56:31 -07:00
2026-09-23 08:04:33 +05:30
2026-09-23 18:29:35 -05:00
2026-09-18 13:01:12 -04:00
2026-09-16 17:48:17 -07:00
2026-09-18 09:21:42 -07:00
2026-09-23 18:29:35 -05:00
2026-09-15 19:03:33 -07:00
2026-09-23 18:26:45 -07:00
2026-09-23 01:06:32 -07:00
2026-09-23 01:06:32 -07:00
2026-09-23 22:45:56 -07:00
2026-09-23 21:28:38 +05:30
2026-09-23 10:44:29 -07:00
2026-09-18 20:56:35 -07:00
2026-09-23 21:28:38 +05:30
2026-09-23 13:40:44 -04:00
2026-09-23 21:53:47 +05:30
2026-09-21 13:14:22 -07:00
2026-09-19 00:53:26 -07:00
2026-09-18 01:43:35 +05:30
2026-09-17 12:28:25 +05:30
2026-09-19 09:21:18 -07:00
2026-09-19 10:56:19 -07:00
2026-09-16 11:06:06 -07:00
2026-09-22 16:15:34 +05:30
2026-09-18 09:56:28 -07:00
2026-09-23 03:10:15 -07:00
2026-09-23 21:28:38 +05:30
2026-09-18 10:22:14 -07:00
2026-09-15 06:16:38 -07:00
2026-09-20 14:02:17 +05:30
2026-09-23 00:44:33 -07:00
2026-09-20 16:03:38 -07:00
2026-09-19 09:57:53 -07:00
2026-09-23 21:28:38 +05:30
2026-09-23 06:31:43 -07:00
2026-09-24 01:06:16 -04:00
2026-09-16 17:10:13 -07:00
2026-09-19 09:49:39 -07:00
2026-09-23 07:43:29 -04:00
2026-09-15 19:23:53 -07:00
2026-09-23 08:09:47 -07:00
2026-09-19 10:38:30 -07:00
2026-09-20 10:16:51 -07:00
2026-09-21 23:47:51 -07:00
2026-09-22 17:08:30 +05:30
2026-09-20 15:50:26 -07:00
2026-09-22 17:08:30 +05:30
2026-09-18 01:43:35 +05:30
2026-09-24 00:30:45 +00:00
2026-09-19 12:21:39 -07:00
2026-09-20 10:51:03 -07:00
2026-09-23 17:06:48 -07:00
2026-09-23 17:06:48 -07:00
2026-09-16 06:27:23 -05:00
2026-09-20 14:09:57 -07:00
2026-09-23 08:04:33 +05:30
2026-09-23 22:45:56 -07:00
2026-09-18 10:03:04 -07:00
2026-09-18 10:03:04 -07:00
2026-09-20 18:24:07 -07:00
2026-09-20 12:36:34 +05:30
2026-09-20 17:00:43 -07:00
2026-09-21 21:43:51 +05:30
2026-09-20 12:52:07 -07:00
2026-09-23 22:45:56 -07:00
2026-09-18 01:43:35 +05:30
2026-09-20 20:13:33 -07:00
2026-09-16 17:48:17 -07:00
2026-09-23 07:46:43 -04:00
2026-09-23 16:58:39 -07:00
2026-09-21 23:56:25 -07:00
2026-09-23 15:00:46 -05:00
2026-09-23 05:36:34 -07:00
2026-09-18 01:43:35 +05:30
2026-09-23 04:38:27 -07:00
2026-09-18 01:43:35 +05:30
2026-09-23 05:36:34 -07:00
2026-09-19 12:38:55 -07:00
2026-09-23 13:40:45 -04:00
2026-09-19 00:04:42 -07:00
2026-09-19 10:47:48 -07:00
2026-09-19 00:04:42 -07:00
2026-09-19 12:38:55 -07:00
2026-09-18 09:21:42 -07:00
2026-09-23 05:36:34 -07:00
2026-09-18 01:43:35 +05:30
2026-09-19 10:51:40 -07:00
2026-09-17 18:36:10 -07:00
2026-09-23 11:33:09 -07:00
2026-09-20 10:21:52 -07:00
2026-09-20 10:23:04 -07:00
2026-09-23 07:49:35 -07:00
2026-09-23 07:49:35 -07:00