Skip to content

fix(daemon): preserve run version across restart - #7500

Open
Siri-Ray wants to merge 1 commit into
mainfrom
fix/daemon-reconciliation-app-version
Open

fix(daemon): preserve run version across restart#7500
Siri-Ray wants to merge 1 commit into
mainfrom
fix/daemon-reconciliation-app-version

Conversation

@Siri-Ray

Copy link
Copy Markdown
Contributor

Fixes #7499

Why

Production reconciliation telemetry showed interrupted runs attributed to app_version=0.0.0. The daemon began startup recovery before its async version cache was ready, while durable run state did not retain the version that originally started each run. This made restart outcomes look like a real 0.0.0 release and allowed a newer daemon version to rewrite historical run attribution.

This PR preserves the run-owned version boundary without changing terminal classification, delivery idempotency, or reconciliation fences.

What users will see

There is no UI change. Interrupted runs recovered after a daemon restart now retain the Open Design version that started them in PostHog and Langfuse telemetry. Legacy run state uses the reliably resolved current version, and unresolved attribution is reported as explicit unknown or missing data rather than 0.0.0.

Surface area

  • UI — new page / dialog / panel / menu item / setting / empty state in apps/web or apps/desktop (including Electron menu bar)
  • Keyboard shortcut — new or changed
  • CLI / env var — new od subcommand or flag, new tools-dev / tools-pack flag, or new OD_* env var
  • API / contract — new /api/* endpoint, new SSE event, or changed shape in packages/contracts
  • Extension point — new entry under skills/, design-systems/, design-templates/, or craft/, or change to the skills protocol
  • i18n keys — added new translation keys
  • New top-level dependency — adding any new entry to the root package.json
  • Default behavior change — restart reconciliation now preserves durable run version attribution and rejects telemetry placeholder versions
  • None — internal refactor, docs, tests, or translation update only

Screenshots

Not applicable; this change has no UI surface.

Bug fix verification

  • Test paths: apps/daemon/tests/runtimes/run-terminal-reconciliation.test.ts and apps/daemon/tests/observability/task-observation-rollout.test.ts
  • Red on main: yes. The restart test failed because durable state lacked appVersionInfo; the task-observation test showed release, version, and metadata.appVersion changing from the run version 0.21.1 to the restarted daemon version 0.22.0.
  • Green on this branch: yes. Both regressions pass, including legacy-state fallback and explicit unknown/missing behavior.

Validation

  • pnpm exec vitest run -c vitest.config.ts tests/observability/task-observation-rollout.test.ts tests/runtimes/run-terminal-reconciliation.test.ts tests/runtimes/runs.test.ts tests/app-version.test.ts tests/runtimes/amr-terminal-reports.test.ts — 150 tests passed
  • Focused real-process restart suite covering tests/cli-startup.test.ts — passed
  • pnpm --filter @open-design/daemon typecheck — passed
  • pnpm guard — passed
  • pnpm typecheck — passed; existing landing-page hints and the local Node 24.16.0 vs declared 24.18.0 engine warning remain non-failing
  • git diff --check — passed

@lefarcen
lefarcen requested a review from PerishCode August 27, 2026 09:36
@lefarcen lefarcen added size/L PR changes 300-700 lines risk/high High risk: apps/desktop, daemon, auth, migration, workflows, package deps type/bugfix Bug fix labels Aug 27, 2026

@PerishCode PerishCode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Siri-Ray This preserves the run-owned application version through durable restart reconciliation while keeping legacy-state fallback explicit and preventing placeholder releases from entering PostHog or Langfuse attribution. I verified the version-resolution ordering, durable serialization and hydration path, task-level replacement telemetry, compatibility fallback, and focused regression coverage across every changed range. The implementation is carefully scoped and the restart cases are well covered—nice work closing this telemetry gap.

🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.

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

Labels

risk/high High risk: apps/desktop, daemon, auth, migration, workflows, package deps size/L PR changes 300-700 lines type/bugfix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix daemon restart run version attribution

3 participants