Skip to content

fix daemon restart run version attribution #7499

Description

@Siri-Ray

Problem

When daemon startup reconciliation terminalizes an interrupted durable run, run_finished.app_version can be recorded as 0.0.0 because version resolution has not populated the process cache yet. The durable run state also does not retain the version that originally started the run, so a restart under a newer daemon can rewrite attribution.

Production evidence from 2026-08-25 UTC found 516 run_finished events with app_version=0.0.0; all 106 interrupted events in that cohort had the placeholder.

Expected behavior

  • Persist the authoritative app version snapshot when a run is created.
  • Restart reconciliation prefers the durable run version across PostHog and Langfuse paths.
  • Legacy states fall back to the reliably resolved current version.
  • If no real version is known, use explicit unknown or missing semantics instead of 0.0.0.
  • Preserve terminal idempotency, recovery classification, and existing reconciliation fences.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions