Skip to content

bug(consolidation): _DedupDecision structured output fails when action is omitted #2453

Description

@Lang-code-ops

bug(consolidation): _DedupDecision structured output fails when action is omitted

Summary

During live consolidation recovery, the dedup structured-output path failed terminally because _DedupDecision required action: Literal["merge", "keep"], but the actual parsed payload could arrive without action.

Observed terminal error:

1 validation error for _DedupDecision
action
  Field required

This turns a malformed or underfilled dedup model response into a full consolidation failure instead of taking a conservative fallback.

Why this is a bug

For dedup/merge decisions, the conservative failure mode should be keep, not "abort the whole consolidation op".

Right now a single underfilled structured response can crash the operation even when the safe behavior is obvious: do not merge.

Expected behavior

If dedup structured output is missing action, Hindsight should fall back conservatively to keep or otherwise treat the response as a non-fatal no-merge decision.

Actual behavior

Consolidation fails terminally with schema validation error for _DedupDecision.action.

Live evidence

From recovery notes in 2026-06-24-hindsight-retain-failed-batch-recovery/README.md:

  • target consolidation op: 8610de21-c7da-49ba-bbdb-6a122dbd1f4e
  • terminal error: _DedupDecision ... action Field required
  • live input could also show {"facts": []} on this path

Quoted note:

_DedupDecision requires action: Literal["merge", "keep"]
live input sometimes arrived as {"facts": []}
terminal error: 1 validation error for _DedupDecision / action / Field required

Local recovery shape

Operational hotfix that unblocked recovery:

  • file: /app/api/hindsight_api/engine/consolidation/consolidator.py
  • change:
action: Literal["merge", "keep"] = "keep"

That changed malformed dedup outputs from fatal to conservative no-merge behavior.

Version

Observed on live ghcr.io/vectorize-io/hindsight:latest-slim / 0.8.3-slim runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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