fix(ai): preserve numeric status field in RUN_ERROR payloads - #985
fix(ai): preserve numeric status field in RUN_ERROR payloads#985jan-kubica wants to merge 1 commit into
Conversation
toRunErrorPayload dropped the HTTP status for SDK error classes that report it only as a numeric `status` field with no `code` (e.g. Google's @google/genai ApiError), leaving RUN_ERROR events with code: undefined and making 401/403/404/429 indistinguishable from unknown failures. Fall back to a numeric `status` when no `code` is present; ignore a string `status` (reason phrase / symbolic status) so only the numeric HTTP code is forwarded.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthrough
ChangesError payload status handling
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
toRunErrorPayload dropped the HTTP status for SDK error classes that report it only as a numeric
statusfield with nocode(e.g. Google's @google/genai ApiError), leaving RUN_ERROR events with code: undefined and making 401/403/404/429 indistinguishable from unknown failures. Fall back to a numericstatuswhen nocodeis present; ignore a stringstatus(reason phrase / symbolic status) so only the numeric HTTP code is forwarded.🎯 Changes
✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit