Skip to content

docs(compression): the pressure pass truncates inside the protected tail; dispatched calls are never altered (#105574) - #115988

Merged
kshitijk4poor merged 1 commit into
NousResearch:mainfrom
kshitijk4poor:p1/docs-pressure-pass-truncates-protected-tail
Sep 19, 2026
Merged

kshitijk4poor merged 1 commit into
NousResearch:mainfrom
kshitijk4poor:p1/docs-pressure-pass-truncates-protected-tail

Conversation

@kshitijk4poor

Copy link
Copy Markdown
Contributor

configuration.md said argument truncation protects the most recent protect_last_n messages. It does not: Pass 4 (_pressure_demote_tail, #61932) truncates tool-call arguments and demotes tool results inside the protected tail whenever that tail alone exceeds 1.5× its token budget, and it runs on every compaction regardless of proactive_prune_tokens. The sentence now says so, and states the boundary that decides #105574: both passes rewrite the history copy the model re-reads only.

Why docs and not the exemption in #105598 (#105574, @ackellerman): the report's mechanism — a just-built delegate_task dispatch clipped to 200 chars before reaching its subagents — has no path on origin/main:

  • Tool execution reads arguments from the provider's response object (agent/tool_executor.py::_execute_tool_calls_sequential), never from history, and _execute_tool_calls runs before compress_after_tool_results (agent/turn_tool_round.py).
  • The crash → resume window raised on the thread: every resume surface canonicalizes the persisted history (agent/replay_cleanup.py::canonicalize_replay_history via turn_context, gateway/run.py, tui_gateway); a trailing unanswered assistant(tool_calls) is stripped (read-only) or stubbed UNKNOWN (side-effecting). It is never re-dispatched, so truncating its args in history changes what the model reads, not what any child receives.

What produces the observed ...[truncated] in a child is the model copying clipped JSON from history into a new call — the marker-imitation class tracked by #83843 / #83735 / #87217 / #83435.

One line in website/docs/user-guide/configuration.md. Request 4 of the issue; Co-authored-by @Halldrix, whose #105598 carried the docs sentence. Refs #105574.

`configuration.md` promised that argument truncation protects the most recent `protect_last_n`
messages. Pass 4 (`_pressure_demote_tail`, NousResearch#61932) does not honour that promise: whenever the
protected tail alone exceeds 1.5x its token budget it demotes tool results and truncates tool-call
arguments inside the tail, and it runs on every compaction regardless of `proactive_prune_tokens`.
State that, and state the boundary that matters for NousResearch#105574: both passes rewrite the history copy
only — tool execution reads arguments from the provider's response object
(`agent/tool_executor.py`) and a resumed dangling tool-call tail is stripped or stubbed by
`agent/replay_cleanup.py` before it can be re-sent — so a dispatched call's arguments are never
changed by compression.

Docs half of NousResearch#105598 by @Halldrix (request 4 of NousResearch#105574).

Co-authored-by: Halldrix <12357213+Halldrix@users.noreply.github.com>
@alt-glitch alt-glitch added type/docs Documentation improvements P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint area/compression Context compression and continuation sessions labels Sep 19, 2026
@kshitijk4poor
kshitijk4poor merged commit 7f020b4 into NousResearch:main Sep 19, 2026
59 of 61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/compression Context compression and continuation sessions comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have type/docs Documentation improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants