Skip to content

Two server instances created when project path contains symlink, causing TUI to freeze on prompt #15482

@snowstorm0182

Description

@snowstorm0182

Description

When the working directory is a symlink to another path, opencode spawns two state instances. Subsequent prompts appear to not be processed in the TUI (no message API calls logged), but are likely being handled by the shadow instance invisibly.

When i move to the folder directly without the symlink. And do the same: run opencode ., /session and select the session i was working on and try "test" prompt => works fine.

Ai helped me with doing the analysis and the title so take the title and hypotheses with enough grain of salt.

Plugins

none that i know

OpenCode version

1.2.15

Steps to reproduce

Open opencode in a directory that is a symlink (e.g. ~/ssd → /media/.../ssd_storage), switch to an old session via /session, send a prompt — UI freezes.

$ ls -la ~/ssd
lrwxrwxrwx 1 myname myname 23 helmi  16 11:56 /home/myname/ssd -> /media/myname/ssd_storage

Screenshot and/or share link

INFO 2026-02-28T18:33:12 +0ms service=server method=GET path=/path request
INFO 2026-02-28T18:33:12 +0ms service=server status=started method=GET path=/path request
INFO 2026-02-28T18:33:12 +0ms service=server status=completed duration=0 method=GET path=/path request
INFO 2026-02-28T18:33:12 +5ms service=server status=completed duration=9 method=GET path=/formatter request
INFO 2026-02-28T18:33:15 +3324ms service=server method=GET path=/session/ses_362512ee7ffeu3OQz9LYI4nxG5 request
INFO 2026-02-28T18:33:15 +0ms service=server status=started method=GET path=/session/ses_362512ee7ffeu3OQz9LYI4nxG5 request
INFO 2026-02-28T18:33:15 +1ms service=server url=http://opencode.internal/session/ses_362512ee7ffeu3OQz9LYI4nxG5 SEARCH
INFO 2026-02-28T18:33:15 +1ms service=server status=completed duration=2 method=GET path=/session/ses_362512ee7ffeu3OQz9LYI4nxG5 request
INFO 2026-02-28T18:33:15 +0ms service=server method=GET path=/session/ses_362512ee7ffeu3OQz9LYI4nxG5/message request
INFO 2026-02-28T18:33:15 +0ms service=server status=started method=GET path=/session/ses_362512ee7ffeu3OQz9LYI4nxG5/message request
INFO 2026-02-28T18:33:15 +37ms service=server status=completed duration=37 method=GET path=/session/ses_362512ee7ffeu3OQz9LYI4nxG5/message request
INFO 2026-02-28T18:33:15 +14ms service=server method=GET path=/session/ses_362512ee7ffeu3OQz9LYI4nxG5/todo request
INFO 2026-02-28T18:33:15 +0ms service=server status=started method=GET path=/session/ses_362512ee7ffeu3OQz9LYI4nxG5/todo request
INFO 2026-02-28T18:33:15 +1ms service=server status=completed duration=1 method=GET path=/session/ses_362512ee7ffeu3OQz9LYI4nxG5/todo request
INFO 2026-02-28T18:33:15 +0ms service=server method=GET path=/session/ses_362512ee7ffeu3OQz9LYI4nxG5/diff request
INFO 2026-02-28T18:33:15 +0ms service=server status=started method=GET path=/session/ses_362512ee7ffeu3OQz9LYI4nxG5/diff request
INFO 2026-02-28T18:33:15 +1ms service=server status=completed duration=1 method=GET path=/session/ses_362512ee7ffeu3OQz9LYI4nxG5/diff request
INFO 2026-02-28T18:39:26 +371112ms service=default worker shutting down
INFO 2026-02-28T18:39:26 +4ms service=default disposing all instances
INFO 2026-02-28T18:39:26 +1ms service=bus type=* unsubscribing
INFO 2026-02-28T18:39:26 +0ms service=server event disconnected
INFO 2026-02-28T18:39:26 +1ms service=default directory=/media/myname/ssd_storage/project_collection_foo/app_bar disposing instance
INFO 2026-02-28T18:39:26 +0ms service=state key=/media/myname/ssd_storage/project_collection_foo/app_bar waiting for state disposal to complete
INFO 2026-02-28T18:39:26 +2ms service=state key=/media/myname/ssd_storage/project_collection_foo/app_bar state disposal completed
INFO 2026-02-28T18:39:26 +0ms service=default directory=/home/myname/ssd/project_collection_foo/app_bar disposing instance
INFO 2026-02-28T18:39:26 +0ms service=state key=/home/myname/ssd/project_collection_foo/app_bar waiting for state disposal to complete
INFO 2026-02-28T18:39:26 +1ms service=state key=/home/myname/ssd/project_collection_foo/app_bar state disposal completed

Operating System

Ubuntu 22.04

Terminal

Gnome terminal

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions