Skip to content

exec/read tools silently return empty output on Windows (v2026.6.x regression) #105528

Closed as not planned

Description

@matts524

Summary

In the main assistant session, both exec and read tools frequently return empty output. Simple commands like echo hello world and whoami return nothing. Reading existing files (e.g. SOUL.md, BUG-REPORT.md) returns empty. The bug is intermittent and session-specific: sub-agents spawned from the same host work correctly, and host="gateway" sometimes briefly restores output.

GITHUB-ISSUE-DRAFT.md

Affected docs path(s) or URL(s)

n/a

Steps to reproduce / verify

  1. Start OpenClaw on Windows 11 with 2026.6.10/11.
  2. In the main session, run exec with echo hello world.
  3. Observe empty output.
  4. Run read on any existing file (e.g. SOUL.md).
  5. Observe empty output.
  6. Try host="gateway" — output may return briefly, then fail again.
  7. Spawn a sub-agent via sessions_spawn and run the same command — output works correctly.

Expected docs behavior/content

  • exec echo hello world should return hello world.
  • read SOUL.md should return the file contents.

Actual docs behavior/content

  • Both return empty strings.
  • No error message is shown.
  • The failure is silent.

Impact

  • host="gateway" temporarily restores output then fails again.
  • memory_search and other non-exec/read tools continue working.

Evidence

  • Sub-agents work fine.
  • host="gateway" temporarily restores output then fails again.
  • memory_search and other non-exec/read tools continue working.

Additional information

The current dist already disables detached spawn in most individual call sites (supervisor, bash runtime, MCP, LSP, proxy, client), but those

