Plan for replacing instance Hono route implementations with Effect HttpApi while preserving behavior, OpenAPI, and SDK output during the transition.
src/server/routes/instance/httpapi/*.HttpApiGroup, schemas, handlers, and route-level middleware.httpapi/server.ts only composes groups, instance lookup, observability, and the web handler bridge.HttpApi replacements are default, tested, and represented in the SDK/OpenAPI pipeline.HttpApi if HttpApi is the wrong abstraction.OPENCODE_EXPERIMENTAL_HTTPAPI gates the bridge. Default behavior still uses Hono.server/routes/instance/index.ts before legacy Hono routes.hono-openapi SDK generation.HttpApi auth is independent of Hono auth.Authorization is attached in each route module, not centrally wrapped in server.ts.auth_token query parameter through HttpApiSecurity.apiKey.httpapi/server.ts using directory, workspace, and x-opencode-directory.Observability.layer is provided in the Effect route layer and deduplicated through the shared memoMap..zod only as compatibility for remaining Hono/OpenAPI surfaces.describeRoute entry.Schema.Struct(...).annotate({ identifier }) for named OpenAPI refs when handlers return plain objects.Schema.Class only when the handler returns real class instances or the constructor requirement is intentional.Schema.Struct unless a named SDK type is useful.Before porting more routes, cover the bridge behavior that every route depends on.
HttpApi bridge, not just HttpApiBuilder.layer directly.auth_token success, missing credentials, and bad credentials.directory and x-opencode-directory instance selection.HttpApi groups.Create a route inventory from the actual Hono registrations and classify each route.
Statuses:
bridged: served through the HttpApi bridge when the flag is on.implemented: HttpApi group exists but is not mounted through Hono.next: good JSON candidate for near-term porting.later: portable, but needs schema/service cleanup first.special: SSE, websocket, streaming, or UI bridge behavior that likely needs raw Effect HTTP rather than HttpApi.Port remaining JSON routes in small batches.
Good near-term candidates:
GET /path, GET /vcs, GET /vcs/diff, GET /command, GET /agent, GET /skill, GET /lsp, GET /formatterPOST /instance/disposePATCH /config, project git init, workspace/worktree create/remove/reset, file search, MCP auth flowsKeep large or stateful groups for later:
sessionsyncHono routes cannot be deleted while hono-openapi is the source of SDK generation.
Required before route deletion:
HttpApi for ported routes.dev for every route group deletion.After JSON parity and SDK generation are covered:
Delete Hono routes group-by-group after each group meets the deletion criteria.
Deletion criteria:
HttpApi route is mounted by default.After deleting a group:
.route(...) registration from instance/index.ts.Special routes need explicit designs before Hono can disappear completely.
event: SSEpty: websockettui: UI/control bridge behaviorsession endpointsUse raw Effect HTTP routes where HttpApi does not fit. The goal is deleting Hono implementations, not forcing every transport shape through HttpApi.
| Area | Status | Notes |
|---|---|---|
question |
bridged |
GET /question, reply, reject |
permission |
bridged |
list and reply |
provider |
bridged |
list, auth, OAuth authorize/callback |
config |
bridged partial |
reads only; mutation remains Hono |
project |
bridged partial |
reads only; git-init remains Hono |
file |
bridged partial |
list/content/status only |
mcp |
bridged partial |
status only |
workspace |
bridged |
list, get, enter |
| top-level instance reads | bridged partial |
path and vcs reads; command, agent, skill, lsp, formatter next |
| experimental JSON routes | next/later |
console, tool, worktree, resource, global session list |
session |
later/special |
large stateful surface plus streaming |
sync |
later |
process/control side effects |
event |
special |
SSE |
pty |
special |
websocket |
tui |
special |
UI bridge |
Current Route Status with exact paths.HttpApi JSON route slices.HttpApi routes into Hono behind OPENCODE_EXPERIMENTAL_HTTPAPI.auth_token as a query security scheme.