[Agent Mode] OpenCode 2.x fails to start because Copilot passes removed --cwd flag

Author: Error-404v2Created Sep 21, 2026Updated Sep 21, 2026

Copilot report ID: a7845849258365c44095f8039666fb44

What went wrong

Obsidian Copilot 4.0.9 cannot initialize Agent Mode when using OpenCode 2.0.11 as a custom binary.

Copilot launches OpenCode using: opencode acp --cwd However, OpenCode 2.0.11 no longer supports the --cwd flag. It returns: ERROR: Unrecognized flag: --cwd in command opencode acp

The resulting help/error output is then interpreted by Copilot as ACP JSON, producing errors such as: Failed to parse JSON message: DESCRIPTION

Steps to reproduce

Install OpenCode 2.0.11. In Copilot 4.0.9, configure OpenCode → My own binary and select the OpenCode 2.0.11 executable. Start an Agent Chat. Agent initialization fails.

The same invocation can be reproduced directly: opencode acp --cwd "I:\My Drive\obsidian\my notes" Result: ERROR: Unrecognized flag: --cwd in command opencode acp Running opencode acp without --cwd starts the ACP process normally.

Expected behavior

Copilot should launch current OpenCode versions using their supported working-directory mechanism rather than passing the removed --cwd argument. Ideally, Copilot could handle the invocation based on the detected OpenCode version so both the managed/pinned version and newer custom binaries remain compatible.

Environment

Copilot: 4.0.9 OpenCode: 2.0.11 Backend: OpenCode / custom binary OS: Windows 10/11 x64 Vau

…report truncated. The full report is report.md inside the report zip.

Source: logancyang/obsidian-copilot