opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Unable to use `--agent` option when using `run` with `--attach`

Open mschenk42 opened this issue 2 days ago • 1 comments

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

mschenk42 avatar Jan 12 '26 23:01 mschenk42