Skip to content

fix(desktop): guard packaged backend readiness parser#60842

Draft
embwl0x wants to merge 1 commit into
NousResearch:mainfrom
embwl0x:agent/fix-desktop-ready-artifact-skew
Draft

fix(desktop): guard packaged backend readiness parser#60842
embwl0x wants to merge 1 commit into
NousResearch:mainfrom
embwl0x:agent/fix-desktop-ready-artifact-skew

Conversation

@embwl0x

@embwl0x embwl0x commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Fixes #60772.

Summary

  • add an afterPack artifact guard that inspects the packaged desktop app.asar
  • validate the packaged dist/electron-main.mjs readiness parser accepts both HERMES_BACKEND_READY and HERMES_DASHBOARD_READY
  • keep the guard in the packaged-artifact path so source/parser skew fails packaging instead of shipping a boot-breaking app
  • add artifact-level regression coverage for the packaged parser behavior

Refresh note

Rebuilt from current main after the desktop packaging code moved from CommonJS scripts to TypeScript/ESM output. The fix now targets the current .mjs packaged artifact instead of the old .cjs layout.

Verification

  • node --test apps/desktop/scripts/backend-ready-artifact.test.mjs — 6 passed
  • node --check apps/desktop/scripts/backend-ready-artifact.mjs && node --check apps/desktop/scripts/after-pack.mjs
  • npm --prefix apps/desktop run typecheck
  • cd apps/desktop && node --import tsx --test electron/backend-ready.test.ts scripts/backend-ready-artifact.test.mjs — 23 passed
  • git diff --check origin/main..HEAD
  • gitleaks git --log-opts='origin/main..HEAD' --redact . — no leaks found

Note: npm --prefix apps/desktop run test:desktop:platforms currently fails in this checkout on the upstream raw node --test path resolving extensionless .ts imports. The targeted tsx-backed desktop readiness tests above cover this change.

@alt-glitch alt-glitch added type/bug Something isn't working comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Jul 8, 2026

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review Summary

Verdict: Approved (LGTM)

Fixes packaged Electron backend readiness parser artifact skew. The afterPack artifact guard now extracts and validates the packaged backend-ready.cjs from app.asar, ensuring both HERMES_BACKEND_READY and HERMES_DASHBOARD_READY are accepted.

Changes

  • apps/desktop/scripts/after-pack.cjs: artifact extraction
  • apps/desktop/scripts/backend-ready-artifact.cjs: packaged parser validation
  • apps/desktop/scripts/backend-ready-artifact.test.cjs: regression tests

Quality

  • 4 files, 280 additions / 7 deletions
  • Tests: backend-ready-artifact.test.cjs (113 lines), electron/backend-ready.test.cjs, test:desktop:platforms (313 passed)
  • Gitleaks clean, git diff --check clean

Reviewed by Hermes Agent

@embwl0x embwl0x force-pushed the agent/fix-desktop-ready-artifact-skew branch from 7d86388 to 52734ad Compare July 9, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows Desktop can timeout when packaged Electron readiness parser is older than Python backend

3 participants