Commit Graph

310 Commits

Author SHA1 Message Date
Maciej Lisiewski
a95f462421 fix(pm): bump the pinned Git for Windows 2.53.0.3 -> 2.56.1
2.53.0.3 predates three Git for Windows security releases: 2.56.0.3
(eMudhra CA compromise, Git LFS CVE-2026-105803), 2.56.0.4 (bundled
brotli 1.2.1, CVE-2026-111497, reachable via libcurl's br encoding) and
2.56.1 (git CVE-2026-111760 recursive-clone RCE and five others).
2.56.1 was published 2026-11-10, past the release-age window; its first
build ships as PortableGit-2.56.1-*, which the salvaged fetch_url fix
resolves.

2.56 moved the x64 MSYS2 prefix from mingw64/ to ucrt64/, so the
trampoline self-heal git-core candidates, the non-login bash coreutils
PATH dirs and the desktop bundle-arch PortableGit exemption now also
cover ucrt64 (mingw64 kept for existing installs).

Fixes #148835
2026-11-14 17:07:28 +01:00
Teknium
5ad08e106c test(desktop): run the offline dir-preparation test only where dir skips every download
On Windows a --dir preparation still acquires the signing kit
(winCodeSign), so the "no release host reachable" test cannot pass there
by design. Gate it to POSIX, where dir preparation needs no downloads.
2026-11-09 09:44:28 -08:00
Teknium
9ffa8c63c1 fix(desktop): build the unpacked --dir package without GitHub release assets
The JS and TS checks job packages Desktop with `builder --dir`, and its
preparation step fetched the 7zip and icons toolsets plus the Electron zip
from GitHub releases every run. An unpacked build uses none of them: no
archive target runs 7za, and the committed .icns/.ico pass through without
conversion. When icons@1.2.1/icons-bundle.tar.gz returned 504 for over ten
minutes, main went red on every push.

A dir-only preparation now selects neither toolset and, on the host arch,
copies the lock-verified Electron runtime that electron-runtime.mjs already
unpacked, so it makes no network request. Packaged formats keep the old
acquisition, and admission still refuses a non-dir manifest that lacks
the archive or icon tool.
2026-11-09 09:44:28 -08:00
Maciej Lisiewski
9c1ba8898e test(desktop): pin the dev restage guards
A staged copy that has its binding is left alone, and a dev run never creates one.
2026-11-07 01:46:27 +01:00
Maciej Lisiewski
97038ba5cc fix(desktop): restage a dev dist copy of get-windows left without a binding
window-below.ts loads dist/node_modules/get-windows before node_modules, so
a copy staged by a Windows build whose binding fetch failed kept dev runs
without window enumeration after ensureDevGetWindowsBinding fetched the
binding into node_modules.
2026-11-07 01:43:59 +01:00
Maciej Lisiewski
78aa423d3c test(desktop): run the get-windows platform checks on every host
The darwin validateNativeTree branch only ran on macOS, which CI does not
run tests-js on, and no dev test covered the linux/win32-arm64 skip.

Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
2026-11-07 01:43:59 +01:00
Maciej Lisiewski
0923583198 fix(desktop): hand node-pre-gyp the get-windows mirror under the name it reads
node-pre-gyp 1.0.11 replaces only the first "-" of node-get-windows, so it
reads npm_config_node_get-windows_binary_host_mirror, while npm and
source_build.py export the npmrc key with every "-" as "_". Copy the
documented key to the name it reads unless that one is already set.

Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
2026-11-07 01:43:59 +01:00
Maciej Lisiewski
2a6722075b docs(desktop): name every script that runs dev-get-windows 2026-11-07 01:43:59 +01:00
Maciej Lisiewski
48703cfb29 fix(desktop): bound the dev get-windows binding fetch
node-pre-gyp downloads without a timeout, so on a network that drops
packets every Windows dev start waited out the OS TCP timeout while no
binding was present. Kill the installer after two minutes and start
without window enumeration, as on any other failure.
2026-11-07 01:43:58 +01:00
Maciej Lisiewski
595edede4f fix(desktop): fetch get-windows' win32 binding for dev runs
With its install script denied, a fresh Windows install has no binding in
node_modules, and `pnpm run dev` (which loads that copy until a build stages
one) got upstream's no-op stubs. dev:electron and profile:main* now run the
same node-pre-gyp install stage-native-deps uses, once, and fail soft.
2026-11-07 01:43:58 +01:00
Maciej Lisiewski
3d9dfffb9c docs(desktop): describe get-windows as the build now installs it
The win32 binding comes from the node-pre-gyp run in stage-native-deps, not
a dependency install script, and a skipped optional install is no longer how
get-windows goes missing. The compiler README now says an absent staged copy
is a degraded build.
2026-11-07 01:43:58 +01:00
Maciej Lisiewski
2c378e266d fix(desktop): let the source build go on without get-windows
Moving get-windows to dependencies put it in assert-root-install's required
set, so a half-extracted copy (#90829) failed the source build before
stage-native-deps could degrade and print its repair hint. Bundles skip the
guard and degraded. Exempt it by name.
2026-11-07 01:43:36 +01:00
Maciej Lisiewski
1cd48e3376 fix(desktop): install get-windows on macOS and Linux again
pnpm >= 11.6 infers os: [win32] from the name of an optional dependency
that declares no platform (pnpm/pnpm#17774), so the filtered install in
scripts/build/node-deps.mjs skipped get-windows on darwin and linux. The
macOS build then died in validateNativeTree ("Prepared get-windows is
missing its macOS helper"), and Linux and Nix builds shipped without
read_window_below. packageExtensions cannot override the inference.

Declare it as a regular dependency, which pnpm never platform-filters. Its
install script only fetches the win32 prebuilt and falls back to a node-gyp
build that fails where none exists (win32-arm64); for a regular dependency
that would fail the whole install. So deny the script in allowBuilds:
stage-native-deps already runs node-pre-gyp itself on win32 and degrades
when it fails, and darwin and linux need nothing from it.
2026-11-07 01:43:36 +01:00
Maciej Lisiewski
d62c60787f fix: pnpm review follow-ups in nix, evals, the hang repro and an e2e test
- nix dev shell: pnpm-workspace.yaml (overrides, catalog, allowBuilds)
  joins the package.json stamp, so a settings-only change relocks.
- desktop-pane-fixture: resolve vitest/config from apps/desktop; pnpm
  links it only there.
- short-session hang repro: name the lockfile in the target metadata, so
  an npm-era target fails as a lockfile mismatch rather than a bare hash.
- test_mirrors: the pnpm mirror test prefetches from the registry and
  needs allow_network, like its siblings.
2026-11-06 04:08:46 +01:00
Maciej Lisiewski
29e78b124e docs: pnpm commands for the JS workspaces
READMEs, contributor guides, AGENTS.md files, skills and the website (with
the zh-Hans translations) give pnpm commands for the workspaces; the
website itself is still an npm project.
2026-11-06 04:08:45 +01:00
Maciej Lisiewski
7062229090 chore(js): switch the workspaces from npm to pnpm
pnpm 12.15.0 (native executable) installs every JS workspace from one
pnpm-lock.yaml, imported from package-lock.json with the same resolved
versions. website/, the WhatsApp bridge and the photon sidecar stay separate
npm projects.

Configuration moves from .npmrc and the root manifest into
pnpm-workspace.yaml: the 14-day minimumReleaseAge and its excludes,
overrides, allowBuilds (the old allowScripts set, with strictDepBuilds
failing any unlisted build script), engineStrict, sideEffectsCache: false
(in-place rebuilds must not write into the store) and
verifyDepsBeforeRun: false (a `pnpm run` never installs).

The pnpm version is pinned in pm/lock.json and in root devEngines.
pmOnFail: ignore keeps that pin out of pnpm-lock.yaml: a leading pin
document makes osv-scanner read zero packages. scripts/build/node-deps.mjs
enforces the exact version instead, and every lock reader refuses a
multi-document lock. A root preinstall refuses `npm install`; devEngines
onFail is warn so npx (MCP servers, the tsc linter) keeps working inside
the checkout.

User-machine installs run --frozen-lockfile --trust-lockfile (release age is
checked when locking, in CI, not per user). node-deps removes npm-era
node_modules trees before the first pnpm install. Nix builds the store with
fetchPnpmDeps and a hash file that CI checks.
2026-11-06 04:08:24 +01:00
Maciej Lisiewski
9f9b9f54a1 fix: review follow-ups for the workspace dependency moves
- The MCP OAuth renderer probe bundled its entry with esbuild resolving from
  the checkout root, so its react, react-dom and react-query imports still
  relied on hoisting. Resolve them from apps/desktop, which declares them
  (verified: from the root they fail to resolve in an isolated pnpm tree).
- The Windows MSIX commit fixture linked node_modules before `git add apps`,
  so the commit could pick up the dependency link. Link the install trees
  after the commit, which needs only the fixture's own files.
2026-11-05 14:08:26 -08:00
Maciej Lisiewski
c2a0ecc734 fix: resolve electron, vite and playwright from the workspaces that declare them
Scripts outside the declaring workspace found these through the hoisted root node_modules:
mock-server and connector-rehearsal (whose desktop-local Electron path did not exist under npm),
ui-tui's visual harness, the eval harnesses, and the tests/install/e2e-assets drivers, which import
tests-js's @playwright/test and zod. They now resolve from apps/desktop or tests-js; the typed
e2e-assets files go through a tests-js re-export module so their types resolve the same way.
2026-11-05 14:08:26 -08:00
Maciej Lisiewski
99306b4b01 fix(desktop): resolve app-builder-lib and node_modules through module resolution
Packaging scripts and tests reached app-builder-lib's internals as ../../../node_modules/..., and
test fixtures junctioned only the repo-root node_modules, both of which assume npm hoists every
package to the root. The internals are now joined onto the installed package's resolved entry (the
pattern windows-bundle-tools.mjs already uses), AppInfo comes from the package's public entry, and
fixtures mirror both the root and apps/desktop node_modules, so the copied desktop files resolve
their dependencies exactly as the checkout does. gen-msix-manifest output is byte-identical.
2026-11-05 14:08:26 -08:00
BearHuddleston
9dd1ea34f2 refactor(desktop): one retry schedule and one timeout fixture
The missing-ticket retries used their own delay table, which matched
the first five lost-contact pauses. They now call contactDelay(), with
a limit of five. A ticket that never propagates still gets 6 staples,
the same pauses (15, 30, 60, 120 and 120 s) and the same error.

The LOST_CONTACT comment now says which codes point at the runner's own
network (-1003, -1004, -1006, -1009) rather than at Apple.

The older resume test's local `timeoutOutput` copied `notaryTimeout`,
apart from `_kCFStreamErrorDomainKey` (1 rather than 4, the value in
the canary log). The test now uses `notaryTimeout`.
2026-11-03 20:04:19 +00:00
BearHuddleston
23ca14a28e fix(desktop): give lost contact while stapling a 45-minute window
Stapling starts only after Apple has accepted the app. Until now a
dropped connection there could retry for whatever was left of the
four-hour notarization budget, holding the runner for hours on a
network path that main gave up on within a minute. The host-unreachable
codes (-1003, -1004, -1009) usually mean the runner's own network is
broken, not that Apple is down.

Lost contact while stapling now retries for up to 45 minutes, or for
what is left of the notarization budget when that is shorter. 45
minutes is about twice the outage the 2026-11-03 canary ran into. The
wait for Apple's verdict keeps the full budget.

The staple loop also checks LOST_CONTACT before it counts a retry. A
ticket that is still missing after its five retries now throws inside
its own branch, instead of falling through to the lost-contact check.

The outage test now covers both limits, an acceptance at t=0 and one
10 minutes before the budget ends. It fails on the previous head, which
retried for about 4 h, and the second case fails if the Math.min is
removed.
2026-11-03 20:03:29 +00:00
BearHuddleston
2941c7fe66 fix(desktop): keep notarizing through dropped connections to Apple
The 2026-11-03 canary (desktop run 41591721476) signed both macOS
builds, and Apple accepted the arm64 submission, but both builds failed
in this hook on network errors it does not retry:

- arm64: `stapler staple` exited 68 with NSURLErrorDomain Code=-1005
  "The network connection was lost." from api.apple-cloudkit.com. Only
  the exit-65 missing-ticket case was retried.
- x64: `notarytool wait` timed out (Code=-1001) at 07:22, 07:24, 07:27
  and 07:38 UTC. Resuming stopped after three pauses (15, 30 and 60 s),
  although the notarization budget is four hours.

Treat NSURLError timeouts, lost connections and unreachable hosts
(-1001, -1003, -1004, -1005, -1006, -1009) as lost contact in both
loops. Keep resuming the same submission, and retrying the staple, with
pauses capped at 120 s until the next pause would cross the existing
four-hour budget. A ticket that has not propagated yet keeps its own
five retries. Verdicts, authentication failures and other stapler
errors still fail at once.
2026-11-03 13:37:20 +00:00
Teknium
717447e421 fix(desktop): the bundle arch audit admits sounddevice's bundled PortAudio builds
sounddevice 0.5.6 (741357733f) ships all three Windows PortAudio DLLs
(32bit, 64bit, arm64, each with an -asio twin) inside every per-arch Windows
wheel; 0.5.5's win_amd64 wheel carried only the 64-bit pair. sounddevice.py
picks the DLL matching the interpreter (`sysconfig.get_platform()` arm64 or
`platform.architecture()`), so the foreign builds are inert, like discord.py's
paired opus DLLs. With the MakeAppx fix in place the signed Windows build got
past packaging and failed `Audit bundle architecture` on these 4 DLLs on both
win32-x64 and win32-arm64 (proof run 41414573197). Exempt exactly those names.
2026-11-02 02:02:44 -08:00
unsupportedpastels
51c8cba024 perf(docker): cache the Webapp's dependency install in its own layer
The webapp_build stage copied all of apps/ before running the recipe, so
any Desktop source change reran npm ci. build-webapp.mjs gains
`--deps-only` (prepareWebappWorkspace), and the stage runs it after
copying only the manifests and the recipe. The build after `COPY apps/`
reuses that install through the node-deps receipt.
2026-10-27 09:42:22 -04:00
unsupportedpastels
3883e02935 perf(webapp): build the browser bundle without downloading Electron
The Webapp recipe installs Desktop's workspace, and node-deps prepared
Electron's binary for any install that selects apps/desktop. The browser
bundle never runs Electron, so prepareNodeDependencies now takes
`electron: false` and build-webapp.mjs passes it. Desktop builds keep the
default.
2026-10-27 09:42:22 -04:00
Teknium
d49e2ebbae test(desktop): say the drain also keeps late-closing probes out of the live check 2026-10-26 08:09:46 -07:00
Teknium
e4bc96b813 test(desktop): the signing probe's EIO case can no longer lose its fault to the previous walk
The errors probe faults the first fs.promises.open of each case with a
one-shot flag. A walk that rejects leaves the rest of its Promise.all
running, and on a loaded runner one of the EACCES walk's lstat callbacks
lands after the follow-up walk has finished. That straggler then makes
the first open under the EIO injector, takes the read fault, and the EIO
walk resolves cleanly: "Missing expected rejection" (main run
40322485575).

Each case now counts the failed walk's opens and waits until every file
has opened and closed before the next fault is armed, so the fault can
only reach the walk under test. The same wait keeps the EIO walk's
late-closing stragglers out of the concurrent walks' live/peak check.
2026-10-26 08:09:46 -07:00
emozilla
1eb4669e8d test(webapp): check every smoke viewport in the tab the launch link signed in
The browser smoke opened a new tab for each of its four viewports and loaded the same input URL in
each. That URL is usually the one-use launch link `hermes webapp --no-open` prints, and the Webapp
keeps the grant the link buys in the sessionStorage of the tab that spent it. The first tab spent
the ticket, the second stopped at "This launch link was already used or has expired", and the smoke
failed on a Webapp that worked.

All viewports now run in one tab. The first loads the input URL; each later one resizes the tab,
leaves the previous page for about:blank and reopens the address the first one landed on, so the
tab's grant signs it in. Every viewport still gets a fresh page load and the same checks; console
errors, page errors and failed requests are counted against the load that caused them, and the HTTP
status is read for the address that load requested. The mobile browser-controls override is reset
before each load, since it now outlives its page.
2026-10-25 03:22:31 -07:00
emozilla
a3d93b428b test(webapp): fail the smoke run on the startup failure and sign-in screens
The smoke script looked only for 'Desktop boot failed', so a Webapp showing 'Hermes couldn't
start' or the sign-in view passed. It reads both titles from en_boot.ts and fails naming the
screen.
2026-10-25 03:22:20 -07:00
emozilla
f0fe081b95 test(webapp): drive the gateway-served Webapp end to end
The e2e spec starts the gateway through hermes webapp, runs a turn from a
real browser, keeps the tab signed in across a gateway restart, and checks
that sign-out cuts it off. The smoke script targets the Webapp's port.

Co-authored-by: Bear Huddleston <bear@bearhuddleston.dev>
2026-10-25 03:22:17 -07:00
Bear Huddleston
7ac4cf552c feat(desktop): carry the browser host renderer from #93508
Carried from BearHuddleston's #93508: the browser bridge and transport,
launch-session handling, touch and phone layout, browser previews, file
staging, the host terminal rail, Webapp settings pages and media ticket
renewal. Relay-only and fence-only code stays out.

Co-authored-by: emozilla <emozilla@nousresearch.com>
2026-10-25 03:22:15 -07:00
Teknium
16d2221a50 refactor(desktop): drop /browser use, Browser Use mode status and agent-browser bundle exemption
browser_exec is the only browser path: the browser.manage RPC 'use' action and
browser.backend are gone, Camofox moved to a catalog plugin and agent-browser is
no longer bundled. Toolset panel tests use still-valid provider rows.
2026-10-23 01:41:25 -07:00
ethernet
92e0717a3a perf(desktop): reuse Developer ID signatures for loose macOS payload binaries
osx-sign spends 2.1-3.3 min per mac leg running one codesign call for each of
610-836 payload binaries (run 39214394169), and only 321 of 837 arm64 names
are distinct: most Python extensions sit three times in the payload (venv,
uv wheels, uv archive). None of it is cached, unlike Windows' Authenticode
signatures (payload-sign-cache.mjs).

createMacSigner now signs loose payload Mach-O itself before osx-sign runs,
through a cache modelled on the Windows one:
- key: the unsigned bytes and file name (codesign derives the identifier
  from the name), under a policy hash of the identity, team, flags and
  inherited entitlements; the per-job keychain path is not part of it;
- codesign's embedded signature carries a secure timestamp, so the signed
  bytes are stored, and every restored file must pass codesign --verify
  --strict with this team's Developer ID, a timestamp and the hardened
  runtime before it replaces the unsigned one;
- each distinct input is signed once (bounded concurrency) and copied to
  its duplicates; files inside nested bundles and the app executable are
  left to osx-sign, which still seals every bundle and the app.

The darwin legs restore the cache before building and save it only after
the notarized-app verification passes, on release runs. The mac runners are
GitHub-hosted, so it lands in the repo's GitHub cache store; commit builds
hold a read-only cache token.

Inject the typed app-signing function into the cache integration tests instead of
mocking its module. Exercise cold and warm reuse and refuse outer sealing after
cache verification fails; preserve the production lazy import and native skips.
2026-10-20 15:50:30 -04:00
Teknium
91e27b6c09 fix(desktop-build): npm run builder -- --win --x64 can stage its per-target native deps
`npm run builder` with an arch flag stages native deps into
apps/desktop/build/native-deps-<platform>-<arch>
(scripts/run-electron-builder.mjs). The product guard in
scripts/build/frontend-common.mjs accepted only apps/desktop/build/native-deps
as a generated destination in the tree, so every source build with an
explicit arch died before staging:

  Error: Output must be outside source or in a supported generated
  destination: ...\apps\desktop\build\native-deps-win32-x64

Seen on blacksmith-32vcpu-windows-2025 packaging the Desktop for the W3
attach lane (run 39053936919, `npm run builder -- --dir --publish never
--win --x64`). The guard now also accepts exactly
native-deps-(darwin|linux|win32)-(x64|arm64) under apps/desktop/build.
A nested path below one, or another platform/arch, is still refused.

Red -> green: run-electron-builder.test.mjs "source multiarch ..." now
asserts each per-target --out it hands stage-native-deps.mjs passes
productOutput (red on main: "Output must be outside source ..." for
native-deps-darwin-x64). product-builders.test.mjs gains the accepted and
refused per-target names (10 passed).

Refs #134889 (W3)
Refs #140337
2026-10-17 11:33:15 -07:00
alt-glitch
303b70f75b chore(release): retire HERMES_GUEST_ONBOARDING from bundles, build tooling and the updater
The Microsoft Store variant forced HERMES_GUEST_ONBOARDING=1 into its bundle env,
and commit/channel builds could bake it with --bundle-env. Nothing reads it now.

- scripts/bundles/desktop_inputs.py: the Store bundle env is just the request's.
- bundle_env.py / bundle-env.mjs: the key is no longer allowed for new builds.
- channel-protocol.ts: the key moves to RETIRED_BUNDLE_ENV_KEYS, so preview
  manifests already published with it still decode (the HERMES_SKIP_INTRO
  precedent).
- BUILDING.md example uses HERMES_PREVIEW_FULL_CONNECTORS.
- Build tests use another allowed key as their sample; both validators reject the
  retired key and the decoder drops it.
- msix-virtualization.test.mjs: every generated MSIX manifest (store, release,
  canary, channel) keeps filesystem and registry write virtualisation disabled,
  and the builder config declares unvirtualizedResources. The machine marker and
  the shared %LOCALAPPDATA%\hermes root depend on that.
2026-10-14 00:32:21 +05:30
alt-glitch
528e42c51a refactor(desktop): delete the guest-onboarding launch flag; add the dev --fresh-install switch
The desktop read HERMES_GUEST_ONBOARDING (or --guest-onboarding) once, sent it
to the renderer, forced it onto every local backend spawn and prepended it to
the POSIX SSH spawn. The backend now decides everything itself, so all of that
goes: guest-onboarding.ts (the GATEWAY_ON_ALL_ADAPTERS_DOWN part moves to
backend-spawn-env.ts), the feature-flag field, preload/global.d.ts, and
lib/onboarding-enabled.ts.

Its consumers follow the onboarding run instead: the demo layout and window
sizing are always available (they only act while an onboarding run is open),
Settings shows "Run onboarding again" on every build, and the transcript always
uses the multi-directive parser. Every paragraph the legacy parser rendered (one
`::name{...}` line alone) parses to the same name, attrs and source; the new
parser also renders directives embedded in prose.

Dev switch: an unpackaged app started with --fresh-install sends
assume_fresh on onboarding.state and on a new onboarding.start, so a used
machine can rehearse a first install. Packaged builds always send false.
2026-10-14 00:32:21 +05:30
kshitijk4poor
d2cbfcf7db test(desktop): the React Compiler cache is its own module with focused tests
The cache lived inline in vite.config.ts, and the renderer builder tests use a bare fixture
config, so nothing exercised it: a broken warm path would still pass every test.

Move it to scripts/compiler-cache.mjs (behaviour unchanged; toolchain files and cache root are
now parameters, and an existing closeBundle hook is chained instead of replaced) and test hit
vs fresh output, toolchain/NODE_ENV generations, corrupt entries, pruning, incremental (watch)
rebuilds and the dev-server bypass. A cold and warm production build of the real app stay
byte-identical. Reported by Greptile on #135092.
2026-10-08 15:20:58 -07:00
kshitijk4poor
1f6d8b6ba8 fix(desktop): a node-pty layout without its macOS spawn-helper is an incomplete native tree
nativeTreeComplete decides whether a later build may skip restaging, but never looked at
node-pty. A partially extracted package with pty.node and no spawn-helper was recorded
complete; repairing the installed package without a lockfile change then left the staged
copy broken, and every later build shipped a terminal that fails on its first spawn.

Check the layout node-pty itself loads (build/Release, build/Debug, then prebuilds, as in
lib/utils.js) for a binding, and on macOS for the spawn-helper beside it (lib/unixTerminal.js).
Reported by Greptile on #135092.
2026-10-08 15:20:58 -07:00
kshitijk4poor
3fc37481eb refactor(desktop): one receipt reader, one output list, no native double copy on renderer reuse
rendererCurrent and productCurrent share hostReceipt() for the schema/product/host checks. The stamped outputs come from bundleElectronMain's own electronOutputs list, so a renamed or added bundle can never be copied stale from the previous dist. The reuse copy skips node_modules/ and native/, which copyNativeTree recopies from nativeDeps right after, and a --typecheck build never reuses a renderer that skipped tsc.
2026-10-08 15:20:58 -07:00
kshitijk4poor
136a4282bb fix(desktop): an incomplete native tree restages on every build
Skipping stage-native-deps on an admitted receipt kept a tree staged without a piece forever:
get-windows (or its win32 x64 binding, which only the native installer inside staging can fetch),
the macOS get-windows helper, or the host HUD helper (no X11 toolchain on Linux). The receipt
identity cannot see the host fix that would complete it.

The receipt now records `degraded` from the staged tree itself (nativeTreeComplete: every piece
this host can produce for the target is present), and build.mjs reuses only a complete one
(nativeInputsComplete). Gaps no host fix closes — win32-arm64 has no get-windows prebuild, a
cross-target pack never builds the helpers — do not count. Judging the tree rather than each
builder's return value covers soft-fail paths that still return a path (the win32 binding).
2026-10-08 15:20:58 -07:00
kshitijk4poor
97260490e1 perf(desktop): skip restaging native inputs whose receipt still matches 2026-10-08 15:20:58 -07:00
kshitijk4poor
1d41d9f610 fix(desktop): native helpers build byte-identical, so the prepared native input stays comparable 2026-10-08 15:20:58 -07:00
Maciej Lisiewski
d76cce4f11 ci: apply all automatic linter fixes available 2026-10-08 17:22:54 +02:00
Teknium
0240fa4a84 fix(release): read the Hermes version line in the Nix check and accept rc.N attempt refs
Two stable-release identity checks broke on the first pipeline cuts of v0.21.6:

- nix.yml "Verify release package runtime identity" took the LAST token of the
  whole `hermes --version` output. That output ends with the OpenAI SDK line, so
  the check compared 0.21.6 against 2.24.0 and failed every release. Parse the
  first line ("Hermes Agent v<version> ...") instead.
- msix-shared.mjs releaseEpoch() still required the retired `vX.Y.Z-rc` claim
  name. Attempt refs are `rc.<N>-vX.Y.Z` (versioning.parse_attempt_ref), so the
  Windows universal bundle threw "Stable claim tag differs from its payload tag".
  Accept exactly `rc.<N>-<tag>`; a different version (rc.3-v0.27.10 for v0.27.1)
  still refuses.
2026-10-08 01:58:48 -07:00
ethernet
05d5d7e537 fix(desktop): tag every line of a multi-line waiter script error
PowerShell errors span several lines (message, location, details). The
script tagged only the first physical line with the attempt, so the
parent's attempt filter kept that line and dropped the rest. Write-WaiterLog
now tags each non-empty line.
2026-10-08 00:41:22 -04:00
ethernet
ddde33122d fix(desktop): make the relaunch waiter's script log per-attempt, UTF-8 and bounded
Review follow-up to #134911, which merged before these landed.

- The script log is shared by every attempt, so a failure report could
  quote another attempt's lines. Each line now carries the stage dir
  name and waiterLogTail keeps only the current attempt's.
- Add-Content writes the Windows code page by default while the reader
  decodes UTF-8, which mangles localized errors and non-ASCII paths. The
  script now appends explicit UTF-8 without a BOM.
- waiterLogTail read the whole append-only file before slicing. It now
  reads at most the last 16KB, and the script restarts the log once it
  passes 64KB so it cannot grow without bound.
2026-10-08 00:33:33 -04:00
ethernet
bdb8f92f3b fix(desktop): log why the MSIX relaunch waiter failed to start
startRelaunchWaiter returned undefined for four different failures
(staging dir, script copy, PowerShell spawn, missed handshake), and the
detached script runs with stdio ignored. The Store updater then showed
only "Could not register automatic relaunch" and desktop.log had no
reason, so a user report could not be told apart.

Each failure path now writes its cause to desktop.log (error text,
paths, exit code or signal, elapsed ms). The script appends its own
steps and exit reason to %TEMP%\hermes-relaunch-waiter.log, which
survives the stage dir it deletes on exit, and a failed handshake
includes that file's tail in desktop.log.

The two waiter call sites shared the same options block; they now go
through one startUpdateRelaunchWaiter so the log hook cannot be
forgotten at one of them.
2026-10-08 00:22:46 -04:00
alt-glitch
65bc6727b4 feat(free-tier): send preview_full_connectors on account creation
HERMES_PREVIEW_FULL_CONNECTORS=true|false makes the free-tier mint send
{"preview_full_connectors": <bool>} in the /api/anonymous/create body, so
the account service can record the cohort on the account and gate
toolkits from it. Any other value (unset included) keeps the body {}.

The variable joins the desktop bundle-env allowlist (release script,
banner writer, channel request decoder, BUILDING.md) so a bundle can
bake it in. It is self-reported and visible in the packaged JS: the
service must treat it as a preference, not proof.
2026-10-06 18:00:58 -04:00
alt-glitch
3383a1d8b3 fix(bundle): the agent's terminal runs a working hermes inside the desktop payload
Inside a packaged desktop build, bare `hermes` in the terminal tool resolved
to <payload>/venv/Scripts/hermes.exe. That venv was built on CI, and its
Windows redirector reads pyvenv.cfg `home`, which still names the CI path,
so every call failed with "did not find executable at C:\a\hermes-agent\...".
The working launcher in <payload>/bin carries the channel name and was never
on the agent's PATH.

- activate_dependencies puts the payload's own launcher dir (from the
  manifest's runtime.commands) first on PATH, and on Windows no longer adds
  the shipped venv's Scripts dir: every redirector in it names the CI
  interpreter.
- _resolve_hermes_bin_dir answers with that launcher dir in a sealed payload,
  so terminal and cron children do not depend on PATH order.
- stageDesktopLaunchers copies the canonical launchers to their qualified
  names instead of renaming them. Only the qualified names are published.
- The "plugin already exists" hint names the real CLI command.
- Every manifest-relative path (venv, store, hermes launcher) goes through one
  resolve-and-contain check, and a manifest.json that is unreadable or not a
  payload manifest reads as "not a payload" instead of raising, since every
  install now asks.

Source and dev installs are unchanged: they have no payload manifest.
2026-10-07 01:29:02 +05:30
alt-glitch
c1418f98fc test(release): both bundle-env validators reject the retired HERMES_SKIP_INTRO (review)
Re-adding the key to an allowlist now fails tests/scripts/test_release_build_commit.py and scripts/bundle-env.test.mjs.
2026-10-07 01:00:00 +05:30