Skip to content

fix(cli): prune tool outputs for large requests#10143

Merged
marius-kilocode merged 3 commits into
mainfrom
sprinkle-coat
May 11, 2026
Merged

fix(cli): prune tool outputs for large requests#10143
marius-kilocode merged 3 commits into
mainfrom
sprinkle-coat

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

Compacts older tool outputs when a model request has already grown large, reducing long-session request payloads without restoring default pruning after every normal turn.

Keeps normal-turn pruning opt-in for cache stability, while pruning after compaction and at payload-limit boundaries where the prompt prefix is already changing or too large to send efficiently.

Comment thread packages/opencode/src/session/prompt.ts
Comment thread packages/opencode/src/session/prompt.ts
@kilo-code-bot

kilo-code-bot Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Resolved Issues

Both warnings from the initial review were addressed in the latest commits:

File Line Resolution
packages/opencode/src/session/prompt.ts 1606 plugin.trigger("experimental.chat.messages.transform") is now re-applied inside the payload-limit rebuild path
packages/opencode/src/session/prompt.ts 1610–1611 Post-prune size is now computed (nextSize) and a log.warn is emitted if the payload remains oversized
Files Reviewed (3 files)
  • .changeset/large-session-tool-pruning.md — no issues
  • packages/opencode/src/session/compaction.ts — no issues
  • packages/opencode/src/session/prompt.ts — no issues

Reviewed by claude-sonnet-4.6 · 255,182 tokens

@marius-kilocode

Copy link
Copy Markdown
Collaborator Author

@kilocode-bot is this ready to be merged?

@kilo-code-bot

kilo-code-bot Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

To use Kilo from GitHub you first need to link your GitHub account to Kilo. Link your Kilo account to continue. After linking, mention me again in this issue or pull request.

@marius-kilocode

Copy link
Copy Markdown
Collaborator Author

@kilocode-bot is this ready to be merged?

@kilo-code-bot

kilo-code-bot Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

Based on the existing code review already completed on this PR, yes, it looks ready to merge! 🟢

The automated review gave it:

  • Status: No Issues Found
  • Recommendation: Merge

Both warnings from the initial review were resolved in subsequent commits:

  1. plugin.trigger(experimental.chat.messages.transform) is re-applied inside the payload-limit rebuild path
  2. Post-prune size is now computed (nextSize) and a log.warn is emitted if the payload remains oversized

All 3 files were reviewed with no outstanding issues. The change looks solid — it compacts older tool outputs at payload-limit boundaries while keeping normal-turn pruning opt-in for cache stability.

@marius-kilocode marius-kilocode merged commit ea023b0 into main May 11, 2026
13 checks passed
@marius-kilocode marius-kilocode deleted the sprinkle-coat branch May 11, 2026 15:09
jliounis pushed a commit to jliounis/kilocode that referenced this pull request May 19, 2026
* fix(cli): prune tool outputs for large requests

* chore(cli): annotate pruning changes

* fix(cli): preserve transforms after payload pruning
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.

2 participants