Repository navigation
fix: keep a sub-agent's task when a retry reloads oversized history - #201636
Conversation
Root cause: src/config/sessions/session-model-context-window.ts:168 slices the bounded history suffix inside the current turn when that turn's tool frames exceed the byte cap, dropping the user request that opened the turn. An in-turn transient retry reloads history through this window, so it answered without its task. The window now keeps the turn's opening request in front of the newest affordable frames; a request that cannot fit keeps the old suffix. Fixes #201605
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Base |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesPreserve the current turn’s opening request when a retry reloads oversized history, while retaining byte limits and canonical tool-result ownership. Example: A child running CHILD-TASK-201605 reads two large images and encounters degenerate_output.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes demonstrated task loss during oversized-history retries, and the earlier tool-ownership finding is resolved; no actionable defects remain, with exact-head CI still pending. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe session model-context selector converts canonical transcript requests and resource limits into bounded history loaded by agent attempts and retries. flowchart LR
A[Canonical transcript] --> B[Context projection]
B --> C[Bounded history selector]
C --> D[Task and owned recent frames]
D --> E[Agent retry]
E --> F[Provider request]
Technical reviewBest possible solution: Retain the affordable opening task in the existing bounded selector while preserving required summaries, hard limits, and canonical tool-result ownership. Do we have a high-confidence way to reproduce the issue? Supplied Gateway captures reproduce task loss twice on the pinned base after large image results and degenerate output; source inspection confirms the responsible suffix selection, and no target code was executed during this review. Is this the best way to solve the issue? The change repairs the existing selection owner directly, reuses its bounded-tail logic, and now preserves the canonical pairing facts that the earlier implementation lost. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c6f10e80c474. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +30, Tests +41, Docs +3. Total +74 across 3 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 19, 2026, 1:27 AM ET / 06:27 UTC (Revision 2). |
The pinned tail is selected without the calls before the request, so validate it against the canonical tool-result owners and keep the plain suffix when a result would lose its call.
|
Re-run on |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Maintainer override:
|
|
Thanks @mike1122real-hub for the detailed report. This is merged in adda3db: when a sub-agent's turn fails mid-stream and is retried, the retry now keeps the message that started the turn (the sub-agent's task) even when large tool results such as screenshots fill the retry's history window, so the sub-agent continues its task instead of answering without it. The history byte cap is unchanged, and a tool result is never kept without its call. |
…201636) Root cause: src/config/sessions/session-model-context-window.ts:168 takes a history suffix that starts inside the current turn when that turn's tool results exceed the history byte cap, so a retry that reloads history mid-turn loses the request that opened the turn. Fixes #201605 ## What Problem This Solves A sub-agent working through a long, tool-heavy task (screenshots, large reads) can hit a provider stream error such as `degenerate_output`. OpenClaw retries on the same model, but the retry's request no longer contains the sub-agent's task. The model only sees the system prompt, a failure note and "continue the current task", so it answers without doing the work and the parent receives a "completed" child that did nothing. ## User Impact User impact: after a transient provider failure, a sub-agent (or any agent turn) whose tool results have grown past the history byte cap retries with its task still in front of the model and continues the work. Turns under the cap, new turns, and retries whose failed stream produced no output are unchanged. ## Why This Change Was Made The first attempt builds its history in memory. A retry reloads the transcript through the bounded history window, which keeps the newest events that fit in eight bytes per context token. Inside one long turn there is no later turn boundary to align to, so the window kept only the newest tool frames and dropped the turn's user request. The internal continuation prompt then became the first user message, which is the `historyRewrite(message 0 (user) differs ...)` line in the report. The window now keeps the request that opened the current turn and fills the rest of the cap with the newest frames, the same way it already reserves the latest compaction summary. If that request cannot fit beside any frame, the old suffix is kept. Saved history is not changed. ## Evidence Real Gateway from source with a local OpenAI Responses provider that records every request. The parent calls `sessions_spawn` with a task; the child reads two screenshot-sized images, then its third stream emits text followed by a runaway tool call that trips `degenerate_output`. - `main` (67aacbb), twice: the retry request is `[system, failed-turn note, "Continue the current task...", runtime context]`, with no task. The child ends with `stopReason=stop` 1.3 s later. - This branch, twice: the retry request starts with the same task message as the first attempt, and the child continues the task. - Controls on both builds: a sub-agent turn that does not fail is identical; an output-free failure and a small-history failure already kept the task. - Regression test `keeps the current turn's request when its tool frames exceed the byte cap`: fails on `main` (`expected [ 3, 4, 5 ] to deeply equal [ +0, 3, 4, 5 ]`), passes here. Observed request lines: #201636 (comment) Re-run after the review fix (tool ownership kept): #201636 (comment) Thanks @mike1122real-hub for the detailed report with the four failure timings and the history-rewrite line. ## Merge danger Two-way door: the change only selects which saved events are loaded for one model request and writes nothing, so a revert fully restores the old selection. Blast radius: embedded agent turns whose loaded history exceeds the byte cap in the middle of a turn; they now send the turn's request plus slightly fewer of the oldest tool frames from that turn. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit adda3db) Co-authored-by: RomneyDa <[email protected]>
…penclaw#201636) Root cause: src/config/sessions/session-model-context-window.ts:168 takes a history suffix that starts inside the current turn when that turn's tool results exceed the history byte cap, so a retry that reloads history mid-turn loses the request that opened the turn. Fixes openclaw#201605 ## What Problem This Solves A sub-agent working through a long, tool-heavy task (screenshots, large reads) can hit a provider stream error such as `degenerate_output`. OpenClaw retries on the same model, but the retry's request no longer contains the sub-agent's task. The model only sees the system prompt, a failure note and "continue the current task", so it answers without doing the work and the parent receives a "completed" child that did nothing. ## User Impact User impact: after a transient provider failure, a sub-agent (or any agent turn) whose tool results have grown past the history byte cap retries with its task still in front of the model and continues the work. Turns under the cap, new turns, and retries whose failed stream produced no output are unchanged. ## Why This Change Was Made The first attempt builds its history in memory. A retry reloads the transcript through the bounded history window, which keeps the newest events that fit in eight bytes per context token. Inside one long turn there is no later turn boundary to align to, so the window kept only the newest tool frames and dropped the turn's user request. The internal continuation prompt then became the first user message, which is the `historyRewrite(message 0 (user) differs ...)` line in the report. The window now keeps the request that opened the current turn and fills the rest of the cap with the newest frames, the same way it already reserves the latest compaction summary. If that request cannot fit beside any frame, the old suffix is kept. Saved history is not changed. ## Evidence Real Gateway from source with a local OpenAI Responses provider that records every request. The parent calls `sessions_spawn` with a task; the child reads two screenshot-sized images, then its third stream emits text followed by a runaway tool call that trips `degenerate_output`. - `main` (78f5d6e), twice: the retry request is `[system, failed-turn note, "Continue the current task...", runtime context]`, with no task. The child ends with `stopReason=stop` 1.3 s later. - This branch, twice: the retry request starts with the same task message as the first attempt, and the child continues the task. - Controls on both builds: a sub-agent turn that does not fail is identical; an output-free failure and a small-history failure already kept the task. - Regression test `keeps the current turn's request when its tool frames exceed the byte cap`: fails on `main` (`expected [ 3, 4, 5 ] to deeply equal [ +0, 3, 4, 5 ]`), passes here. Observed request lines: openclaw#201636 (comment) Re-run after the review fix (tool ownership kept): openclaw#201636 (comment) Thanks @mike1122real-hub for the detailed report with the four failure timings and the history-rewrite line. ## Merge danger Two-way door: the change only selects which saved events are loaded for one model request and writes nothing, so a revert fully restores the old selection. Blast radius: embedded agent turns whose loaded history exceeds the byte cap in the middle of a turn; they now send the turn's request plus slightly fewer of the oldest tool frames from that turn. Co-authored-by: Ayaan Zaidi <[email protected]>
…#203536) Result: between two compactions, the history the model sees now only grows. It no longer slides on each new attempt, so the provider prompt cache and the OpenAI Responses continuation keep matching. Token-based compaction is the only step that shortens it. ## What Problem This Solves Each attempt (a new turn, a subagent settle, `sessions_send`, a retry) loads history through `selectBoundedModelRequests` with a byte cap of `contextTokenBudget × 8`. The attempt then grows that history in memory with no cap. The next attempt reloads it and cuts the oldest turns again. Message 0/1 moves, the Responses continuation becomes `history_changed`/`history_shorter`, and the full replay hits only instructions and tools. The cap counts serialized bytes. Encrypted reasoning, thinking signatures, images and event envelopes use 8-30 bytes per token, so the cut fires far below the token budget (1-2 MB for 70-170k tokens of a 272k budget). The cut also hides the dropped history from the compaction estimate, so the session slides on every quarter-cap of growth and never compacts. On a busy production host this is the largest remaining cache loss: 186 head cuts in 24 h, 14.64M uncached input tokens (1.84% of input). All are `request=1`, the first request of an attempt. ## Why This Change Was Made Repo rule (AGENTS.md, stable conversation context): "Preserve transcript bytes; only compaction rewrites history." The hydration cut rewrote history outside compaction. - `resolveEmbeddedSessionContextLimits` returns a fixed 16 MiB / 10,000-event guard. It no longer depends on the token budget. 16 MiB stays below the smallest provider request-body limit (Gemini inline data, 20 MB). Images count only about 2,000 tokens each in the compaction estimate, so a larger guard could let a request pass a body limit before compaction fires. - Token compaction (preflight, mid-turn precheck, overflow recovery) already owns model-context size. It now sees the whole history since the boundary, so a long session compacts once, as a recorded and declared rebuild, instead of sliding on every attempt. - The `contextTokenBudget` plumbing that existed only for this cap is removed (`prepareRecoverySession`, `readCompactionTranscriptBytes`, `readPreflightTranscriptContextMessages`). - Unchanged: `selectBoundedModelRequests` and its fallbacks (quarter-cap steps, #191146 trailing prompt, #201636 in-turn request reservation). They now run only past the 16 MiB guard. The settled-tool finalizer keeps `toolResultOverflow: "omit"` (#184704). With the larger guard, it keeps every result body in every case that fit before. - Rejected: a sticky recorded cut (it still moves once per growth step, and it needs a new boundary writer outside compaction) and byte counting that excludes opaque fields (that needs per-provider payload parsing). Accepted edge cases, without code: - A session that passes 16 MiB before it compacts (a long run of screenshots) still slides in 4 MiB steps, not 512 KB steps. - On deploy, a session that already slid loads its history again once (one uncached replay). Then it can compact. - Plugin harnesses that use `resolveAgentHarnessHistoryLimits` (Plugin SDK) keep their own budget-based bound. That is a public SDK export with different seeding semantics, so it gets its own follow-up. ## Evidence **Regression step on every transport.** The step is in the prefix-stability journey (`test/prompt-cache-prefix-stability.test-support.ts`). A chat on the 64k-window model views four incompressible screenshots: more than 512 KB, the old cut, and far below compaction. Two plain turns follow. Each turn is a new attempt, and every request must extend the previous one. - Base `8d1e59c2fddc`: red on all 5 transports (anthropic, bedrock, google, openai-completions, openai-responses), with two `message 0` breaks each. - This head: green on all 5. - Mutation: the head with the old `budget × 8` cap restored is red again. **Scratch Gateway E2E.** Native `https://api.openai.com/v1`, `openai/gpt-6.2-astra`, Code Mode, 64k context window. Six turns: four view screenshots, two are plain. Request bodies and `response.completed` usage were captured. | req | base status | base input / cached | head status | head input / cached | |---|---|---|---|---| | 1-6 | first, then `continued` | 17096/0 … 18214/18099 | same | same | | 7 (turn 3, request=1) | `history_shorter`, msg 1 moved, 10 items sent in full | 17959 / **16430** | `continued`, 2 items sent | 18853 / 18211 | | 8-10 | `continued` | … 18853/18738 | `continued` | … 19747/19632 | | 11 (turn 5, request=1) | `history_shorter`, msg 1 moved, 13 items sent in full | 18598 / **16430** | `continued`, 2 items sent | 20386 / 19744 | | 12 | `continued` | 19237/18030 | `continued` | 21025/19818 | 16430 is the instructions+tools prefix alone. Base logged `historyRewrite(message 0 (user) differs ...)` twice, and head logged it zero times. Tests: the touched test files and every test file that imports a changed source (31 files), `pnpm check:changed`, oxfmt and oxlint. ## What Changes for Users Long sessions with reasoning, screenshots or many tool calls keep their prompt cache across turns, subagent settles and retries. The model also sees its full history until compaction, where before old turns were dropped silently. ## Merge danger Two-way door. No schema, config or stored-row change. A revert restores the budget-based cut. Blast radius: embedded attempts whose history since the last compaction is larger than 8 bytes per budget token. These now send more history, and token compaction trims it. Co-authored-by: Ayaan Zaidi <[email protected]>
…openclaw#203536) Result: between two compactions, the history the model sees now only grows. It no longer slides on each new attempt, so the provider prompt cache and the OpenAI Responses continuation keep matching. Token-based compaction is the only step that shortens it. ## What Problem This Solves Each attempt (a new turn, a subagent settle, `sessions_send`, a retry) loads history through `selectBoundedModelRequests` with a byte cap of `contextTokenBudget × 8`. The attempt then grows that history in memory with no cap. The next attempt reloads it and cuts the oldest turns again. Message 0/1 moves, the Responses continuation becomes `history_changed`/`history_shorter`, and the full replay hits only instructions and tools. The cap counts serialized bytes. Encrypted reasoning, thinking signatures, images and event envelopes use 8-30 bytes per token, so the cut fires far below the token budget (1-2 MB for 70-170k tokens of a 272k budget). The cut also hides the dropped history from the compaction estimate, so the session slides on every quarter-cap of growth and never compacts. On a busy production host this is the largest remaining cache loss: 186 head cuts in 24 h, 14.64M uncached input tokens (1.84% of input). All are `request=1`, the first request of an attempt. ## Why This Change Was Made Repo rule (AGENTS.md, stable conversation context): "Preserve transcript bytes; only compaction rewrites history." The hydration cut rewrote history outside compaction. - `resolveEmbeddedSessionContextLimits` returns a fixed 16 MiB / 10,000-event guard. It no longer depends on the token budget. 16 MiB stays below the smallest provider request-body limit (Gemini inline data, 20 MB). Images count only about 2,000 tokens each in the compaction estimate, so a larger guard could let a request pass a body limit before compaction fires. - Token compaction (preflight, mid-turn precheck, overflow recovery) already owns model-context size. It now sees the whole history since the boundary, so a long session compacts once, as a recorded and declared rebuild, instead of sliding on every attempt. - The `contextTokenBudget` plumbing that existed only for this cap is removed (`prepareRecoverySession`, `readCompactionTranscriptBytes`, `readPreflightTranscriptContextMessages`). - Unchanged: `selectBoundedModelRequests` and its fallbacks (quarter-cap steps, openclaw#191146 trailing prompt, openclaw#201636 in-turn request reservation). They now run only past the 16 MiB guard. The settled-tool finalizer keeps `toolResultOverflow: "omit"` (openclaw#184704). With the larger guard, it keeps every result body in every case that fit before. - Rejected: a sticky recorded cut (it still moves once per growth step, and it needs a new boundary writer outside compaction) and byte counting that excludes opaque fields (that needs per-provider payload parsing). Accepted edge cases, without code: - A session that passes 16 MiB before it compacts (a long run of screenshots) still slides in 4 MiB steps, not 512 KB steps. - On deploy, a session that already slid loads its history again once (one uncached replay). Then it can compact. - Plugin harnesses that use `resolveAgentHarnessHistoryLimits` (Plugin SDK) keep their own budget-based bound. That is a public SDK export with different seeding semantics, so it gets its own follow-up. ## Evidence **Regression step on every transport.** The step is in the prefix-stability journey (`test/prompt-cache-prefix-stability.test-support.ts`). A chat on the 64k-window model views four incompressible screenshots: more than 512 KB, the old cut, and far below compaction. Two plain turns follow. Each turn is a new attempt, and every request must extend the previous one. - Base `735a7475c1fb`: red on all 5 transports (anthropic, bedrock, google, openai-completions, openai-responses), with two `message 0` breaks each. - This head: green on all 5. - Mutation: the head with the old `budget × 8` cap restored is red again. **Scratch Gateway E2E.** Native `https://api.openai.com/v1`, `openai/gpt-6.2-astra`, Code Mode, 64k context window. Six turns: four view screenshots, two are plain. Request bodies and `response.completed` usage were captured. | req | base status | base input / cached | head status | head input / cached | |---|---|---|---|---| | 1-6 | first, then `continued` | 17096/0 … 18214/18099 | same | same | | 7 (turn 3, request=1) | `history_shorter`, msg 1 moved, 10 items sent in full | 17959 / **16430** | `continued`, 2 items sent | 18853 / 18211 | | 8-10 | `continued` | … 18853/18738 | `continued` | … 19747/19632 | | 11 (turn 5, request=1) | `history_shorter`, msg 1 moved, 13 items sent in full | 18598 / **16430** | `continued`, 2 items sent | 20386 / 19744 | | 12 | `continued` | 19237/18030 | `continued` | 21025/19818 | 16430 is the instructions+tools prefix alone. Base logged `historyRewrite(message 0 (user) differs ...)` twice, and head logged it zero times. Tests: the touched test files and every test file that imports a changed source (31 files), `pnpm check:changed`, oxfmt and oxlint. ## What Changes for Users Long sessions with reasoning, screenshots or many tool calls keep their prompt cache across turns, subagent settles and retries. The model also sees its full history until compaction, where before old turns were dropped silently. ## Merge danger Two-way door. No schema, config or stored-row change. A revert restores the budget-based cut. Blast radius: embedded attempts whose history since the last compaction is larger than 8 bytes per budget token. These now send more history, and token compaction trims it. Co-authored-by: Ayaan Zaidi <[email protected]>
…penclaw#201636) Root cause: src/config/sessions/session-model-context-window.ts:168 takes a history suffix that starts inside the current turn when that turn's tool results exceed the history byte cap, so a retry that reloads history mid-turn loses the request that opened the turn. Fixes openclaw#201605 ## What Problem This Solves A sub-agent working through a long, tool-heavy task (screenshots, large reads) can hit a provider stream error such as `degenerate_output`. OpenClaw retries on the same model, but the retry's request no longer contains the sub-agent's task. The model only sees the system prompt, a failure note and "continue the current task", so it answers without doing the work and the parent receives a "completed" child that did nothing. ## User Impact User impact: after a transient provider failure, a sub-agent (or any agent turn) whose tool results have grown past the history byte cap retries with its task still in front of the model and continues the work. Turns under the cap, new turns, and retries whose failed stream produced no output are unchanged. ## Why This Change Was Made The first attempt builds its history in memory. A retry reloads the transcript through the bounded history window, which keeps the newest events that fit in eight bytes per context token. Inside one long turn there is no later turn boundary to align to, so the window kept only the newest tool frames and dropped the turn's user request. The internal continuation prompt then became the first user message, which is the `historyRewrite(message 0 (user) differs ...)` line in the report. The window now keeps the request that opened the current turn and fills the rest of the cap with the newest frames, the same way it already reserves the latest compaction summary. If that request cannot fit beside any frame, the old suffix is kept. Saved history is not changed. ## Evidence Real Gateway from source with a local OpenAI Responses provider that records every request. The parent calls `sessions_spawn` with a task; the child reads two screenshot-sized images, then its third stream emits text followed by a runaway tool call that trips `degenerate_output`. - `main` (67aacbb), twice: the retry request is `[system, failed-turn note, "Continue the current task...", runtime context]`, with no task. The child ends with `stopReason=stop` 1.3 s later. - This branch, twice: the retry request starts with the same task message as the first attempt, and the child continues the task. - Controls on both builds: a sub-agent turn that does not fail is identical; an output-free failure and a small-history failure already kept the task. - Regression test `keeps the current turn's request when its tool frames exceed the byte cap`: fails on `main` (`expected [ 3, 4, 5 ] to deeply equal [ +0, 3, 4, 5 ]`), passes here. Observed request lines: openclaw#201636 (comment) Re-run after the review fix (tool ownership kept): openclaw#201636 (comment) Thanks @mike1122real-hub for the detailed report with the four failure timings and the history-rewrite line. ## Merge danger Two-way door: the change only selects which saved events are loaded for one model request and writes nothing, so a revert fully restores the old selection. Blast radius: embedded agent turns whose loaded history exceeds the byte cap in the middle of a turn; they now send the turn's request plus slightly fewer of the oldest tool frames from that turn. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit adda3db) Release adaptation: Source selector and regression unchanged; retained compaction note; exact 41-line regression allocation. Red on pinned production, 7 tests green after fix (2.22s). Co-authored-by: RomneyDa <[email protected]>
…201636) Baseline adaptation: Reserve the current request only under byte pressure, using baseline event/sizing rules and occurrence-aware tool ownership. No storage or config schema change. (cherry picked from commit adda3db) Co-authored-by: RomneyDa <[email protected]>
Root cause: src/config/sessions/session-model-context-window.ts:168 takes a history suffix that starts inside the current turn when that turn's tool results exceed the history byte cap, so a retry that reloads history mid-turn loses the request that opened the turn.
Fixes #201605
What Problem This Solves
A sub-agent working through a long, tool-heavy task (screenshots, large reads) can hit a provider stream error such as
degenerate_output. OpenClaw retries on the same model, but the retry's request no longer contains the sub-agent's task. The model only sees the system prompt, a failure note and "continue the current task", so it answers without doing the work and the parent receives a "completed" child that did nothing.User Impact
User impact: after a transient provider failure, a sub-agent (or any agent turn) whose tool results have grown past the history byte cap retries with its task still in front of the model and continues the work. Turns under the cap, new turns, and retries whose failed stream produced no output are unchanged.
Why This Change Was Made
The first attempt builds its history in memory. A retry reloads the transcript through the bounded history window, which keeps the newest events that fit in eight bytes per context token. Inside one long turn there is no later turn boundary to align to, so the window kept only the newest tool frames and dropped the turn's user request. The internal continuation prompt then became the first user message, which is the
historyRewrite(message 0 (user) differs ...)line in the report.The window now keeps the request that opened the current turn and fills the rest of the cap with the newest frames, the same way it already reserves the latest compaction summary. If that request cannot fit beside any frame, the old suffix is kept. Saved history is not changed.
Evidence
Real Gateway from source with a local OpenAI Responses provider that records every request. The parent calls
sessions_spawnwith a task; the child reads two screenshot-sized images, then its third stream emits text followed by a runaway tool call that tripsdegenerate_output.main(67aacbb), twice: the retry request is[system, failed-turn note, "Continue the current task...", runtime context], with no task. The child ends withstopReason=stop1.3 s later.keeps the current turn's request when its tool frames exceed the byte cap: fails onmain(expected [ 3, 4, 5 ] to deeply equal [ +0, 3, 4, 5 ]), passes here.Observed request lines: #201636 (comment)
Re-run after the review fix (tool ownership kept): #201636 (comment)
Thanks @mike1122real-hub for the detailed report with the four failure timings and the history-rewrite line.
Merge danger
Two-way door: the change only selects which saved events are loaded for one model request and writes nothing, so a revert fully restores the old selection. Blast radius: embedded agent turns whose loaded history exceeds the byte cap in the middle of a turn; they now send the turn's request plus slightly fewer of the oldest tool frames from that turn.