Skip to content

Specify an agent when attaching to server fails #6489

@mschenk42

Description

@mschenk42

Description

This worked reliably until recently. I believe it might be related to this PR #5843.

The primary agent explore is only available in the server being connected to.

opencode run --print-logs --attach "http://ssds-meta-store-api:4096" --model "mercury-sa/Claude-4.5-Opus" --agent "explore"  "lightning"
INFO  2025-12-30T23:37:29 +381ms service=default version=1.0.217 args=["run","--print-logs","--attach","http://ssds-meta-store-api:4096","--model","mercury-sa/Claude-4.5-Opus","--agent","explore","lightning"] opencode
ERROR 2025-12-30T23:37:29 +385ms service=default name=instance message=No context found for instance stack=instance: No context found for instance
    at use (src/util/context.ts:16:21)
    at directory (src/project/instance.ts:41:20)
    at <anonymous> (src/project/instance.ts:50:31)
    at <anonymous> (src/project/state.ts:14:19)
    at get (src/agent/agent.ts:281:12)
    at get (src/agent/agent.ts:280:29)
    at <anonymous> (src/cli/cmd/run.ts:230:35)
    at <anonymous> (src/cli/cmd/run.ts:228:48)
    at <anonymous> (src/cli/cmd/run.ts:247:21)
    at async <anonymous> (src/cli/cmd/run.ts:311:20)
    at processTicksAndRejections (native:7:39) fatal
Error: Unexpected error, check log file at  for more details

instance: No context found for instance
      at use (src/util/context.ts:16:21)
      at directory (src/project/instance.ts:41:20)
      at src/project/instance.ts:50:31
      at src/project/state.ts:14:19
      at get (src/agent/agent.ts:281:12)
      at get (src/agent/agent.ts:280:29)
      at src/cli/cmd/run.ts:230:35
      at src/cli/cmd/run.ts:228:48
      at src/cli/cmd/run.ts:247:21
      at src/cli/cmd/run.ts:311:20
      at processTicksAndRejections (native:7:39)

OpenCode version

1.0.217

Steps to reproduce

opencode run --print-logs --attach "http://ssds-meta-store-api:4096" --model "mercury-sa/Claude-4.5-Opus" --agent "explore"  "lightning"

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions