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

Open
opened 2026-02-16 17:57:37 -05:00 by yindo · 0 comments
Owner

Originally created by @jayhen on GitHub (Jan 14, 2026).

Originally assigned to: @rekram1-node on GitHub.

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
Originally created by @jayhen on GitHub (Jan 14, 2026). Originally assigned to: @rekram1-node on GitHub. ## 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 ```bash # 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
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#5858