fix(server): match Hono wire format for authorize undefined and share errors#26474
Merged
Conversation
… errors Two small parity gaps surfaced in the post-merge audit: 1. **Provider /authorize when result is undefined** — the legacy Hono handler serialized as JSON \`null\` (clients call \`.json()\` and get a parseable null). The HTTP API handler was returning an empty 200 response (0 bytes), which throws on \`.json()\` parse. Restored Hono parity by emitting \`null\` JSON. 2. **Session share/unshare error mapping** — the HTTP API handler blanket-mapped any failure from SessionShare to a 400 BadRequest. The legacy Hono handler let errors propagate through ErrorMiddleware, which routed unmatched failures to a 500 with a structured NamedError.Unknown body. Storage and network failures from SessionShare are real possibilities and aren't client-induced, so the 500 mapping is correct. Map to InternalServerError instead of BadRequest, and update the endpoint declarations to match.
kitlangton
added a commit
that referenced
this pull request
May 9, 2026
PR #26474 changed the provider authorize handler to serialize an undefined service result as JSON `null` instead of an empty body so clients can `.json()` parse uniformly. Update the deletion branch's test assertion to match.
katosun2
pushed a commit
to katosun2/opencode
that referenced
this pull request
May 10, 2026
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.
Summary
Two small wire-format parity gaps surfaced in the post-merge audit:
Test plan