Skip to content

Large tool output is spilled to an OS temp file without a stable session artifact or paging interface #5003

Description

@mcodilla

Describe the bug

When a tool returns a large result, Copilot CLI replaces the result with a short preview and writes the full content to an operating-system temporary file. The response provides only a human-readable file path, with no stable session artifact ID, continuation token, or structured paging interface.

The agent must parse the message, copy the path into another tool call, and hope the temporary file remains available. This adds tool calls, consumes context, and makes the result difficult for API or GUI clients to handle reliably.

Affected version

1.0.89-7

Steps to reproduce the behavior

  1. Start GitHub Copilot CLI.

  2. Run a tool that produces more than approximately 20 KB of output, for example:

    Run git show for a commit with a large diff.
    

    A concrete shell command is:

    git --no-pager show --format=fuller --no-ext-diff <large-commit>
  3. Alternatively, invoke an MCP tool that returns a large structured response.

  4. Inspect the tool result.

Expected behavior

The complete result should be accessible through a stable, structured mechanism such as:

  • A session-scoped artifact identifier.
  • A continuation token with explicit paging.
  • A structured largeOutputFilePath field that clients and the agent can consume directly.
  • A built-in read operation tied to the original tool-call ID.

Any persisted output should live in the session artifact directory and remain available for the lifetime of the session.

Actual result

The CLI replaced the result with a message such as:

Output too large to read at once (52.4 KB). Saved to:
// ...
Consider using tools like rg (for searching), head/tail (for viewing start/end),
view with view_range (for specific sections), or jq (for JSON) to examine portions
of the output.

The path was embedded only in display text. Reading the full result required another tool call using that path.

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:toolsBuilt-in tools: file editing, shell, search, LSP, git, and tool call behavior

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions