Skip to content

New PowerShell tool confuses agents #20527

Closed as not planned
Closed as not planned

Description

@ShibuyaCyana

Description

After PR #16069, on Windows, my agent is still proactively using tail to filter the compile result, even with newly created sessions.

Image Image

It seems that the agent is at least somewhat aware of it's using PowerShell, not Bash, but still frequently forgets about it.

My hypotheses are:

  1. The tool is still called bash, the prompt is also saying "Executes a given bash command..." (in bash.txt);
  2. It sees command lines starting with $;
  3. It sees previous tail usage when continuing from a previous session.

Adding an environment variable mentioned here works, but it's undocumented.
Please optimize the prompts for PowerShell, or just revert to use git bash by default.

Plugins

Superpowers

OpenCode version

Desktop: 1.3.13

Steps to reproduce

As above.

Screenshot and/or share link

As above.

Operating System

Win11 24H2

Terminal

No response

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 1, 2026
  2. github-actions commented on Apr 1, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is distinct from these (specifically about the bash tool description/prompt misleading the agent into using bash commands like tail on PowerShell), feel free to clarify and a maintainer will confirm.

  3. ShibuyaCyana commented on Apr 1, 2026

    @ShibuyaCyana
    Author

    If your issue is distinct from these (specifically about the bash tool description/prompt misleading the agent into using bash commands like tail on PowerShell), feel free to clarify and a maintainer will confirm.

    I think this issue is distinct enough. It's about the prompt, not the shell itself.

  4. Hona commented on Apr 2, 2026

    @Hona
    Member

    Yeah - I am refactoring this to make agents better here

  5. soltrac commented on Apr 7, 2026

    @soltrac

    I'm having this problem, always try a tail and after that, it won't try again. If opencode knows it is on windows it should no try to tail

  6. CCRcmcpe commented on Apr 22, 2026

    @CCRcmcpe

    As this issue is not fixed, here's a personal anecdote on a temporary fix.
    From https://github.com/anomalyco/opencode/blob/v1.14.20/packages/opencode/src/shell/shell.ts, you can see how the shell is selected. You can set SHELL environment variable to other values, like bash, if you have it in your PATH, either from WSL or something else. Personally I don't use WSL, so I set it to use MSYS2's bash.

  7. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  8. kouhe3 commented on Jun 1, 2026

    @kouhe3

    can we support multi shell in opencode.
    bash -> bash
    pwsh -> pwsh
    powershell -> powershell

  9. github-actions commented on Aug 1, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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