Skip to content

Bug: SSE error formatting crashes IDE parser, breaking storage discovery #2371

@Stranmor

Description

@Stranmor

Reported by @adam2626 in PR #2322.

The Problem:
PR #2322 changed SSE stream errors from broken HTTP chunking to a clean 200 OK with a custom JSON error payload: data: {"error": ...}.

The IDE parser strictly expects the standard OpenAI chunk format (choices[0].delta). When it receives the custom error JSON, it throws a TypeError, freezing or crashing the chat UI. The user is forced to close the IDE.

When the user then opens Antigravity-Manager and clicks 'Switch Account', get_storage_path() attempts to find storage.json by scanning the command-line arguments of the running IDE process. Since the IDE is closed, process discovery fails, resulting in the storage json not found error.

Proposed Fix:
Wrap proxy stream errors in a structurally valid OpenAI SSE chunk so the IDE renders the error as assistant text instead of crashing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions