Hono → Effect HttpApi#25667
Merged
Merged
Conversation
f5a886d to
10d22a5
Compare
1 task
kitlangton
added a commit
that referenced
this pull request
May 9, 2026
The existing test/project/instance-bootstrap-regression.test.ts covers four boundaries: WithInstance.provide, the CLI bootstrap, the legacy Hono InstanceMiddleware, and InstanceRuntime.reloadInstance. The Hono deletion PR (#25667) drops the entire file because the Hono variant goes away, taking the three backend-agnostic boundary checks with it. Move the three surviving boundary checks into a new instance-bootstrap.test.ts so the InstanceBootstrap-runs-at-boundary invariant stays covered after Hono is deleted. The original file can remain in place until #25667 lands; once the deletion lands, only this file remains.
kitlangton
added a commit
that referenced
this pull request
May 9, 2026
The existing test/project/instance-bootstrap-regression.test.ts covers four boundaries: WithInstance.provide, the CLI bootstrap, the legacy Hono InstanceMiddleware, and InstanceRuntime.reloadInstance. The Hono deletion PR (#25667) drops the entire file because the Hono variant goes away, taking the three backend-agnostic boundary checks with it. Move the three surviving boundary checks into a new instance-bootstrap.test.ts so the InstanceBootstrap-runs-at-boundary invariant stays covered after Hono is deleted. The original file can remain in place until #25667 lands; once the deletion lands, only this file remains.
kitlangton
added a commit
that referenced
this pull request
May 9, 2026
The existing test/project/instance-bootstrap-regression.test.ts covers four boundaries: WithInstance.provide, the CLI bootstrap, the legacy Hono InstanceMiddleware, and InstanceRuntime.reloadInstance. The Hono deletion PR (#25667) drops the entire file because the Hono variant goes away, taking the three backend-agnostic boundary checks with it. Move the three surviving boundary checks into a new instance-bootstrap.test.ts so the InstanceBootstrap-runs-at-boundary invariant stays covered after Hono is deleted. The original file can remain in place until #25667 lands; once the deletion lands, only this file remains.
kitlangton
added a commit
that referenced
this pull request
May 9, 2026
The existing test/project/instance-bootstrap-regression.test.ts covers four boundaries: WithInstance.provide, the CLI bootstrap, the legacy Hono InstanceMiddleware, and InstanceRuntime.reloadInstance. The Hono deletion PR (#25667) drops the entire file because the Hono variant goes away, taking the three backend-agnostic boundary checks with it. Move the three surviving boundary checks into a new instance-bootstrap.test.ts so the InstanceBootstrap-runs-at-boundary invariant stays covered after Hono is deleted. The original file can remain in place until #25667 lands; once the deletion lands, only this file remains.
kitlangton
added a commit
that referenced
this pull request
May 9, 2026
The existing test/project/instance-bootstrap-regression.test.ts covers four boundaries: WithInstance.provide, the CLI bootstrap, the legacy Hono InstanceMiddleware, and InstanceRuntime.reloadInstance. The Hono deletion PR (#25667) drops the entire file because the Hono variant goes away, taking the three backend-agnostic boundary checks with it. Move the three surviving boundary checks into a new instance-bootstrap.test.ts so the InstanceBootstrap-runs-at-boundary invariant stays covered after Hono is deleted. The original file can remain in place until #25667 lands; once the deletion lands, only this file remains.
kitlangton
added a commit
that referenced
this pull request
May 9, 2026
The existing test/project/instance-bootstrap-regression.test.ts covers four boundaries: WithInstance.provide, the CLI bootstrap, the legacy Hono InstanceMiddleware, and InstanceRuntime.reloadInstance. The Hono deletion PR (#25667) drops the entire file because the Hono variant goes away, taking the three backend-agnostic boundary checks with it. Move the three surviving boundary checks into a new instance-bootstrap.test.ts so the InstanceBootstrap-runs-at-boundary invariant stays covered after Hono is deleted. The original file can remain in place until #25667 lands; once the deletion lands, only this file remains.
kitlangton
added a commit
that referenced
this pull request
May 9, 2026
The existing test/project/instance-bootstrap-regression.test.ts covers four boundaries: WithInstance.provide, the CLI bootstrap, the legacy Hono InstanceMiddleware, and InstanceRuntime.reloadInstance. The Hono deletion PR (#25667) drops the entire file because the Hono variant goes away, taking the three backend-agnostic boundary checks with it. Move the three surviving boundary checks into a new instance-bootstrap.test.ts so the InstanceBootstrap-runs-at-boundary invariant stays covered after Hono is deleted. The original file can remain in place until #25667 lands; once the deletion lands, only this file remains.
kitlangton
added a commit
that referenced
this pull request
May 9, 2026
The existing test/project/instance-bootstrap-regression.test.ts covers four boundaries: WithInstance.provide, the CLI bootstrap, the legacy Hono InstanceMiddleware, and InstanceRuntime.reloadInstance. The Hono deletion PR (#25667) drops the entire file because the Hono variant goes away, taking the three backend-agnostic boundary checks with it. Move the three surviving boundary checks into a new instance-bootstrap.test.ts so the InstanceBootstrap-runs-at-boundary invariant stays covered after Hono is deleted. The original file can remain in place until #25667 lands; once the deletion lands, only this file remains.
kitlangton
added a commit
that referenced
this pull request
May 9, 2026
The existing test/project/instance-bootstrap-regression.test.ts covers four boundaries: WithInstance.provide, the CLI bootstrap, the legacy Hono InstanceMiddleware, and InstanceRuntime.reloadInstance. The Hono deletion PR (#25667) drops the entire file because the Hono variant goes away, taking the three backend-agnostic boundary checks with it. Move the three surviving boundary checks into a new instance-bootstrap.test.ts so the InstanceBootstrap-runs-at-boundary invariant stays covered after Hono is deleted. The original file can remain in place until #25667 lands; once the deletion lands, only this file remains.
10d22a5 to
f1554f1
Compare
Exploration to expose the size of the cliff for removing the Hono backend.
HttpApi is already the default on dev/beta/local channels and a feature-superset
of Hono's surface. This deletes:
- 14 Hono per-feature route files (config, event, experimental, file, mcp,
permission, project, provider, pty, question, session, sync, trace, tui)
- Hono shell: routes/instance/index.ts (the bridge), middleware.ts, error.ts,
fence.ts, proxy.ts, workspace.ts, routes/global.ts, routes/ui.ts,
routes/control/{index,workspace}.ts
- Adapters: adapter.ts, adapter.bun.ts, adapter.node.ts (and #hono export)
- backend.ts (selection becomes vestigial)
- 4 parity tests: httpapi-bridge, httpapi-parity, httpapi-json-parity,
httpapi-instance.legacy
- script/httpapi-exercise.ts (cross-backend diff utility)
- Hono deps from package.json: hono, hono-openapi, @hono/node-server,
@hono/node-ws, @hono/standard-validator, @hono/zod-validator
- Flag.OPENCODE_EXPERIMENTAL_HTTPAPI and HTTPAPI_DEFAULT_ON_CHANNELS
Server.ts simplified to HttpApi-only listen + openapi.
Tests still need follow-up cleanup:
- ~21 test files reference the deleted flag (mechanical removal of beforeAll
setup blocks)
- 7 test files reference Server.Legacy
- 3 test files import deleted modules:
- test/project/instance-bootstrap-regression.test.ts
- test/server/httpapi-tui.test.ts
- test/server/trace-attributes.test.ts
This commit leaves source compiling but tests broken; the test surgery is the
remaining work to land this for real.
Drop the Flag.OPENCODE_EXPERIMENTAL_HTTPAPI setup, replace Server.Legacy() with Server.Default(), and delete tests that exclusively cover deleted Hono-only modules (instance-bootstrap-regression, httpapi-tui, trace-attributes). Workspace typecheck is clean. Runtime cliff item: the Hono-specific no-auth WS connect (which intentionally bypassed tickets when server password was unset) does not have a direct HttpApi equivalent yet — see httpapi-listen.test.ts 'keeps PTY websocket tickets optional when server auth is disabled' which fails at runtime. Either drop that test or add no-auth support to HttpApi PTY connect before this can land for real.
88d9b99 to
58ceb37
Compare
58ceb37 to
ab66fc2
Compare
1 task
2 tasks
katosun2
pushed a commit
to katosun2/opencode
that referenced
this pull request
May 10, 2026
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
Research draft to expose the size of the cliff for removing Hono. Not for merge as-is. Kept open as a visualization aid + scope spike + early bug-finder for the real "make HttpApi the only backend" PR.
Result
70 files changed, ~83 insertions, ~9,042 deletions.
Workspace typecheck (
bun turbo typecheck): 13/13 green locally and in the pre-push hook. Source side compiles end-to-end.What got deleted
14 Hono per-feature route files (
src/server/routes/instance/{config,event,experimental,file,mcp,permission,project,provider,pty,question,session,sync,trace,tui}.ts)Hono shell —
routes/instance/index.ts(the bridge),middleware.ts,error.ts,fence.ts,proxy.ts,workspace.ts,routes/global.ts,routes/ui.ts,routes/control/{index,workspace}.tsAdapters —
adapter.ts,adapter.bun.ts,adapter.node.ts(and the#honopackage.json export)Selection layer —
backend.ts,Flag.OPENCODE_EXPERIMENTAL_HTTPAPI,HTTPAPI_DEFAULT_ON_CHANNELSParity tests —
httpapi-bridge,httpapi-parity,httpapi-json-parity,httpapi-instance.legacyCross-backend utility —
script/httpapi-exercise.ts(Hono ↔ HttpApi diff harness)Tests covering deleted modules —
instance-bootstrap-regression.test.ts,httpapi-tui.test.ts,trace-attributes.test.tsHono deps from
package.json/ lock —hono,hono-openapi,@hono/node-server,@hono/node-ws,@hono/standard-validator,@hono/zod-validatorWhat stayed and got simplified
server.ts— collapsed to HttpApi-onlylisten()+openapi()while preserving the freshConfigProvider.fromEnv()listener fix.cli/cmd/generate.ts— always uses the HttpApi OpenAPI spec.packages/sdk/js/script/build.ts— removed the staleOPENCODE_SDK_OPENAPI=hono/generate --honofallback.zodstays: still used across config/session/tool/plugin/runtime schemas.zod-to-json-schemadependency was removed.BusEvent.payloads(),SyncEvent.payloads(), unused Worktree/workspace.zodstatics, the legacyAssistantErrorZodunion, and the TUI control queue payload now reuses Effect Schema.httpapi-*test files — dropped Hono parametric branches; all run against HttpApi only.Known cliff items (gating real merge)
Full CI. Focused server tests and typecheck pass locally, but full pre-merge CI on
devstill needs to complete on this branch.Stable rollout sequencing. Real deletion should only happen after HttpApi is default for stable channels and has baked there.
Dependent command smoke.
cli/cmd/tui/worker.ts,cli/cmd/acp.ts,cli/cmd/web.ts,cli/cmd/serve.ts, andcli/cmd/run.tsimport@/server/serverand useServer.listen()/Server.Default().app.fetch(), which still exist. No code changes appear necessary, but these should get one final smoke before real merge.Zod/NamedError follow-up. This branch removes only the easy dead Zod compatibility exposed by Hono deletion. Larger Zod removal still needs separate focused migrations for config, session/message, plugin/tool schemas, and
NamedError.create(...)call sites.NamedError note
Worktree*Errorand other simpleNamedError.create(...)sites are good future Schema-backed candidates, but not blindly. The currentnamedSchemaError(...)helper preserves{ name, data }andtoObject(), but it does not extend the coreNamedError, so migrating could loseinstanceof NamedErrorbehavior at the top-level CLI boundary. We should first standardize the replacement helper or update the boundary before bulk-converting.No longer cliffs
httpapi-listen.test.ts > keeps PTY websocket tickets optional when server auth is disabledpasses on this branch.bun run --conditions=browser ./src/index.ts generateand./packages/sdk/js/script/build.tsboth work and produce no generated-file diff.What this proves
Do not merge
This branch will diverge from
devover time and should be rebased or rewritten when the real deletion happens. Closing the research after stable flips is fine.