Skip to content

fix(assistant): negotiate structured errors before SSE starts - #97

Merged
vitorhugo-dotnet merged 3 commits into
mainfrom
fix/96-assistant-pre-sse-errors
Sep 18, 2026
Merged

vitorhugo-dotnet merged 3 commits into
mainfrom
fix/96-assistant-pre-sse-errors

Conversation

@vitorhugo-dotnet

Copy link
Copy Markdown
Owner

Summary

Fixes the backend side of #96.

Root cause

POST /api/v1/assistant/chat produces text/event-stream, but validation and malformed-body errors happen before the controller returns an SseEmitter. The global exception handlers did not declare JSON/problem media types, so the original 400 could cascade into HttpMediaTypeNotAcceptableException when the client negotiated SSE.

Changes

  • keep @NotNull conversationId and @NotBlank message
  • explicitly negotiate application/problem+json and application/json for:
    • MethodArgumentNotValidException
    • HttpMessageNotReadableException
  • keep provider/runtime errors inside the established SSE event flow
  • add regression coverage for:
    • missing conversation ID
    • malformed UUID
    • blank message
    • valid request still negotiating SSE

Related frontend fix: companion PR in React-JobApplyTracker.

Fixes #96

@github-actions

Copy link
Copy Markdown

Qodana for JVM

3 new problems were found

Inspection name Severity Problems
Nullability and data flow problems 🔶 Warning 1
Mismatched query and update of 'StringBuilder' 🔶 Warning 1
Simplifiable conditional expression 🔶 Warning 1
View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2025.3.2
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

@vitorhugo-dotnet
vitorhugo-dotnet merged commit cc48564 into main Sep 18, 2026
6 checks passed
@vitorhugo-dotnet
vitorhugo-dotnet deleted the fix/96-assistant-pre-sse-errors branch September 18, 2026 01:33
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.

fix(assistant): prevent null conversationId and handle pre-SSE errors correctly

1 participant