Skip to content

[Bug]: Shell command failure on win32 platform due to Unix-style export causing excessive retries #9797

Closed as not planned

Description

@lvmax1998

Description

The automated agent environment consistently prepends a Unix-style environment variable export string (export CI=true ...;) to all bash tool commands. On Windows systems, export is not a recognized command.

Critically, when this failure occurs, the agent logic appears to repeatedly retry the command multiple times in a tight loop. This results in a cascade of "not recognized" errors and prevents the task from failing gracefully or proceeding.

Plugins

oh-my-opencode

OpenCode version

1.1.25

Steps to reproduce

  1. Type anything that triggers a bash command execution (e.g., git status)
  2. Observe the command being prefixed with export ...;
  3. The command fails immediately because export is not a valid Windows command.
  4. The system automatically retries the same malformed command multiple times (observed 4+ consecutive attempts in one session), cluttering the logs and stalling execution.

Screenshot and/or share link

Image

Operating System

Windows11

Terminal

Windows Terminal

Activity

  1. github-actions commented on Jan 21, 2026

    @github-actions
    Contributor

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

    The root cause appears to be related to how bash commands are executed on Windows. The excessive retries you're experiencing might be tied to the transient spawn failures mentioned in #6488, or the shell configuration issue in #8160.

    Feel free to ignore if none of these address your specific case.

  2. lvmax1998 commented on Jan 22, 2026

    @lvmax1998
    Author

    The same error occurred in version v1.1.29.

    Image
  3. pschiel commented on Jan 22, 2026

    @pschiel
    Contributor

    This is no opencode issue. There is nothing in opencode that would produce these bash exports.

    Your plugin does that.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwindows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions