Skip to content

feat(tools): spill tool output as a tail-only window - #2425

Merged
Aaronontheweb merged 3 commits into
netclaw-dev:devfrom
Aaronontheweb:feature/tool-spill-tail-window
Oct 9, 2026
Merged

Aaronontheweb merged 3 commits into
netclaw-dev:devfrom
Aaronontheweb:feature/tool-spill-tail-window

Conversation

@Aaronontheweb

Copy link
Copy Markdown
Collaborator

What

Change tool-output spill bounding from a symmetric head+tail window to tail-only. When a tool result exceeds the inline budget, Netclaw keeps only the last budget chars inline and drops the head; the full result still spills to the session file, and the model continues through tool_output_read (opaque CallId + Start/Limit) to pull the dropped front back.

Why

The head+tail split is confusing and assumes useful content is evenly distributed. For command-like output (shell, logs, stack traces) the useful content is at the tail. Tail-only is simpler to reason about and matches how agents read command output. tool_output_read already recovers the dropped leading/middle content, so nothing is lost.

What changed

  • BoundedOutputReader.Window: now returns Separator + last budget chars when over budget.
  • BoundedOutputAccumulator: rewritten to a single tail ring; removed the _head buffer; Finish() still reports Truncated.
  • ToolOutputSpill: doc/comment updates only (no behavior change in Compose; it still names the opaque CallId).
  • Updated BoundedOutputReaderTests and ToolOutputSpillTests to assert tail-only behavior.

Verification

  • Build: Netclaw.Actors and Netclaw.Actors.Tests succeed, 0 warnings.
  • Tests: BoundedOutputReaderTests + ToolOutputSpillTests + ToolOutputSpillFreshSessionTests = 45 passed / 0 failed. ShellToolTests = 41 passed / 1 skipped (Windows host).
  • dotnet slopwatch analyze: 0 issues.
  • Copyright headers verified intact on changed files.

Keep only the last budget chars of an oversized tool result inline,
instead of a symmetric head+tail split. The full result still spills
to the session file, and the model continues through tool_output_read
to pull the dropped front back. Rewrites BoundedOutputReader.Window and
the BoundedOutputAccumulator to a single tail ring, and updates the
reader and spill tests to assert tail-only behavior.
@Aaronontheweb
Aaronontheweb enabled auto-merge (squash) October 9, 2026 17:17
@Aaronontheweb
Aaronontheweb disabled auto-merge October 9, 2026 18:07
@Aaronontheweb
Aaronontheweb force-pushed the feature/tool-spill-tail-window branch from cbb9e87 to eb7e718 Compare October 9, 2026 18:07
@Aaronontheweb
Aaronontheweb enabled auto-merge (squash) October 9, 2026 18:07
@Aaronontheweb
Aaronontheweb merged commit bc3bead into netclaw-dev:dev Oct 9, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant