Skip to content

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

@lvmax1998

Description

@lvmax1998

Prerequisites

  • I have searched existing issues to avoid duplicates
  • I am using the latest version of oh-my-opencode
  • I have read the documentation

Bug 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.

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.

Expected Behavior

Running git status no longer reports an error.

Image

Actual Behavior

Error: 'export' is not recognized as an internal or external command,
operable program or batch file.

Image

Doctor Output

Installation
────────────────────────────────────────
  ✗ OpenCode Installation → OpenCode is not installed
  ✓ Plugin Registration → Registered (pinned: latest)

Configuration
────────────────────────────────────────
  ✓ Configuration Validity → Valid JSON config

Authentication
────────────────────────────────────────
  ✓ Anthropic (Claude) Auth → Auth plugin available
  ○ OpenAI (ChatGPT) Auth → Auth plugin not installed
  ✓ Google (Gemini) Auth → Auth plugin available

Dependencies
────────────────────────────────────────
  ⚠ AST-Grep CLI → Not installed (optional)
  ⚠ AST-Grep NAPI → Not installed (optional)
  ⚠ Comment Checker → Not installed (optional)

Tools & Servers
────────────────────────────────────────
  ⚠ GitHub CLI → Not installed (optional)
  ⚠ LSP Servers → No LSP servers detected
  ✓ Built-in MCP Servers → 2 built-in servers enabled
  ○ User MCP Configuration → No user MCP configuration found

Updates
────────────────────────────────────────
  ✓ Version Status → Up to date (2.14.0)

Summary
────────────────────────────────────────

  6 passed, 1 failed, 5 warnings, 2 skipped
  Total: 14 checks in 630ms

Error Logs

Configuration

Additional Context

No response

Operating System

Windows

OpenCode Version

1.1.29

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions