Skip to content

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

@mschenk42

Description

@mschenk42

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions