Skip to content

yuanbao-proto : guard malformed ForwardMsgData numeric fields - #80202

Closed
aydnOktay wants to merge 1 commit into
NousResearch:mainfrom
aydnOktay:fix/yuanbao-proto-forward-int-coercion
Closed

yuanbao-proto : guard malformed ForwardMsgData numeric fields#80202
aydnOktay wants to merge 1 commit into
NousResearch:mainfrom
aydnOktay:fix/yuanbao-proto-forward-int-coercion

Conversation

@aydnOktay

Copy link
Copy Markdown
Contributor

Adds a small _coerce_int_or_none() helper in gateway/platforms/yuanbao_proto.py
Uses it to defensively coerce/skip uncoercible numeric fields during ForwardMsgData encoding
Ensures malformed inputs don’t crash encoding and that decoded output falls back to safe defaults

ForwardMsgData protobuf encoding helpers used direct int() conversions for fields like sub_type, msgContent.type, and msg time. Malformed/non-numeric mock payloads could raise during encoding and crash tests or any caller relying on these helpers. This PR adds best-effort coercion and skips uncoercible numeric fields.

Co-authored-by: Cursor <cursoragent@cursor.com>
@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have labels Aug 6, 2026
@aydnOktay

Copy link
Copy Markdown
Contributor Author

Closing to concentrate review on a single linked product bug: #89979.

@aydnOktay aydnOktay closed this Aug 19, 2026
@aydnOktay

Copy link
Copy Markdown
Contributor Author

Closing to concentrate review on a single linked product bug: #89979.

1 similar comment
@aydnOktay

Copy link
Copy Markdown
Contributor Author

Closing to concentrate review on a single linked product bug: #89979.

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

Labels

comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants