← Back to Pull requests

fix(studio): serialize SSE error events as valid JSON #219

Merged
Duansg merged 7 files (533 lines) on Oct 23, 2026 01:13 UTC
View on GitHub
Duansg Duansg commented on Oct 22, 2026 18:12 UTC
Author

Describe what this PR does / why we need it

Contributing to ARGI: Studio SSE error events are now always valid JSON, and the UI no longer silently drops malformed error events.

Does this pull request fix one issue?

Fixes #192

Describe how you did it

  • Agent and Graph controllers serialize a shared StreamErrorResponse with the existing ObjectMapper, with a constant fallback if serialization fails. Event name and fields (error, errorType, errorMessage) are unchanged.

  • argi-api.ts uses one SSE reader for both streams: an unparsable event: error now fails the stream, while malformed normal data lines are still skipped. It also handles CRLF, chunk boundaries and a trailing event without newline.
  • Describe how to verify it

  • ./mvnw -pl :argi-studio -am test (new StudioStreamErrorEventTest: quotes, backslashes, Windows paths, tab, CR, LF, Unicode, null message, serializer failure).

  • pnpm test in argi-studio/agent-chat-ui (15 tests, including split-chunk and malformed error event cases).
  • Special notes for reviews

    Bundled static assets under META-INF/resources/chatui are not rebuilt in this PR, consistent with previous argi-api.ts changes. No browser end-to-end run.

    Diff: 533 lines (+426 / -107) across 7 files Reviewer: yuluo-yx Review duration: 421m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.49) × (1 − Review Confidence (0.64)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.49 · 533 lines diff across 7 files
    0.49
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.35 · 1 substantive comment(s)
    0.35
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    63%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.376
    Real PR Conversation Timeline
    2 items
    yuluo-yx yuluo-yx approved these changes on Oct 23, 2026 01:13 UTC
    Approved Reviewer

    Reviewed the SSE serialization and shared reader changes with the regression tests. The failed format job was a Maven download HTTP 429, not a formatting finding.

    Reviewers
    Assignees
    Duansg Duansg
    Labels
    risk: low confidence: 63.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 49.4% (MEDIUM) · Higher = larger blast radius
    49.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 63.7% · Lower = rushed or shallow review
    63.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.9% · Safe to merge
    17.9%