Skip to content

Fix desktop startup by packaging built-in Service resources - #316

Merged
cxxxxxn (cxxxxxn) merged 1 commit into
mainfrom
fix/desktop-service-resources
Oct 19, 2026
Merged

cxxxxxn (cxxxxxn) merged 1 commit into
mainfrom
fix/desktop-service-resources

Conversation

@cxxxxxn

Copy link
Copy Markdown
Contributor

Summary

Fix packaged desktop startup failing with Server process exited before becoming ready (code=1, signal=null) because bundled Service resources were missing from the installer.

  • Copy dist-bundle/services into resources/server/services alongside the server bundle.
  • Exclude *.test.* source files while preserving Service manifests, skills, and runtime entry files.
  • Add an isolated bundle regression test covering the resource mapping, test-source exclusion, and content hashes for every loaded Service package.
  • Document the desktop Service packaging contract.

Root cause

The server build already copies Service resources, but electron-builder did not include them. During startup, the Service loader falls back to the source layout and throws ENOENT for services/image-gen/service.yaml, terminating the server before readiness.

Validation

  • pnpm typecheck
  • pnpm format (no additional changes)
  • pnpm lint:fix (0 errors, 330 warnings; no additional changes)
  • Bundle runtime and Service loader tests: 6 passed
  • Build a local Windows NSIS installer; extract its payload and launch the packaged executable with isolated user data. Verify a visible setup window, HTTP 200 readiness with no issues, and all four Services loaded. The app remained alive for the additional 10-second observation and was then shut down.
  • After adding test-source exclusions, package again with electron-builder and verify all 8 runtime resource files match the source byte-for-byte, with no test files shipped.

The installer smoke test used an unsigned local build. The Windows install wizard, existing-user-data upgrade, macOS/Linux startup, and ESRP signing were not exercised. Signing configuration and credential handling are unchanged.

Include Service manifests and runtime files in desktop packages, add an isolated bundle regression test, and document the packaging contract.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI 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.

🟢 Approval recommended

The focused packaging fix matches loader expectations and includes regression coverage; reported validation was not independently rerun.

No open issues 🎉

What changed in this PR

Fixes packaged desktop startup by including the built-in Service resources required during server initialization.

Changes:

  • Packages Service resources while excluding test source files.
  • Adds isolated loading and content-hash regression coverage.
  • Documents the desktop Service packaging contract.
File Description
docs/​architecture/​service-packages.md Documents resource layout and startup requirements.
apps/​server/​src/​bundle.test.ts Tests resource mapping, exclusions, and isolated Service loading.
apps/​desktop/​electron-builder.yml Includes Service resources in desktop packages.

Review effort: Balanced

@cxxxxxn
cxxxxxn (cxxxxxn) merged commit c22b5b6 into main Oct 19, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants