open-design/apps
YOMXXX 269a385ee2
fix(daemon): reconcile missing artifact manifests on run end (#2893) (#3110)
* fix(daemon): reconcile missing artifact manifests on run end (#2893)

When an agent writes HTML via write_file instead of create_artifact,
no .artifact.json manifest sidecar is created. If the run then
terminates (inactivity watchdog, user cancel, or process exit), the
HTML file exists on disk but the manifest is missing — breaking the
artifact panel, finalize, and export flows.

Add a best-effort reconciliation step in the child.on('close') handler
that lists project HTML files and calls reconcileHtmlArtifactManifest
for any missing sidecars. The IIFE runs asynchronously after
design.runs.finish() so it never blocks run finalisation.

* fix(daemon): scope run-end reconciliation to files modified during the run

The review on #3110 flagged that listing the entire project tree and
reconciling every HTML file without a sidecar is too broad — for
imported-folder projects (metadata.baseDir), pre-existing HTML files
would receive spurious manifests.

Record runStartTimeMs at the beginning of startChatRun and filter the
reconciliation loop to only touch HTML files whose mtime >= that
timestamp. Add a regression test that backdates a pre-existing HTML
file and verifies it is skipped while a new file is reconciled.

* test(daemon): fix mtime ordering in reconciliation regression test

The runStartTimeMs was recorded after writing the new file, so its
mtime fell before the threshold and the reconciliation filter skipped
it. Move the timestamp capture to before the write to match the real
startChatRun semantics.
2026-05-28 03:54:48 +00:00
..
daemon fix(daemon): reconcile missing artifact manifests on run end (#2893) (#3110) 2026-05-28 03:54:48 +00:00
desktop fix(diagnostics): capture daemon/web logs in packaged bundles (#3126) 2026-05-27 14:48:14 +00:00
landing-page fix(landing-page): drop Homepage CTA from plugin detail page (#3129) 2026-05-27 14:54:54 +00:00
packaged fix(packaged): honor OD_DATA_DIR in desktop runtime (#2162) 2026-05-24 14:21:54 +00:00
telemetry-worker chore: pin dependency versions and harden CI caches (#2189) 2026-05-19 13:58:27 +08:00
web fix: increase subtab-pill gap to prevent active tab overlap (#3134) 2026-05-28 03:44:09 +00:00
AGENTS.md refactor(daemon): split agent runtime definitions (#1063) 2026-05-11 15:01:55 +08:00