Skip to content

config: make tool progress and tool transcript truncation limits configurable #82246

Description

@mkowalski

Problem

Tool output truncation limits are currently hardcoded:

  • TOOL_PROGRESS_OUTPUT_MAX_CHARS = 8_000 in src/plugin-sdk/agent-harness-runtime.ts — controls how much live tool/progress output is streamed to the UI before being truncated with ...(truncated)...
  • TOOL_TRANSCRIPT_OUTPUT_MAX_CHARS = 12_000 in extensions/codex/src/app-server/event-projector.ts — controls how much tool result text is stored in session snapshots

These limits work well as defaults, but users may want to adjust them:

  • Lower limits for resource-constrained setups or when tool output is noisy
  • Higher limits when debugging complex tool chains or when tools produce meaningful output beyond the default caps (e.g., large file reads, long test suites)

Currently the only option is to modify source code.

Proposal

Add two new configuration fields under gateway.webchat:

Field Default Description
gateway.webchat.toolProgressMaxChars 8000 Max chars for live tool/progress output before truncation
gateway.webchat.toolTranscriptMaxChars 12000 Max chars for tool transcript/result content in session snapshots

These follow the existing pattern of gateway.webchat.chatHistoryMaxChars.

Implementation

  • Add fields to GatewayWebchatConfig type, Zod schema, schema help, and labels
  • Thread config through formatToolProgressOutput() and truncateToolTranscriptText()
  • Existing hardcoded constants become fallback defaults
  • Both fields are optional positive integers, capped at 500,000 (matching chatHistoryMaxChars)

🤖 This issue was filed by OpenClaw on behalf of @mkowalski.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions