[PR #12194] fix(opencode): use args.cwd in acp command handler #14113

Open
opened 2026-02-16 18:18:55 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12194

State: open
Merged: No


What does this PR do?

Fixes #12193

The --cwd flag is currently being ignored in the opencode acp command, even though it is defined as one of the command's flags. The handler ignores it and uses process.cwd() instead, silently ignoring the flag and starting opencode acp in the working directory.

The fix consists on resolving the relative path, verifying that it exists, and passing it to the bootstrap.

I followed the pattern in the TUI thread and relative paths against PWD to preserve behavior when using --cwd flag with relative paths.

How did you verify your code works?

I tested by running the acpcommand with the --print-logs and --cwd flags and verified in the logs that the server correctly started in the path passed as a parameter

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12194 **State:** open **Merged:** No --- ### What does this PR do? Fixes #12193 The `--cwd` flag is currently being ignored in the `opencode acp` command, even though it is defined as one of the command's flags. The handler ignores it and uses `process.cwd()` instead, silently ignoring the flag and starting `opencode acp` in the working directory. The fix consists on resolving the relative path, verifying that it exists, and passing it to the bootstrap. I followed the pattern in the TUI thread and relative paths against PWD to preserve behavior when using --cwd flag with relative paths. ### How did you verify your code works? I tested by running the `acp`command with the `--print-logs` and `--cwd` flags and verified in the logs that the server correctly started in the path passed as a parameter
yindo added the pull-request label 2026-02-16 18:18:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14113