Skip to content

sdks/ts: fix serializer bugs and agentError null crash#2855

Open
Myestery wants to merge 2 commits intomainfrom
fix/sdks-ts-serializer-bugs
Open

sdks/ts: fix serializer bugs and agentError null crash#2855
Myestery wants to merge 2 commits intomainfrom
fix/sdks-ts-serializer-bugs

Conversation

@Myestery
Copy link
Contributor

@Myestery Myestery commented Mar 2, 2026

Summary

  • Fix missingObjectKey argument swap: arguments were reversed (tsValue, 'tag')('tag', tsValue), producing wrong error messages
  • Fix handleObjectMatch null check: was comparing to string literal 'interface' instead of checking for null
  • Fix u64 BigInt conversion: properly convert number to BigInt instead of casting as any
  • Add null guards in serializeTsValueToBinaryReference and serializeTsValueToTextReference (typeof null === 'object' was passing the guard)
  • Fix isAgentError crash on null input: add null/non-object guard before accessing properties

Context

Split from #2845 — this PR contains only the bug fixes, no lint rule changes or type refactoring.

Test plan

  • Existing SDK tests pass
  • Manual verification that isAgentError(null) returns false instead of crashing
  • Serializer correctly handles missingObjectKey error messages

- Fix missingObjectKey argument swap: arguments were reversed (tsValue, 'tag') → ('tag', tsValue)
- Fix handleObjectMatch null check: was comparing to string literal 'interface' instead of checking for null
- Fix u64 BigInt conversion: properly convert number to BigInt instead of casting as any
- Add null guards in serializeTsValueToBinaryReference and serializeTsValueToTextReference (typeof null === 'object' was passing the guard)
- Fix isAgentError crash on null input: add null/non-object guard before accessing properties
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

Thank you for your contribution! Before we can merge this PR, we need you to sign our Contributor License Agreement. Please read the CLA and post the comment below to sign.


I have read the CLA Document and I hereby sign the CLA


1 out of 2 committers have signed the CLA.
✅ (vigoo)[https://github.com/vigoo]
@Myestery
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

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.

2 participants