Uh oh!
There was an error while loading. Please reload this page.
fix(session): encode persisted output formats - #37541
Conversation
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
jogoossens
commented
Jul 28, 2026
ok ,is it coming? hitting this bug too :) |
Futuri-Risk
commented
Aug 12, 2026
Commenting to give this some eyes — and because I believe it closes a severity angle that isn't obvious from the linked issue (#26929). I'm hitting #26929 via the in-process plugin path (the From reading this diff, the root cause it targets — the persisted Two questions / possible nits for the maintainer:
If both check out, this looks mergeable as-is and would unblock every |
rscambler
commented
Aug 18, 2026
Is there anything holding up this review? It would be great to get this fixed |
Issue for this PR
Closes#26929
Type of change
What does this PR do?
Persisted V1 messages hydrate output formats as plain objects. The response encoder previously used
Schema.Class, which requires class instances and returned HTTP 400 when history contained either atextorjson_schemaformat.This changes those two wire schemas to
Schema.Struct, preserving the JSON shape while allowing persisted plain objects to encode. It also adds an endpoint regression test that saves both formats, reloads them through the database, and reads them throughGET /session/:id/message.This supersedes the encoding portion of #29632. Credit to @trevorWieland for the original diagnosis and fix.
How did you verify your code works?
bun test --timeout 60000 test/server/session-messages.test.tsinpackages/opencode— 6 passedbun typecheckinpackages/opencodebun typecheckinpackages/schemaThe repo-wide pre-push typecheck cannot complete in this Windows checkout because the existing
packages/enterprise/src/custom-elements.d.tssymlink is checked out as literal text; both changed packages typecheck successfully.Screenshots / recordings
Not applicable; this is an HTTP response-encoding fix with no UI changes.
Checklist