openclaw - ✅(Solved) Fix [Feature]: pty setting [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#44603Fetched 2026-04-08 00:44:40
View on GitHub
Comments
0
Participants
1
Timeline
10
Reactions
0
Participants
Timeline (top)
referenced ×8cross-referenced ×1labeled ×1

{ "tools": { "exec": { "timeoutSec": 900, "pty": true // 全局默认启用 pty } } }

See the intermediate results of loss output, i cannot use pty

Root Cause

Issue: Add pty as a global configuration option in tools.exec



Affected Users/Systems/Channels



  • All OpenClaw users who run long-running CLI tools that produce streaming output (e.g., AI agents, data processing scripts, build tools)
  • Skill developers who create skills invoking Python/Node scripts with real-time progress updates
  • Enterprise users deploying OpenClaw for automated workflows requiring user feedback during execution 

Severity

 Workflow Blocker — Without global pty configuration, users cannot see real-time output from exec commands. All stdout is buffered and displayed only after the command completes. For long-running tasks (5-15 minutes), users see no feedback and may assume the system is frozen or broken. 

Frequency

 Always — This affects every exec command that produces streaming output when pty: true is not explicitly passed by the LLM. Since pty is only available as a per-call parameter (not a global default), users must rely on the LLM to include pty: true in every exec call, which is unreliable. 

Consequences



  1. Poor User Experience: Users wait 5-15 minutes with no visible progress, leading to confusion and frustration
  2. Perceived System Failure: Users may cancel or restart tasks thinking the system is unresponsive
  3. Unreliable Workarounds: Adding pty: true instructions in SKILL.md does not guarantee LLM compliance
  4. No Python-side Fix: Even with PYTHONUNBUFFERED=1, flush=True, and stdbuf -oL, output remains buffered because OpenClaw's exec uses pipe mode (full buffering) instead of PTY mode (line buffering) 

Technical Root Cause

 In src/agents/bash-tools.exec.ts line 466:

const usePty = params.pty === true && !sandbox;

 Unlike timeoutSec which has a defaults fallback, pty has no global default. The fix would be:

const usePty = (params.pty ?? defaults?.pty) === true && !sandbox;

 And adding pty: z.boolean().optional() to ToolExecBaseShape in the config schema. 

Requested Solution

 Allow tools.exec.pty: true in openclaw.json to enable PTY mode by default for all exec commands.

Fix Action

Fix / Workaround

Issue: Add pty as a global configuration option in tools.exec



Affected Users/Systems/Channels



  • All OpenClaw users who run long-running CLI tools that produce streaming output (e.g., AI agents, data processing scripts, build tools)
  • Skill developers who create skills invoking Python/Node scripts with real-time progress updates
  • Enterprise users deploying OpenClaw for automated workflows requiring user feedback during execution 

Severity

 Workflow Blocker — Without global pty configuration, users cannot see real-time output from exec commands. All stdout is buffered and displayed only after the command completes. For long-running tasks (5-15 minutes), users see no feedback and may assume the system is frozen or broken. 

Frequency

 Always — This affects every exec command that produces streaming output when pty: true is not explicitly passed by the LLM. Since pty is only available as a per-call parameter (not a global default), users must rely on the LLM to include pty: true in every exec call, which is unreliable. 

Consequences



  1. Poor User Experience: Users wait 5-15 minutes with no visible progress, leading to confusion and frustration
  2. Perceived System Failure: Users may cancel or restart tasks thinking the system is unresponsive
  3. Unreliable Workarounds: Adding pty: true instructions in SKILL.md does not guarantee LLM compliance
  4. No Python-side Fix: Even with PYTHONUNBUFFERED=1, flush=True, and stdbuf -oL, output remains buffered because OpenClaw's exec uses pipe mode (full buffering) instead of PTY mode (line buffering) 

Technical Root Cause

 In src/agents/bash-tools.exec.ts line 466:

const usePty = params.pty === true && !sandbox;

 Unlike timeoutSec which has a defaults fallback, pty has no global default. The fix would be:

const usePty = (params.pty ?? defaults?.pty) === true && !sandbox;

 And adding pty: z.boolean().optional() to ToolExecBaseShape in the config schema. 

Requested Solution

 Allow tools.exec.pty: true in openclaw.json to enable PTY mode by default for all exec commands.

PR fix notes

PR #45976: feat(exec): add global pty config option for tools.exec (closes #44603)

Description (problem / solution / changelog)

Summary

  • Problem: pty mode for exec commands can only be set per-call by the LLM. There is no global config default, so users running long-running commands see buffered output (displayed all at once after completion) unless the LLM explicitly passes pty: true.
  • Why it matters: Users running 5-15 minute tasks see no output and may think the system is frozen.
  • What changed: Added pty as an optional boolean to the exec tool config schema (ToolExecBaseShape) and ExecToolDefaults type, and updated bash-tools.exec.ts to fall back to the config default when the per-call parameter is not set.
  • What did NOT change: Per-call pty parameter still takes precedence. No changes to PTY implementation itself. Sandbox mode still forces pipes.

Change Type

  • New feature (non-breaking)

Scope

  • Tools/Exec

Linked Issue/PR

  • Closes #44603

Security Impact

  • New permissions/capabilities? No (PTY mode already existed as per-call option)
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No (same PTY capability, just configurable default)
  • Data access scope changed? No

Repro + Verification

Steps

  1. Add `"tools": { "exec": { "pty": true } }` to openclaw.json
  2. Run a long-running command that produces streaming output
  3. Observe real-time output instead of buffered output

Compatibility / Migration

  • Backward compatible? Yes (new optional config, default behavior unchanged)
  • Config/env changes? New optional config: tools.exec.pty
  • Migration needed? No

Risks and Mitigations

Low risk — PTY mode already exists and works. This only adds a config default. Per-call parameter still overrides. Sandbox correctly ignores PTY regardless.

Changed files

  • src/agents/bash-tools.exec-types.ts (modified, +1/-0)
  • src/agents/bash-tools.exec.ts (modified, +3/-2)
  • src/agents/pi-tools.ts (modified, +2/-0)
  • src/config/types.tools.ts (modified, +2/-0)
  • src/config/zod-schema.agent-runtime.ts (modified, +1/-0)

Code Example

const usePty = params.pty === true && !sandbox;

---

const usePty = (params.pty ?? defaults?.pty) === true && !sandbox;
RAW_BUFFERClick to expand / collapse

Summary

{ "tools": { "exec": { "timeoutSec": 900, "pty": true // 全局默认启用 pty } } }

See the intermediate results of loss output, i cannot use pty

Problem to solve

I have to wait for a long time to see the results, and users are unaware of what's happening during this process.

Proposed solution

Longer skills will return intermediate results in a streaming manner during execution, but currently, they seem to output the final results all at once after execution, without intermediate results

Alternatives considered

No other option

Impact

Issue: Add pty as a global configuration option in tools.exec



Affected Users/Systems/Channels



  • All OpenClaw users who run long-running CLI tools that produce streaming output (e.g., AI agents, data processing scripts, build tools)
  • Skill developers who create skills invoking Python/Node scripts with real-time progress updates
  • Enterprise users deploying OpenClaw for automated workflows requiring user feedback during execution 

Severity

 Workflow Blocker — Without global pty configuration, users cannot see real-time output from exec commands. All stdout is buffered and displayed only after the command completes. For long-running tasks (5-15 minutes), users see no feedback and may assume the system is frozen or broken. 

Frequency

 Always — This affects every exec command that produces streaming output when pty: true is not explicitly passed by the LLM. Since pty is only available as a per-call parameter (not a global default), users must rely on the LLM to include pty: true in every exec call, which is unreliable. 

Consequences



  1. Poor User Experience: Users wait 5-15 minutes with no visible progress, leading to confusion and frustration
  2. Perceived System Failure: Users may cancel or restart tasks thinking the system is unresponsive
  3. Unreliable Workarounds: Adding pty: true instructions in SKILL.md does not guarantee LLM compliance
  4. No Python-side Fix: Even with PYTHONUNBUFFERED=1, flush=True, and stdbuf -oL, output remains buffered because OpenClaw's exec uses pipe mode (full buffering) instead of PTY mode (line buffering) 

Technical Root Cause

 In src/agents/bash-tools.exec.ts line 466:

const usePty = params.pty === true && !sandbox;

 Unlike timeoutSec which has a defaults fallback, pty has no global default. The fix would be:

const usePty = (params.pty ?? defaults?.pty) === true && !sandbox;

 And adding pty: z.boolean().optional() to ToolExecBaseShape in the config schema. 

Requested Solution

 Allow tools.exec.pty: true in openclaw.json to enable PTY mode by default for all exec commands.

Evidence/examples

No response

Additional information

No response

extent analysis

Fix Plan

To enable PTY mode by default for all exec commands, follow these steps:

  • Update the ToolExecBaseShape in the config schema to include pty: z.boolean().optional().
  • Modify the usePty variable assignment in src/agents/bash-tools.exec.ts to:
const usePty = (params.pty ?? defaults?.pty) === true && !sandbox;
  • Add pty: true to the tools.exec configuration in openclaw.json.

Example openclaw.json configuration:

{
  "tools": {
    "exec": {
      "timeoutSec": 900,
      "pty": true
    }
  }
}

Verification

To verify that the fix worked:

  1. Run a long-running CLI tool that produces streaming output.
  2. Check if the output is displayed in real-time, without buffering.
  3. Verify that the pty mode is enabled by default for all exec commands.

Extra Tips

  • Make sure to update the openclaw.json configuration file correctly to enable PTY mode by default.
  • If issues persist, check the src/agents/bash-tools.exec.ts file to ensure the usePty variable is assigned correctly.
  • Consider adding logging or debugging statements to verify that the pty mode is enabled and working as expected.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Feature]: pty setting [1 pull requests, 1 participants]