Repository navigation
Description
Description
opencode run --agent plan hangs indefinitely. It never creates a session and never sends a request to the model, so it has to be killed.
This looks like a regression of #3828 ("Plan Agent gets stuck in run mode", closed as fixed in 0.15.31), but the failure is earlier and broader than the original report. #3828 needed a prompt that triggered a bash ask permission. This reproduces with a prompt that uses no tools at all, and it hangs before a session exists, so no permission could have been requested yet.
OpenCode version
1.18.18
Steps to reproduce
opencode run --agent plan -m <provider>/<model> "di solo OK"
# hangs forever, no outputReproduced with a minimal config (provider + model only, no custom agents, no MCP servers, no instructions, no permission overrides), so it is not caused by user customisation.
What the logs show
With --print-logs --log-level DEBUG, it reaches init and stops there:
level=INFO message=bootstrapping directory=/home/macuartin/www/knowledge-base
level=INFO message="all LSPs are disabled"
level=INFO message="all formatters are disabled"
level=INFO message=init
level=INFO message=cleanup prune=7.days <- 60s later, this is my timeout killing it
A working run with the same config and the default agent gets past init immediately:
level=INFO message=init
level=INFO message=created id=ses_... agent=undefined model=undefined
permission="[{\"permission\":\"question\",...,\"action\":\"deny\"},
{\"permission\":\"plan_enter\",...,\"action\":\"deny\"},
{\"permission\":\"plan_exit\",...,\"action\":\"deny\"}]"
level=INFO message="event connected"
level=INFO message=loop session.id=ses_... step=0
So with --agent plan no created line is ever emitted. Note the plan_enter / plan_exit permissions present in the working session; I suspect the plan agent is waiting on one of those in a context where nothing can answer, but I have not read the source to confirm.
What I ruled out
| Hypothesis | Result |
|---|---|
ask permissions blocking on a non-interactive prompt |
No. --auto does not help |
User config (custom agents, MCPs, question: deny) |
No. Reproduces with a minimal config |
| Restricted/read-only agents in general | No. --agent explore (read-only) works fine |
| Server or model wedged | No. The default agent works immediately before and after, and the model endpoint answers directly |
Environment
- Provider: OpenAI-compatible local endpoint (llama.cpp router)
- Model: a local 30B; token counters on the server confirm zero prompt tokens ever arrive, so this is client-side
- OS: Linux
I could not test against a hosted provider, so I cannot rule out that this is specific to a custom OpenAI-compatible provider.
Activity
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