Skip to content

fix(messages): return errors on load failure#190

Open
MicroMilo wants to merge 1 commit into
OpenBMB:mainfrom
MicroMilo:codex/message-load-errors-500
Open

fix(messages): return errors on load failure#190
MicroMilo wants to merge 1 commit into
OpenBMB:mainfrom
MicroMilo:codex/message-load-errors-500

Conversation

@MicroMilo

Copy link
Copy Markdown

Summary

  • return HTTP 500 when the session messages read path fails
  • include the error while preserving empty message metadata for response-shape compatibility

Verification

  • npm --workspace ui test
  • npm exec -- tsc --noEmit -p tsconfig.json

Notes

This is a real API semantics bug: the previous route converted read failures into HTTP 200 empty message lists, making failures indistinguishable from an empty session.

@MicroMilo

Copy link
Copy Markdown
Author

Validation note:

This PR fixes an API semantics bug in the session message loading workflow.

Before this change, a failure in the message read path was returned as HTTP 200 with an empty message list. That made two different states indistinguishable to API consumers:

  • the session has no messages;
  • the server failed to read the session messages.

This PR changes the failure path to return HTTP 500 with an error field, while preserving the existing response-shape fields (messages, total, hasMore, offset, limit) for compatibility.

Validation commands currently listed by this PR:

npm --workspace ui test
npm exec -- tsc --noEmit -p tsconfig.json

The API behavior change is correct, but the self-validation should be more focused. A route-level regression test should mock the message read function to throw and assert that:

  • the response status is 500;
  • the response includes error;
  • the compatibility fields are still present.

That test would prove the fixed failure semantics directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant