Skip to content

fix(v2): preserve tools when observer autostart fails - #87

Closed
SamueleSandrini wants to merge 1 commit into
shekohex:mainfrom
SamueleSandrini:fix/v2-shared-pty-server
Closed

SamueleSandrini wants to merge 1 commit into
shekohex:mainfrom
SamueleSandrini:fix/v2-shared-pty-server

Conversation

@SamueleSandrini

@SamueleSandrini SamueleSandrini commented Nov 3, 2026 •

Copy link
Copy Markdown

OpenCode V2 initializes plugins for multiple isolated locations. With a fixed observer port and autostart: true, the first opencode-pty instance binds the port, while later location instances fail plugin setup with EADDRINUSE. Because setup fails after tool registration, those locations lose all PTY tools.

Treat the web observer as optional during autostart: report the bind failure while allowing plugin setup and location-specific PTY tool registration to complete. Explicit observer commands still surface startup failures normally.

The regression test occupies a real TCP port, runs plugin setup with autostart on that port, and verifies that all five PTY tools remain registered.

Validation:

  • bun test test/v2.test.ts (9 passed)
  • tsc --noEmit
  • tsc -p tsconfig.build.json

@SamueleSandrini SamueleSandrini changed the title fix(v2): share PTY server across plugin contexts fix(v2): preserve tools when observer autostart fails Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant