GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||
GeezerVison is showing github.com — refactor(server): replace Bun serve with Hono node adapters by thdxr · Pull Request #18335 · anomalyco/opencode Conversation
|
| Filename | Overview |
|---|---|
| packages/opencode/src/server/server.ts | Core server refactored from Bun.serve to @hono/node-server; PTY routes are commented out (regression), port-0 fallback logic is non-standard, and multi-word variable names violate the style guide. |
| packages/opencode/src/control-plane/workspace-server/server.ts | Migrated to @hono/node-server, but Listen() returns before the server is ready and silently swallows bind errors — unlike the main Server.listen() which properly awaits the "listening" event. |
| packages/opencode/src/cli/cmd/serve.ts | Uses the new Server.listen() API correctly, but server.stop() after await new Promise(() => {}) is dead code that can never be reached. |
| packages/opencode/src/cli/cmd/web.ts | Same dead-code stop() pattern as serve.ts; otherwise cleanly uses the new Listener API. |
| packages/opencode/src/server/routes/pty.ts | Updated to accept upgradeWebSocket from @hono/node-ws and correctly adapts the raw WebSocket to the Pty.Socket interface; the file itself is correct but is never mounted because the route registration in server.ts is commented out. |
| packages/opencode/src/pty/index.ts | No functional changes; subscriber keying logic remains unchanged and works correctly for the Bun-style socket objects it currently handles. |
| packages/opencode/src/cli/cmd/acp.ts | Minor update to use the new Server.listen() return type; logic is unchanged and correct. |
| packages/opencode/package.json | Adds @hono/node-server and @hono/node-ws as runtime dependencies at pinned versions; bun.lock updated accordingly. |
packages/opencode/src/cli/cmd/serve.ts, line 21-22 (link)
server.stop() is unreachable dead code
await new Promise(() => {}) creates a promise that never settles, so await server.stop() on the next line can never be reached. The same pattern exists in web.ts at lines 78–79. In practice this means the graceful shutdown path is never exercised — if the process exits (SIGINT, SIGTERM, etc.) the server is killed without going through stop(). Consider removing the dead call or wiring up signal handling:
await new Promise<void>((resolve) => { process.once("SIGINT", resolve) process.once("SIGTERM", resolve) }) await server.stop(true)
The same fix is needed in web.ts.
Last reviewed commit: "chore: extract misc ..."
Greptile also left 4 inline comments on this PR.
Context used:
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Formatters now determine their executable location when enabled rather than using hardcoded paths. This ensures formatters work correctly regardless of how the tool was installed or where executables are located on the system.
…r in CI by disabling Bun cache when network interception is detected
…xecutables to work while keeping them disabled on Windows CI where symlink permissions are restricted
…links when symlink permissions are restricted
Enable running opencode on Node.js by adding platform-specific database adapters and replacing Bun-specific shell execution with cross-platform Process utility.
Plugins no longer receive shell access or server URL to prevent unauthorized execution and limit plugin sandbox surface area.
…erver - Enables graceful server shutdown for workspace management - Removes unsupported serverUrl getter that threw errors in plugin context
- Removed debug console.log when dependency installation fails so users see clean warning messages instead of raw error dumps - Fixed database connection cleanup to prevent resource leaks between sessions - Added support for loading custom tools from both .opencode/tool (singular) and .opencode/tools (plural) directories, matching common naming conventions
…s APIs for OAuth servers and retry logic
|
This PR cannot be merged into the beta branch due to: Merge conflicts with dev branch Please resolve this issue to include this PR in the next beta release. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This PR cannot be merged into the beta branch due to: Merge conflicts with dev branch Please resolve this issue to include this PR in the next beta release. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This PR cannot be merged into the beta branch due to: Merge failed Please resolve this issue to include this PR in the next beta release. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This PR cannot be merged into the beta branch due to: Merge failed Please resolve this issue to include this PR in the next beta release. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.