Skip to content

fix(core): bound session shell output in model-facing messages - #52024

Closed
lab1207 wants to merge 1 commit into
anomalyco:devfrom
lab1207:shell-output-cap
Closed

lab1207 wants to merge 1 commit into
anomalyco:devfrom
lab1207:shell-output-cap

Conversation

@lab1207

@lab1207 lab1207 commented Sep 29, 2026

Copy link
Copy Markdown

Closes #45099.

Session shell messages reached the provider request verbatim (to-llm-message.ts), so a large shell output could exceed context, fail as provider.unknown, and strand the session.

Notes on master vs the issue: SHELL_MAX_CAPTURE_BYTES and tool-output.ts no longer exist (renamed to tool-output-store.ts), and V2 Session.shell is currently unimplemented, so the remaining live defect is the uncapped interpolation. This bounds it.

Changes:

  • packages/core/src/session/runner/to-llm-message.ts: 50 KiB bounded preview via ToolOutputStore.MAX_BYTES, full output stays in session history
  • packages/core/test/session-runner-message.test.ts: regression test with 1 MiB output

Verification:

  • bun test test/session-runner-message.test.ts (packages/core): 7 pass
  • bun typecheck (packages/core): clean
  • oxlint: 0 errors, 2 pre-existing warnings (verified identical on baseline)

Session shell messages reached the provider request verbatim, stranding sessions on context overflow. The model now receives a 50 KiB bounded preview matching the tool-output limit; full output stays in session history.
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Sep 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Sep 29, 2026
@github-actions github-actions Bot closed this Sep 29, 2026
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.

core: session shell output bypasses tool limits and strands sessions

1 participant