open-design/apps/desktop/src/main
lefarcen b8cfee0c60
fix(diagnostics): capture daemon/web logs in packaged bundles (#3126)
Packaged diagnostics bundles never contained the daemon or web
`latest.log` — the very logs that hold the agent/critique run flow — so
support exports could not explain "sent prompt to the agent, then
nothing happened" reports.

Root cause: the sidecar `base` means different things per launch path.
tools-dev passes the pre-namespace source root, so
`resolveNamespaceRoot(base, namespace)` is correct. But the packaged
orchestrator launches every child with `base = <namespaceRoot>/runtime`
(apps/packaged/src/{paths,sidecars}.ts) while logs live a level up at
`<namespaceRoot>/logs`. The diagnostics builders re-appended the
namespace and resolved every log to
`<namespaceRoot>/runtime/<namespace>/logs/...` → ENOENT. renderer.log
only survived by accident: the desktop main process wrote it to the
same wrong path the reader looked in.

Add `resolveRuntimeNamespaceRoot(runtime, contract, runtimeMode)` to
`@open-design/sidecar` which walks up out of the `runtime/` dir in
packaged (runtime-mode) launches and falls back to the dev layout
otherwise. Route the desktop renderer-log path and both diagnostics
exporters (desktop IPC + daemon HTTP) through it so writer and reader
stay in lockstep and renderer.log lands next to the desktop log dir.

Tests: sidecar unit specs for both layouts; a daemon export spec that
writes a real `<namespaceRoot>/logs/daemon/latest.log` and asserts the
bundle captures its contents (red on main → ENOENT placeholder, green
here).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 14:48:14 +00:00
..
diagnostics.ts fix(diagnostics): capture daemon/web logs in packaged bundles (#3126) 2026-05-27 14:48:14 +00:00
index.ts fix(diagnostics): capture daemon/web logs in packaged bundles (#3126) 2026-05-27 14:48:14 +00:00
installer-observations.ts Add packaged update apply observations (#2429) 2026-05-20 19:11:36 +08:00
pdf-export.ts refactor desktop host bridge (#2246) 2026-05-19 18:27:05 +08:00
preload.cts fix Windows folder import from project modal (#2863) 2026-05-26 06:52:07 +00:00
runtime.ts fix: harden Windows packaged updater flow (#2595) 2026-05-21 22:32:02 +08:00
uncaught-exception.ts fix(desktop): swallow setTypeOfService EINVAL crashes in dev main (#647) (#1298) 2026-05-12 16:50:57 +08:00
updater.ts Fix release updater smoke recovery (#2687) 2026-05-22 16:18:33 +08:00