continue icon indicating copy to clipboard operation
continue copied to clipboard

Continue returns an unbounded huge stdout tool result

Open trackoor opened this issue 5 months ago • 1 comments

Continue returns an unbounded huge stdout tool result

Before submitting your bug report

  • [x] I checked for duplicate local reproduction drafts.
  • [x] I reduced the reproducer to a single deterministic local-provider case.

Relevant environment info

  • OS: Linux x86_64 Docker
  • Continue version: @continuedev/cli 1.5.46
  • IDE version: CLI (cn), no IDE
  • Model: OpenAI-compatible local mock provider, gpt-4

Description

Severity / performance impact: High. A single shell tool call can return more than 8 KiB of output to the provider loop, increasing memory, context, and retry pressure instead of being truncated or rejected.

To reproduce

Prerequisites: Docker, Python 3, and the GitHub CLI (gh) for the clone command below. The linked reproducer is self-contained and uses only Python standard-library modules plus Docker. It builds the affected CLI version from the public package registry, starts a local mock provider, and runs the CLI in an isolated workspace. The Docker run is limited to 2 CPUs and 4 GiB RAM by default.

Complete self-contained reproducer: https://gist.github.com/N0zoM1z0/c4f31a3dec4788713d5f184054db17cf

The Gist contains continue-huge-stdout-resource-bound.reproduce.py. Download and run:

gh gist clone c4f31a3dec4788713d5f184054db17cf continue-huge-stdout-resource-bound-reproducer
cd continue-huge-stdout-resource-bound-reproducer
python3 continue-huge-stdout-resource-bound.reproduce.py

To reuse an already-built local image:

python3 continue-huge-stdout-resource-bound.reproduce.py --skip-build

Expected successful reproduction output includes:

REPRODUCED

Log output

Expected successful reproduction output includes REPRODUCED.

Observed behavior: The reproducer asks Continue to run a command that prints 100000 bytes and checks that a large tool result is sent back to the local provider.

Expected behavior

Continue should cap, summarize, or reject oversized tool output before sending it back into the model/provider loop.

Public-upstream status

This reproduces against stock public @continuedev/[email protected] built from npm.

trackoor avatar Jun 17 '26 02:06 trackoor

Implemented in https://github.com/continuedev/continue/pull/12728 - fix: Cap or truncate oversized terminal tool stdout before returning it to the m.

mvanhorn avatar Jun 17 '26 14:06 mvanhorn

This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue.

github-actions[bot] avatar Sep 16 '26 01:09 github-actions[bot]

@copilot review

trackoor avatar Sep 16 '26 02:09 trackoor

I re-ran the original standalone Docker reproducer against the current npm latest, @continuedev/[email protected] (checked 2026-09-19 UTC). The only change to the repro case was updating the package/image version from 1.5.46 to 1.5.47.

This still reproduces for me. The run completed normally, but the provider still received an oversized tool result:

  • provider_requests=2
  • tool_result_counts={'huge_stdout_probe': 1}
  • tool_result_bytes=50044
  • threshold check: tool_result_bytes_at_least: observed=50044 expected>=8192
  • final result: RUN_REPRODUCED / REPRODUCED

I also checked the linked fix PR, #12728, and it still appears open / not merged. So the issue still looks current on the latest published CLI.

N0zoM1z0 avatar Sep 19 '26 02:09 N0zoM1z0