open-design/packages
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
..
agui-adapter chore: pin dependency versions and harden CI caches (#2189) 2026-05-19 13:58:27 +08:00
contracts Add tracking for Comment panel save/send actions (#3098) 2026-05-27 09:23:19 +00:00
diagnostics feat(diagnostics): add one-click log export from Settings → About (#798) 2026-05-20 09:10:51 +08:00
download fix(download): handle pid reuse in stale locks (#2714) 2026-05-22 18:00:11 +08:00
host Merge origin/main into release/v0.8.0 2026-05-23 12:17:18 +08:00
platform Harden packaged updater downloads and install handoff (#2677) 2026-05-22 15:44:28 +08:00
plugin-runtime chore: pin dependency versions and harden CI caches (#2189) 2026-05-19 13:58:27 +08:00
registry-protocol chore: pin dependency versions and harden CI caches (#2189) 2026-05-19 13:58:27 +08:00
sidecar fix(diagnostics): capture daemon/web logs in packaged bundles (#3126) 2026-05-27 14:48:14 +00:00
sidecar-proto Merge origin/main into release/v0.8.0 2026-05-23 12:17:18 +08:00
AGENTS.md refactor desktop host bridge (#2246) 2026-05-19 18:27:05 +08:00