fix(agent-service): handle falsy model throws - #7638
Draft
anthonychengit wants to merge 1 commit into
Draft
Conversation
Contributor
Automated Reviewer SuggestionsBased on the
|
Contributor
Backport auto-label reportThis
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7638 +/- ##
=========================================
Coverage 89.65% 89.65%
Complexity 4397 4397
=========================================
Files 1177 1177
Lines 46996 46997 +1
Branches 5268 5268
=========================================
+ Hits 42136 42137 +1
Misses 3094 3094
Partials 1766 1766
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?
The model adapter can throw arbitrary JavaScript values, including
nullandundefined. The previous error path immediately readerror.name, so those values causedsendMessageitself to reject instead of returning Texera's normal error result.This change safely normalizes thrown values and uses optional access for optional error metadata. The regression test covers
null,undefined,false,0, and the empty string, and verifies both the resolved response and its recorded error step.Any related issues, documentation, discussions?
Closes #7485
How was this PR tested?
npx --yes bun@1.3.14 test src/agent/texera-agent.spec.ts npx --yes bun@1.3.14 run typecheck npx --yes bun@1.3.14 run format:checkThe test file passed 56 tests. Type checking and formatting checks also passed.
Was this PR authored or co-authored using generative AI tooling?
Generated-by: OpenAI Codex (GPT-5)