opencode/packages
Kit Langton 98fef45553 fix(httpapi): 404 status + body shape for missing-session errors
Two related divergences from Hono are fixed in one move:

1. Status: many session handlers (todo, diff, summarize, fork, abort,
   init, deleteMessage, command, shell, revert, unrevert) didn't wrap
   with mapNotFound, so a thrown NotFoundError surfaced as a 500 defect
   instead of a 404. The fork/diff endpoints also lacked OpencodeNotFound
   in their declared error union, so handlers couldn't surface 404 even
   if they wanted to.

2. Body shape: the existing mapNotFound rebrand to HttpApiError.NotFound
   produced an empty 404 response. Hono returns the NamedError envelope
   `{ name: "NotFoundError", data: { message } }`. SDK consumers reading
   `error.data.message` got undefined.

The fix introduces OpencodeNotFound — a Schema.ErrorClass annotated with
`httpApiStatus: 404` and a body schema matching the legacy NamedError
shape. mapNotFound now rebrands NotFoundError to OpencodeNotFound,
preserving the underlying error message. All session endpoints that take
a sessionID now wrap their service calls with mapNotFound.

A TODO in the handler notes the long-term direction: services should
fail with typed errors directly (Effect<T, SessionNotFound>) and let
HttpApi auto-route status + body via schema annotations, eliminating
mapNotFound entirely. This PR is the pragmatic middle: small surface,
no service-layer changes, fixes the user-visible parity bug.

Unskips the two .todo parity reproducers in httpapi-parity.test.ts.
2026-05-02 23:33:14 -04:00
..
app sync release versions for v1.14.33 2026-05-02 19:53:06 +00:00
console sync release versions for v1.14.33 2026-05-02 19:53:06 +00:00
containers chore: bump Bun to 1.3.13 (#23791) 2026-04-23 00:25:36 -04:00
core Refactor v2 session events as schemas (#24512) 2026-05-02 22:09:48 -04:00
desktop sync release versions for v1.14.33 2026-05-02 19:53:06 +00:00
desktop-electron fix(desktop): limit zoom handler to zoom keys (#25516) 2026-05-03 02:44:52 +00:00
docs
enterprise sync release versions for v1.14.33 2026-05-02 19:53:06 +00:00
extensions/zed sync release versions for v1.14.33 2026-05-02 19:53:06 +00:00
function sync release versions for v1.14.33 2026-05-02 19:53:06 +00:00
identity
opencode fix(httpapi): 404 status + body shape for missing-session errors 2026-05-02 23:33:14 -04:00
plugin sync release versions for v1.14.33 2026-05-02 19:53:06 +00:00
script refactor: replace bun semver with npm semver package 2026-03-09 15:29:55 -04:00
sdk chore: generate 2026-05-03 02:10:52 +00:00
slack sync release versions for v1.14.33 2026-05-02 19:53:06 +00:00
storybook feat(prompt): add shell mode UI with cancel button, custom icon, and example placeholder (#24105) 2026-04-24 14:04:55 +08:00
ui sync release versions for v1.14.33 2026-05-02 19:53:06 +00:00
web chore: generate 2026-05-03 00:10:53 +00:00