Skip to content

fix: reject missing messages in the text SDK - #313

Open
Reason07 wants to merge 1 commit into
MiniMax-AI:mainfrom
Reason07:fix/sdk-reject-missing-chat-messages
Open

Reason07 wants to merge 1 commit into
MiniMax-AI:mainfrom
Reason07:fix/sdk-reject-missing-chat-messages

Conversation

@Reason07

@Reason07 Reason07 commented Dec 2, 2026 •

Copy link
Copy Markdown

Summary

The text SDK rejected an empty messages array but accepted an omitted one. Non-streaming calls then sent an invalid request, while streaming calls returned an iterator that would send the invalid request when consumed.

Use the existing SDKError with ExitCode.USAGE for either input, before choosing the streaming or non-streaming path.

Verification

  • Both omitted-input regression cases failed before the fix. All four stubbed validation cases now pass and assert zero HTTP requests.
  • bun test test/sdk passed 87 tests.
  • bun run typecheck, ESLint on the changed files, and git diff --check passed.
  • Two independent reviews completed, followed by a review of the test-only refinements.

Codex assisted with this contribution.


Run Proof on this PR
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

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