Activity

  1. added
    bugSomething isn't working
    docsImprovements or additions to documentation
    on Jul 12, 2026
  2. Artyomkun commented on Jul 16, 2026

    @Artyomkun

    @clawsweeper
    You skipped the description. Don't slack off. Get those claws on the keyboard—let's sort through those shells.

  3. 47 remaining items

  4. tomatotomata commented on Sep 17, 2026

    @tomatotomata

    That sounds like a useful next step. I have not started a code change, so I will leave the current-main audit and Windows repro with you rather than duplicate it. I was going to trace the tool-result hand-off against the pruning extension too, so a captured failing turn should help narrow down which boundary is dropping the text.

  5. wusanjay commented on Sep 17, 2026

    @wusanjay
    Contributor

    Reproduction attempt on current main (2026.9.4, Windows 11, embedded runner, zai/glm-5.2)

    Following the review's request for evidence on current main, I ran a reproduction attempt in an isolated OPENCLAW_HOME from a source checkout at 2026.9.4:

    # Scenario Result
    1 Fresh main session, exec echo hello world + read of an existing file ✅ both outputs delivered verbatim
    2 Same session, idle 330s (past the 5-min cache TTL), exec echo second-test ✅ output delivered verbatim
    3 Session filled to >30% of context via a ~213KB read (cache-ttl pruning enabled via agents.defaults.contextPruning.mode = "cache-ttl"), idle 330s, then exec echo pruning-test-001 ✅ output delivered verbatim; pruning verifiably engaged — the model confirmed the earlier 213KB tool result had been replaced/pruned from its context

    Scenario 3 is the important one: it confirms the pruning branch actually ran (context >30% threshold + TTL expiry + model reported the tool result content gone), and the new exec output still came through intact.

    Code-audit notes on the remaining suspect

    Reading the current path supports the earlier analysis:

    • pruneExpiredCacheTtlToolResults (src/agents/embedded-agent-runner/tool-result-truncation.ts) replaces eligible tool results with a placeholder text block (soft mode keeps first/last 1500 chars with a marker; hard mode writes settings.placeholder). It does not produce zero-content tool results, consistent with scenario 3.
    • applyToolResultMiddleware (src/agents/harness/tool-result-middleware.ts) has a fast path returning the result unchanged when no middleware is registered — matching the "sub-agents unaffected" symptom. A middleware returning a valid-but-empty content array passes coerceMiddlewareToolResult and is delivered as-is (next.content ?? current.content does not intercept []), which remains the only path I can find that yields a silent blank.
    • embedded-agent-runner/extensions.ts still defaults non-array event.content to [] without error.

    Next step I plan: register a minimal tool-result middleware that returns { content: [] } to confirm whether that produces the reported silent-blank rendering, which would pin the sink (if not the original trigger).

  6. wusanjay commented on Sep 17, 2026

    @wusanjay
    Contributor

    Final repro result: middleware returning empty content does NOT blank output on current main

    Follow-up to my earlier comment: I completed the middleware experiment planned there.

    Setup: minimal local plugin registering an AgentToolResultMiddleware that intercepts exec and returns { content: [] } (side-effect file write confirms every invocation). Loaded via a Gateway start (plugin install from local path, capabilities accepted); turn run through the Gateway with zai/glm-5.2.

    Result: the middleware verifiably executed for exec (invocation log), yet the model received the full raw output (mw-check-777) verbatim — no blank, no "post-processing error", no "(no output)" marker.

    Combined experiment matrix on 2026.9.4 (Windows 11, source checkout, embedded + gateway runs):

    # Scenario Output
    1 Fresh session exec/read ✅ intact
    2 Same session, idle 330s past cache TTL, exec ✅ intact
    3 Context filled >30% (213KB read), cache-ttl pruning engaged (verified — model confirmed prior tool result was pruned), idle 330s, exec ✅ intact
    4 Tool-result middleware returning { content: [] } for exec (execution verified) ✅ intact

    Conclusion: none of the four candidate paths reproduce the reported silent-blank behavior on current main. Together with the earlier code audit (pruning writes placeholders, not blanks), this suggests the regression reported against 2026.6.10/11 no longer reproduces on 2026.9.x — possibly fixed by changes between 2026.6 and 2026.9 (e.g. the middleware validation/fallback rework in applyToolResultMiddleware).

    Suggestion: it would help if the original reporter (or anyone still seeing this) can retest on 2026.9.x and attach a failing turn. If nobody can reproduce on current main, this may be closable as fixed-in-current. Happy to keep digging if new evidence points at a path I have not covered (e.g. a specific provider transport or the Codex runtime middleware variants).

  7. added
    P2Normal backlog priority with limited blast radius.
    clawsweeper:intake:bugPreliminary submission classification; full source review pending.
    and removed
    P1High-priority user-facing bug, regression, or broken workflow.
    clawsweeper:intake:bugPreliminary submission classification; full source review pending.
    on Oct 11, 2026
  8. openclaw-barnacle commented on Oct 23, 2026

    @openclaw-barnacle

    This bug report has had no qualifying human activity for 30 days. Please retest on the current release and share the result.
    Without new human activity, Barnacle may close it as not planned 14 days after this message was posted. This is administrative inactivity cleanup, not a claim that the problem is fixed.
    A human update restarts the inactivity clock; a new PR head also restarts it. A maintainer can add no-stale for a durable hold, or bad-barnacle to suppress Barnacle. Remove the hold when work can resume.

  9. added
    clawsweeper:intake:bugPreliminary submission classification; full source review pending.
    and removed
    clawsweeper:intake:bugPreliminary submission classification; full source review pending.
    on Oct 23, 2026
  10. steipete commented on Oct 24, 2026

    @steipete
    Contributor

    Thanks for filing this. We're closing older issues that no longer look actionable on current main.

    A follow-up investigation could not reproduce empty exec/read output on current main, and the original report targets the 2026.6.x line. If this still happens on a recent release, please open a fresh issue with the version, OS, and a minimal repro.

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

    P2Normal backlog priority with limited blast radius.bugSomething isn't workingdocsImprovements or additions to documentationimpact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.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