OpenCode Workerd SDK requests fail during location bootstrap
bartlomieju opened ·
The OpenCode Workerd SDK still returns an empty HTTP 500 for `session.create()` after the node:fs callback API is implemented. The failure occurs before the route handler runs.
Reproduction:
```sh CELLD_BINARY=/path/to/celld deno run -A tests/opencode/run.ts --no-install --no-build curl -i http://127.0.0.1:9876/ ```
The OpenCode Worker imports `OpenCodeWorkerd` from `@opencode-ai/sdk/workerd` and calls `opencode.session.create()`. The request returns `UnexpectedStatus` with status 500 and an empty body. Server-side health/handler logging is absent.
The observed path is:
`LocationMiddleware` -> `requestRef()` (defaults to `process.cwd()`) -> `LocationServiceMap.get()` -> `Location.boundNode()` -> `Project.resolve()` -> `Git.repo.discover()` -> `FSUtil.up()` -> filesystem `exists()`.
The Workerd profile replaces `FileSystem`, `FileSystemSearch`, `Pty`, `Snapshot`, `Vcs`, and process spawning, but it does not provide a complete Workerd-compatible location/`FSUtil`/`Project` layer. The resulting defect is converted into an empty 500 before the endpoint handler runs. Supplying `session.create({ location: { directory: "/bundle" } })` does not change the result, confirming that the failure is in the outer location middleware.
Please either bypass location resolution for routes that are safe without a local worktree, or provide a Workerd-compatible location bootstrap with the required filesystem/project operations. The fix must preserve the no-local-execution-plane contract; it must not re-enable native filesystem or subprocess access.
bartlomiejureferenced fd7b96b993f52 months ago on GitHub
bartlomiejureferenced b61356b29deb2 months ago on GitHub
bartlomiejureferenced 7ac68e0bd2a72 months ago on GitHub
bartlomiejureferenced 10cb1303dac72 months ago on GitHub