Skip to content

Conversation

@ilayaperumalg
Copy link
Member

  • When the error event occurs, the ChatCompletionResponseBuilder is empty and hence the contentBlockReference.get() throws NPE.
    • Add null check to unhandled event in addition to the logging the event type
    • Add test to verify the usecase

Resolves #3740

 - When the error event occurs, the ChatCompletionResponseBuilder is empty and hence the contentBlockReference.get() throws NPE.
   - Add null check to unhandled event in addition to the logging the event type
   - Add test to verify the usecase

Resolves spring-projects#3740

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
@ilayaperumalg ilayaperumalg added this to the 1.1.x milestone Jul 7, 2025
@sobychacko sobychacko merged commit 283d0c6 into spring-projects:main Jul 7, 2025
2 checks passed
spring-builds pushed a commit that referenced this pull request Jul 7, 2025
- When the error event occurs, the ChatCompletionResponseBuilder is empty and hence the contentBlockReference.get() throws NPE.
   - Add null check to unhandled event in addition to the logging the event type
   - Add test to verify the usecase

Fixes #3740

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
(cherry picked from commit 283d0c6)
scionaltera pushed a commit to scionaltera/spring-ai that referenced this pull request Sep 3, 2025
- When the error event occurs, the ChatCompletionResponseBuilder is empty and hence the contentBlockReference.get() throws NPE.
   - Add null check to unhandled event in addition to the logging the event type
   - Add test to verify the usecase

Fixes spring-projects#3740

Auto-cherry-pick to 1.0.x

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
chedim pushed a commit to couchbaselabs/spring-ai that referenced this pull request Sep 19, 2025
- When the error event occurs, the ChatCompletionResponseBuilder is empty and hence the contentBlockReference.get() throws NPE.
   - Add null check to unhandled event in addition to the logging the event type
   - Add test to verify the usecase

Fixes spring-projects#3740

Auto-cherry-pick to 1.0.x

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
Willam2004 pushed a commit to Willam2004/spring-ai that referenced this pull request Oct 11, 2025
- When the error event occurs, the ChatCompletionResponseBuilder is empty and hence the contentBlockReference.get() throws NPE.
   - Add null check to unhandled event in addition to the logging the event type
   - Add test to verify the usecase

Fixes spring-projects#3740

Auto-cherry-pick to 1.0.x

Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
Signed-off-by: 家娃 <guanjing.pangj@alibaba-inc.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Anthropic Error Responses Can Cause NPE In StreamHelper

2 participants