Skip to content

Pipeline runner silently returns empty dict on JSON decode failure #156

Description

@mcdonalday

Pipeline runner silently returns empty dict on JSON decode failure

Severity: Medium
File: backend/app/code/pipeline/pipeline_runner.py:129

When parsing LLM-generated JSON responses, the code attempts to extract JSON from text by finding { and }. If parsing fails, it logs a warning and returns an empty dict. Downstream code receives no signal that parsing failed.

except json.JSONDecodeError:
    pass

# Return empty dict if parsing fails
logger.warning(f"Failed to parse JSON from response: {text[:200]}")
return {}

Why it matters

Pipeline steps that depend on structured LLM output proceed with empty data, causing cascading failures or incorrect code generation. The warning log is easily missed in production.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions