Skip to content

Windows PowerShell pipeline can lose raw running tool input #34960

Description

@GrilledFoch

Description

On Windows PowerShell, a shell-tool command with a pipeline ending in | Out-Null followed by another command can lose the original raw tool input while the legacy v1 tool part is still pending/running.

Observed originally on OpenCode v1.14.28. In my local wrapper/log observer (Mavis, not an OpenCode component), this appeared as a state mismatch: terminal status=completed while lastStatus=running, followed by session.finish reason=stale after about 30 minutes idle.

Expected: the running tool state keeps the raw command input until the tool finishes.

Actual: on current dev at f52424e05f, a focused regression test showed the running tool state had raw === undefined while the PowerShell pipeline was still running.

Plugins

None relevant. Mavis is an external wrapper/log observer, not an OpenCode plugin.

OpenCode version

Observed on v1.14.28. Reproduced against current dev at f52424e05f with a focused regression test.

Steps to reproduce

  1. Use Windows with the shell resolving to Windows PowerShell (powershell.exe).
  2. Run a shell-tool command shaped like:
New-Item -ItemType Directory -Path $env:TEMP\opencode-pipeline-repro -Force | Out-Null
Get-ChildItem $env:TEMP\opencode-pipeline-repro
  1. While the command is still running, inspect the legacy v1 running tool part state.
  2. The running state should retain the raw command input, but current dev drops it.

Screenshot and/or share link

N/A. A focused regression and fix are in draft PR #34959.

Operating System

Windows 11 / Windows PowerShell 5.1 (5.1.26100.8737 on my machine).

Terminal

Windows PowerShell via powershell.exe.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions