opencode icon indicating copy to clipboard operation
opencode copied to clipboard

opencode run fails with 'Session not found' (1.1.16)

Open jayhen opened this issue 23 hours ago • 3 comments

Description

The opencode run command fails immediately with "Session not found" error. This affects all variations of the command.

Environment

  • opencode version: 1.1.16
  • macOS (Apple Silicon)
  • Installed via Homebrew

Reproduction Steps

# Basic usage
opencode run "Hello"
# Output: Error: Session not found

# With model
opencode run "Hello" -m anthropic/claude-haiku-4-5-20251001
# Output: Error: Session not found

# With agent
opencode run "Hello" --agent build-haiku
# Output: Error: Session not found

# From clean directory
cd /tmp && opencode run "Hello"
# Output: Error: Session not found

# With explicit port
opencode run "Hello" --port 14567
# Output: Error: Session not found

Debug Logs

Running with --print-logs shows:

INFO  ... service=file.watcher platform=darwin backend=fs-events watcher backend
ERROR ... service=server error= failed
Error: Session not found

Note the empty error message in service=server error= failed.

Expected Behavior

The command should start a new session and process the message.

Impact

This prevents:

  • Non-interactive/scripted use of opencode
  • CI/CD integrations
  • Programmatic invocation of specific agents

jayhen avatar Jan 14 '26 16:01 jayhen