Unable to use --agent option when using run with --attach #5080

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

Originally created by @mschenk42 on GitHub (Jan 12, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

When using run with --attach and --agent option you get an exception

instance: No context found for instance
      at use (src/util/context.ts:16:21)
      at directory (src/project/instance.ts:42:20)
      at src/project/instance.ts:63:31
      at src/project/state.ts:14:19
      at get (src/agent/agent.ts:231:12)
      at get (src/agent/agent.ts:230:29)
      at src/cli/cmd/run.ts:234:35
      at src/cli/cmd/run.ts:232:48
      at src/cli/cmd/run.ts:251:21
      at src/cli/cmd/run.ts:338:20
      at processTicksAndRejections (unknown:7:39)

Plugins

none

OpenCode version

1.1.15

Steps to reproduce

opencode run --attach http://127.0.0.1:4096 --agent plan "test"

Screenshot and/or share link

Image

Operating System

macOS 26.2

Terminal

Ghostty

Originally created by @mschenk42 on GitHub (Jan 12, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description When using run with --attach and --agent option you get an exception ``` instance: No context found for instance at use (src/util/context.ts:16:21) at directory (src/project/instance.ts:42:20) at src/project/instance.ts:63:31 at src/project/state.ts:14:19 at get (src/agent/agent.ts:231:12) at get (src/agent/agent.ts:230:29) at src/cli/cmd/run.ts:234:35 at src/cli/cmd/run.ts:232:48 at src/cli/cmd/run.ts:251:21 at src/cli/cmd/run.ts:338:20 at processTicksAndRejections (unknown:7:39) ``` ### Plugins none ### OpenCode version 1.1.15 ### Steps to reproduce opencode run --attach http://127.0.0.1:4096 --agent plan "test" ### Screenshot and/or share link <img width="1114" height="670" alt="Image" src="https://github.com/user-attachments/assets/ceba8453-5853-475c-94a4-6c519b4a27bb" /> ### Operating System macOS 26.2 ### Terminal Ghostty
yindo added the bug label 2026-02-16 17:48:28 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#5080