anomalyco / anomalyco/opencode

tool_output config option is undocumented

Open
#45,232 0 comments 0 reactions 1 assignee View on GitHub

@neriousy is already working on this.

Since Aug 26, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

tool_output has been a working config option since PR #23770 (merged 2026-04-22) and is not mentioned anywhere in the docs.

It is fully specified in both config schemas, with descriptions:

packages/core/src/v1/config/config.ts:

tool_output: Schema.optional(
  Schema.Struct({
    max_lines: Schema.optional(PositiveInt).annotate({
      description: "Maximum lines of tool output before it is truncated and saved to disk (default: 2000)",
    }),
    max_bytes: Schema.optional(PositiveInt).annotate({
      description: "Maximum bytes of tool output before it is truncated and saved to disk (default: 51200)",
    }),
  }),
)

and read at runtime in packages/opencode/src/tool/truncate.ts:

maxLines: cfg?.tool_output?.max_lines ?? MAX_LINES,
maxBytes: cfg?.tool_output?.max_bytes ?? MAX_BYTES,

Searching packages/web/src/content/docs/ for tool_output, max_lines or max_bytes returns nothing.

That matters because truncation is visible and often unwanted — a tool whose output crosses 2000 lines or 50 KB is replaced with a preview plus a file path, and #11313 is an example of users hitting it. The knob to raise it exists and is undiscoverable.

config.mdx has a dedicated section for nearly every other option (share, shell, subagent_depth, server, formatter, lsp, ...), so this looks like an oversight from when the feature landed rather than a deliberate omission.

For the record, config.mdx is also missing skills, references, enterprise, remote_config and username, plus the legacy autoshare/mode/layout keys. I kept the PR to tool_output since that is the one with a concrete user-facing consequence; happy to do the others separately if wanted.

Operating System

Windows 11 (documentation)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.