Skip to content

fix(api-server): reject unsupported object content with HTTP 400 - #561

Open
Bruce-Yii wants to merge 1 commit into
OpenBMB:mainfrom
Bruce-Yii:fix/501-api-content-object
Open

Bruce-Yii wants to merge 1 commit into
OpenBMB:mainfrom
Bruce-Yii:fix/501-api-content-object

Conversation

@Bruce-Yii

Copy link
Copy Markdown

Fixes #501.

Root cause: top-level object message content was silently stringified to [object Object]\ before Gateway/session handling.

Behavior change:
ormalizeContent\ now returns
ull\ for top-level objects; the API server answers HTTP 400 \invalid_content\ before Gateway/session mutation or SSE admission, in both buffered and streaming modes. String and supported array content paths are unchanged.

Regression coverage: focused spec \ ests/adapters/channel/api-server-content-object.spec.ts, 6/6 passing locally (arbitrary-object buffered/streaming, object-part buffered/streaming, string passthrough, array preservation; zero Gateway calls and zero session admission on every rejection path).

Note: full
pm\ build/test were not run locally (environment provides Node 24 while the repo requires Node 22); please let CI verify broader compatibility.

Reject top-level object message content before Gateway/session mutation while preserving string and array paths, in both buffered and streaming modes. Focused spec 6/6. Refs OpenBMB#501.
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.

API content objects are silently stringified as [object Object]

1 participant