Skip to content

Commit 6303765

Browse files
BlackyCatyCopilothubwriter
authored
Document Copilot CLI large tool output limit (#62286)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: hubwriter <hubwriter@github.com>
1 parent ff7f57f commit 6303765

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

content/copilot/concepts/agents/copilot-cli/context-management.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@ The context window has a fixed size, measured in tokens, that varies by model. T
2626

2727
All of this accumulates in the context window. In a long or complex session, the context window can fill up.
2828

29-
### Why the context window matters
29+
### Managing large tool output
30+
31+
To prevent a single tool response from consuming too much of the context window, tool output larger than 20 KiB is saved to a temporary file by default. The model receives the file path and a preview instead of the full output. This applies to all tools, including tools provided by MCP servers.
32+
33+
To change the limit, set `COPILOT_LARGE_OUTPUT_THRESHOLD_BYTES` to a positive number of UTF-8 bytes before starting the CLI. Increasing the limit leaves less context available for the conversation and subsequent tool calls.
34+
35+
## Why the context window matters
3036

3137
The context window is what gives {% data variables.product.prodname_copilot_short %} its "memory" of your conversation. Everything inside the context window is available for {% data variables.product.prodname_copilot_short %} to reference when responding to you.
3238

content/copilot/reference/copilot-cli-reference/cli-command-reference.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ copilot --allow-tool='MyMCP'
465465
| `COPILOT_GH_HOST` |{% data variables.product.github %} hostname for {% data variables.copilot.copilot_cli_short %} only, overriding `GH_HOST`. Use when `GH_HOST` targets {% data variables.product.prodname_ghe_server %} but {% data variables.product.prodname_copilot_short %} needs to authenticate against {% data variables.product.prodname_dotcom_the_website %} or a {% data variables.product.prodname_ghe_cloud %} hostname. |
466466
| `COPILOT_GITHUB_TOKEN` | Authentication token. Takes precedence over `GH_TOKEN` and `GITHUB_TOKEN`. |
467467
| `COPILOT_HOME` | Override the configuration and state directory. Default: `$HOME/.copilot`. |
468+
| `COPILOT_LARGE_OUTPUT_THRESHOLD_BYTES` | Maximum UTF-8 byte size for tool output returned directly to the model. Default: `20480` (20 KiB). See [AUTOTITLE](/copilot/concepts/agents/copilot-cli/context-management#managing-large-tool-output). |
468469
| `COPILOT_MODEL` | Set the AI model. |
469470
| `COPILOT_PROMPT_FRAME` | Set to `1` to enable the decorative UI frame around the input prompt, or `0` to disable it. Overrides the `PROMPT_FRAME` experimental feature flag for the current session. |
470471
| `COPILOT_SKILLS_DIRS` | Comma-separated list of additional directories for skills. |

0 commit comments

Comments
 (0)