Hung
1685f2d621
Use measured durations to budget uploaded audio ( #59268 )
...
## Why
Uploaded audio always reserved 12,000 tokens per file, even for short clips. This could discard recordings during compaction that would fit within the retained-message budget.
## What changed
- Add optional audio duration metadata to attachments and cache measured durations per session, resolving metadata for new input and replayed history.
- Use measured durations for history estimates and compaction budgets at 10 tokens per second, rounded up and capped at 12,000 tokens. Keep the full budget for missing or unusable metadata.
- Bound metadata lookups to 250 milliseconds per batch with up to eight concurrent requests, and record accepted input before lookup so interruption preserves the batch.
## Testing
Add coverage for duration rounding and fallback estimates, mixed measured and unknown audio, retention through compaction and cold resume, and interruption during metadata lookup.
GitOrigin-RevId: 26fe320c7024944d9d4c371d5fdcda84442b5cc5
2026-11-04 00:19:12 +00:00
..
2026-10-30 18:33:14 +00:00
2026-10-14 06:03:02 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-10-26 22:13:14 +00:00
2026-10-05 18:52:51 +00:00
2026-10-05 18:52:51 +00:00
2026-10-05 18:52:51 +00:00
2026-09-10 21:41:39 +00:00
2026-10-30 18:33:14 +00:00
2026-09-12 05:04:11 +00:00
2026-09-12 05:04:11 +00:00
2026-10-05 18:52:51 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-10-05 18:52:51 +00:00
2026-10-05 18:52:51 +00:00
2026-10-05 18:52:51 +00:00
2026-04-12 11:59:09 -07:00
2026-11-02 14:06:17 +00:00
2026-11-02 14:06:17 +00:00
2026-11-02 14:06:17 +00:00
2026-11-02 14:06:17 +00:00
2026-11-02 14:06:17 +00:00
2026-11-02 14:06:17 +00:00
2026-11-02 14:06:17 +00:00
2026-10-05 18:52:51 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-10-19 20:30:44 +00:00
2026-10-08 17:25:39 +00:00
2026-11-03 12:33:26 +00:00
2026-11-02 15:09:22 +00:00
2026-11-03 12:33:26 +00:00
2026-11-02 15:28:37 +00:00
2026-09-30 17:33:59 +00:00
2026-11-03 12:33:26 +00:00
2026-10-06 10:39:16 +00:00
2026-10-30 18:33:14 +00:00
2026-10-22 12:46:24 +00:00
2026-11-02 19:38:59 +00:00
2026-10-22 12:46:24 +00:00
2026-10-29 16:57:12 +00:00
2026-10-22 12:46:24 +00:00
2026-10-22 12:46:24 +00:00
2026-10-22 12:46:24 +00:00
2026-10-22 12:46:24 +00:00
2026-10-22 12:46:24 +00:00
2026-10-22 12:46:24 +00:00
2026-10-27 16:16:17 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-11-04 00:19:12 +00:00
2026-11-03 21:24:16 +00:00
2026-10-30 20:53:25 +00:00
2026-11-03 21:24:16 +00:00
2026-11-03 21:24:16 +00:00
2026-11-02 19:38:59 +00:00
2026-10-27 22:26:12 +00:00
2026-10-26 21:20:52 +00:00
2026-11-02 14:06:17 +00:00
2026-11-02 14:06:17 +00:00
2026-11-02 14:06:17 +00:00
2026-11-02 14:06:17 +00:00
2026-11-02 14:06:17 +00:00
2026-10-26 21:20:52 +00:00
2026-10-22 12:46:24 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-10-05 18:52:51 +00:00
2026-10-22 12:46:24 +00:00
2026-10-22 12:46:24 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-10-27 19:50:41 +00:00
2026-10-22 12:46:24 +00:00
2026-11-03 06:24:24 +00:00
2026-10-27 14:48:48 +00:00
2026-10-27 14:48:48 +00:00
2026-10-29 11:15:52 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-11-02 17:05:56 +00:00
2026-10-29 09:48:55 +00:00
2026-11-02 17:05:56 +00:00
2026-11-02 15:07:54 +00:00
2026-10-30 15:28:20 +00:00
2026-10-30 18:33:14 +00:00
2026-10-27 13:02:57 +00:00
2026-10-03 07:37:00 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-11-03 09:51:25 +00:00
2026-11-02 18:43:57 +00:00
2026-11-02 20:10:37 +00:00
2026-10-08 22:01:24 +00:00
2026-10-10 01:14:28 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 20:53:25 +00:00
2026-10-30 18:33:14 +00:00
2026-10-26 22:05:23 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-10-27 14:14:16 +00:00
2026-11-02 21:35:56 +00:00
2026-10-05 18:52:51 +00:00
2026-10-05 18:52:51 +00:00
2026-10-06 03:27:04 +00:00
2026-10-06 03:27:04 +00:00
2026-10-05 18:52:51 +00:00
2026-10-05 18:52:51 +00:00
2026-10-30 18:33:14 +00:00
2026-10-22 12:46:24 +00:00
2026-10-22 12:46:24 +00:00
2026-10-21 10:40:59 +00:00
2026-10-30 18:33:14 +00:00
2026-10-26 19:37:32 +00:00
2026-10-16 16:40:17 +00:00
2026-10-16 16:40:17 +00:00
2026-10-05 18:52:51 +00:00
2026-10-14 05:36:44 +00:00
2026-10-22 22:44:48 +00:00
2026-10-22 12:46:24 +00:00
2026-10-22 12:46:24 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-10-06 10:56:45 +00:00
2026-10-09 11:08:24 +00:00
2026-10-30 18:33:14 +00:00
2026-10-22 12:46:24 +00:00
2026-10-06 10:39:16 +00:00
2026-10-30 18:33:14 +00:00
2026-10-22 12:46:24 +00:00
2026-10-22 12:46:24 +00:00
2026-10-30 20:53:25 +00:00
2026-10-22 12:46:24 +00:00
2026-10-27 16:16:17 +00:00
2026-10-26 21:20:21 +00:00
2026-10-22 12:46:24 +00:00
2026-11-03 06:05:55 +00:00
2026-10-30 18:33:14 +00:00
2026-10-05 18:52:51 +00:00
2026-10-05 18:52:51 +00:00
2026-10-05 18:52:51 +00:00
2026-11-02 07:27:49 +00:00
2026-11-02 07:27:49 +00:00
2026-10-27 22:59:22 +00:00
2026-10-27 22:01:13 +00:00
2026-10-30 18:33:14 +00:00
2026-10-27 19:11:56 +00:00
2026-11-03 02:08:56 +00:00
2026-10-26 21:46:26 +00:00
2026-10-26 21:46:26 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-10-30 18:33:14 +00:00
2026-09-04 10:22:43 +00:00