Skip to content

bug(extract): IndexError on empty Claude API response content #290

@egouilliard-leyton

Description

@egouilliard-leyton

Context

Discovered during review of epic #271 (graphify parity closeout).

Description

In semantic_extract.py:193 and vision_extract.py:141, response.content[0].text will raise IndexError if the Claude API returns an empty content list (e.g. content-filter refusal, rate-limit with empty body). The surrounding except Exception catches it, but the traceback is misleading — it looks like a bug rather than an expected API edge case.

Suggested approach

Guard with if not response.content: before indexing, and log a specific warning like "empty API response for {rel}". Return SemanticResult() in that case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions