Skip to content

workspace HttpApi read endpoints return 404 through InstanceRoutes bridge #24380

@justinpbarnett

Description

@justinpbarnett

Description

When OPENCODE_EXPERIMENTAL_HTTPAPI is enabled, the workspace HttpApi read endpoints exist but are not mounted through the live InstanceRoutes Hono bridge.

Direct ExperimentalHttpApiServer coverage for workspace reads passes, but the flag-mounted route surface returns 404 for:

  • GET /experimental/workspace/adaptor
  • GET /experimental/workspace
  • GET /experimental/workspace/status

This is adjacent to #24062, which added the workspace HttpApi read group, and #24216, which added bridge-level coverage. The missing piece is that WorkspacePaths are not registered in packages/opencode/src/server/routes/instance/index.ts.

Steps to reproduce

  1. Enable OPENCODE_EXPERIMENTAL_HTTPAPI.
  2. Request GET /experimental/workspace/adaptor through InstanceRoutes with x-opencode-directory set to a git project directory.
  3. The route returns 404.

A bridge-level regression test reproduced this before the fix:

expect(adaptors.status).toBe(200)
// Received: 404

Expected behavior

The workspace read endpoints should route through the same Effect HttpApi bridge as the other migrated endpoints and return the workspace adaptor/list/status responses.

Actual behavior

The live Hono bridge returns 404 because the workspace paths are not registered.

Scope

This should only need mounting the existing WorkspacePaths in InstanceRoutes and adding bridge-level coverage for the three workspace read endpoints.

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions