Keys typed while no composer was mounted were held per focus target, and
every chat's composer is 'main', so opening another chat from the sidebar
before the cold-start restore finished appended those keys to it. Bind the
held keys to the announced handoff's session; only the composer that adopts
that handoff takes them, and they are dropped once the handoff is abandoned.
Move the cold-start remount tests into use-composer-draft.cold-start.test.tsx
with a shared editable-composer harness (main file was over 1,000 lines).
Text typed on the fresh chat during boot follows the chat that
resume-last-session restores (b8dd611d4a, #156615). In between, the
restored chat's loading view mounts no composer. Type-to-focus
(use-keybinds) preventDefaults every printable key and dispatches it to
the 'active' composer synchronously; with no composer subscribed, the
key was simply dropped. macOS packaged Desktop lost the middle of the
prompt this way ("6-d6099024e52cHello, c").
An unclaimed type-to-focus character is now held per target while a
new-session draft handoff is pending, and the next composer to mount on
that target appends the held keys after the draft it restored. Outside a
pending handoff an unclaimed key stays dropped, so stray typing is never
replayed into a later composer. Subscribers mark the request claimed.
0.23.2 release blocker: install-e2e macos desktop-installer@latest ->
open-app-update (v2026.8.13 -> HEAD) and linux installer-script+desktop.
The cold-start resume remounts the composer and b8dd611d4a (#156615)
carries the boot-time draft onto it. The new editor is painted in the
hook's layout effect before FloatingComposerSurface (the parent)
attaches its portal host, so placeCaretEnd skips the detached node and
the later focus() collapses Chromium's caret to offset 0: keys typed
after the remount land BEFORE the carried text.
Pins the hook-level path: a remount through a parent-attached portal
host with an announced pre-session draft must leave the caret at the
draft's end. Red on main (offset 0), green with the focus fix.
0.23.2 release blocker: install-e2e linux installer-script+desktop
(v2026.8.13 -> HEAD), "The composer must hold the typed prompt before
Enter", Received "r me? Desktop smoke new <uuid>Hello, can y".
A composer that remounts mid-turn paints its draft in a child layout effect,
before FloatingComposerSurface attaches the portal host, so placeCaretEnd bails
on the detached editor. focusComposerInput then focused a contenteditable with
no selection inside it and Chromium collapsed the caret to offset 0, so the next
keystrokes landed before the draft.
focusComposerInput now reads the selection before focusing and, when the
editor held no caret, places it at the end. An existing caret is left alone.
Fixes#140142
If the s6 gateway failed to start after the restore, the import only printed a warning, the
action status reported success and Desktop showed "Transferred" while the agent's bots and
scheduled jobs were not running. The import now prints a GATEWAY_DOWN_LINE the action status
reads into `gateway_down`, and the Desktop done screen says the files arrived but the agent did
not start again and needs a restart (one new string, settings.backup.gatewayDown).
Messaging is its own page (sidebar, command palette), not a Settings tab, so a user who opened
Settings looking for it would not find it. Every line this PR adds now names the Messaging page:
the confirm and done screens, the user guide, the CLI reference, the import's printed hint.
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
A bot token answers to one running Hermes at a time. The transfer now
brings Telegram, Discord, Slack and every other messaging bot over with
its token and settings but switched off, so the computer it came from
keeps answering until the user switches each bot over by hand.
`hermes import --keep-host --messaging-off` (the Desktop transfer route
always passes it; the undo never does): in the root home and in each
profile the archive carries, every bot the archive would run (an
`enabled: true` block, or a token in that home's .env with no `enabled`
set) gets `platforms.<id>.enabled: false`, the switch Settings >
Messaging writes, inside the same merged config.yaml the keep-host
restore publishes. The explicit false sets the gateway's
_enabled_explicit marker, so the env token cannot re-enable it, and
turning the switch on in Settings > Messaging is the only step needed.
The import prints `Messaging switched off: <names>`, the action status
returns them as `messaging_off`, and the Desktop done screen names them.
The confirm note says the bots come over switched off.
The confirm screen said to stop the local bots, which reads as "before".
Someone talking to Hermes through Telegram would then cut themselves off
before the cloud agent is ready. The confirm note, the done screen and
the docs now say: keep using them here until the transfer is done, then
turn them off in Settings → Messaging.
Found in the live Desktop run (forced: memories/ read-only on the stand-in):
the error screen showed the import log's last three lines, an unrelated Docker
gateway hint and "see Warnings above", which the UI does not have. It now
shows the import's own Warnings list (the files it could not restore), and
falls back to the last lines for any other failure.
- Transfer streams: each 8 MiB base64 chunk read off the source is posted to
the cloud agent's /api/ops/transfer/chunk as it is (retry with backoff,
offset_gap re-sync), then /transfer/restore. Peak memory is one chunk; no
multipart, so a first native Cloud sign-in (cookie session only) uploads
over the same JSON path every other call uses.
- A cloud agent without `import_keep_host` in /api/status gets "This cloud
agent needs a Hermes update before it can receive a transfer." before
anything is read or uploaded (BearHuddleston's finding and test idea).
- The undo point reaches the UI from the import's status as soon as it
exists, also on failure; the error screen offers Undo next to Retry, and
Undo always restores the FIRST undo point of that agent (a retry never
replaces it). An import that finished without one is an error.
- Cancel is offered while backing up and copying only; once the restore is
requested it is gone (it cannot be stopped).
- One backup implementation: hermes-cloud-agents `backup()` reuses runBackup;
the save downloads /api/ops/backup/download from the backend that wrote the
archive (never /api/fs/download, which an SSH backend serves remotely).
- Webapp: sign-in reuses the connection the saved-connection OAuth created
(no duplicate save); "Sign in" sends a signed-out Webapp to Settings >
Providers; the remote-browser paste field is mounted in the transfer card.
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
A built-in Settings section (`/settings?tab=backup`, right after Sessions) that acts on the
profile Settings is editing on the active connection:
- Back up: `hermes backup` on the owner, then the native save of the archive.
- Transfer to Hermes Cloud (hidden on a Webapp Hermes Cloud serves, where the section is
"Backup"): Nous sign-in, team picker, agent list (+ a New cloud agent row that opens the
portal until hermes-portal#2160), a confirm panel listing what is replaced and what the cloud
agent keeps, then backup → read in 8 MiB chunks → one multipart upload to
`/api/ops/import-upload?keep_host=true` → poll the cloud agent's restore. Undo restores its
own pre-import backup; Undone offers Start again.
`lib/agent-transfer.ts` is the pure client over an injected request; `lib/hermes-cloud-agents.ts`
holds the cloud helpers over `window.hermesDesktop.cloud`/`connections`; the Webapp's cloud
bridge (`lib/browser-cloud.ts`) discovers through `GET /api/cloud/agents`. The portal's
`hermes://open/move-to-cloud?agent=X` lands on `/settings?tab=backup&cloudAgent=X`, which
highlights that agent. ⌘K: "Back up this agent" and "Transfer to Hermes Cloud", one each.
Co-authored-by: SHL0MS <SHL0MS@users.noreply.github.com>
`fetchJsonForBackend` refused every upload to an OAuth-gated backend, but its bearer leg is
`fetchJson`, which already builds multipart. Hand it the upload and refuse only on the cookie
fallback (electron.net with JSON headers), so a Hermes Cloud connection can take a file.
Review on #156611 (Greptile P1 x2):
- The covered tail was kept as RENDERED text, while late deltas carry the
raw `MEDIA:` tag, so the tag never matched and the attachment was drawn a
second time. The covered tail is now taken from the raw text
(`mediaSource`), and hydrated reply parts keep their raw text in
`mediaSource` as streamed parts already do.
- consumeStoredTail assumed no gaps: with ' dr' lost to the reconnect, 'op'
at offset 18 was appended whole ('A8 survives the dropop'). storedTail now
records the segment offset the adopted body reaches; stamped deltas carry
their admitted offset through the flush queue (only contiguous chunks
coalesce), and a chunk inside the adopted range is dropped, so only text
past it is drawn. Unstamped deltas keep the text match.
After a reconnect the live row takes the stored reply's body, but the
stream's tail is still queued or on the wire past the segment cursor, so
those deltas appended the body's tail a second time ('A8 survives the drop
drop'). Only message.complete repaired it, and that completion can be lost to
the same reconnect. The adopted tail part now records the stored text it shows
ahead of the stream (storedTail), and appendAssistantTextPart drops the deltas
that repeat it, applying only what extends past it. This covers both queued
deltas and in-flight ones, which a cursor advance alone would not.
The stored body is adopted only when it continues the live text between two
words: a cut inside a word ('A8' against 'A8x unrelated reply') is where an
unrelated reply sharing a short prefix looks like this one. Such a row keeps
its own bubble until its completion, as before.
After a socket drop the re-resume reads the newest transcript page over
REST while the turn's tail and its message.complete are still on the wire.
When the page already holds the stored reply and the live stream row is
still short of it, overlayConcurrentMessageChanges kept BOTH: the committed
bubble with the whole reply and the pending stream row with its first
words, so the reply drew twice until the completion retired the live row.
Release CI caught it in transcript-integrity's "ws drop + reconnect" step
(17-assistant and assistant-stream-* both holding A8).
The keep-both rule came from d8ddf3fb14: a live row short of the stored
text may never get its tail (a completion lost to the reconnect), so
replacing the committed bubble with it would strand the reply on its first
chunk. The live row now takes the committed bubble's place AND its stored
body: one bubble, the whole reply, and the live id that the turn's late
deltas and completion still settle in place.
Text typed on the fresh chat while the app boots must follow the chat that
resume-last-session restores (a4b48064b1, #114122). The handoff only ran
when one composer instance saw its scope flip from the fresh key to the
restored id. The restored session's loading view mounts no composer, so the
fresh chat's composer unmounts and a new one mounts already scoped to the
restored id: its first run never saw a fresh scope, never consumed the
announcement, and the typed text vanished from the composer.
The swap effect's first run now also adopts the fresh draft when the
pending announcement names its own key; a first mount on any other session
leaves the announcement for the restored chat's composer.
0.23.2 release blocker: install-e2e linux installer-script+desktop
(v2026.8.13 -> HEAD), "The composer must hold the typed prompt before
Enter", Received "".
The /api/audio/stt-lease route kept a process-global set of lease names
(acquire_stt_lease, release_stt_lease, stt_lease_holders,
_reset_stt_leases_for_tests). Release never unloads anything by design, so
the set's only output was the holder count echoed as `leases` in the
response. No client reads it: the desktop typed the field in
AudioSttLeaseResponse and syncSttLease awaits the call as a readiness
barrier, ignoring the body (rg `leases` under apps/, web/, ui-tui/ hits
only that type). The set was also shared by every profile in the process.
The route now calls warm_stt_provider() under the profile scope when
`active` is true and returns the same envelope without `leases`; release
is acknowledged and does nothing. The request model is unchanged, so
older desktops still send a valid body. The TS response type drops the
unread field in the same commit.
utils.py held three subjects in one 871-line file. It is now a package with
one module per subject: utils/files.py (atomic writes, temp files, file mode
and owner, signatures and digests, JSON and YAML file helpers), utils/urls.py
(the base_url helpers) and utils/env.py (truthy values, env numbers, proxy
env helpers). utils/__init__.py re-exports every public name, so no importer
changes. Function bodies are unchanged, no function-level import moved, and
the logger keeps the name "utils".
Tests patch a name in the module that now defines it. Patches stay on the
package where production reads the name through a function-level
"from utils import". The tests of utils itself move to tests/utils/.
A root module that becomes a folder drops out of anything that copies root
*.py files plus a fixed list of packages, so the fixtures that build a partial
source tree now list utils, as do pyproject's packages.find, three check
scripts and the CI change classifier.
A comment line at column 0 inside the desktop: block ended the scan, so
a timeout key below it was silently ignored and kept 15s. Comments do not
close a YAML mapping; only the next real top-level key does.
The code-health check caps main.ts, config_defaults.py and
readDesktopLaunchConfig at their size and complexity on main.
The two keys are now read by desktop-ssh-budgets.ts, which main.ts calls
once with the config.yaml text it already has. The Windows env slice for
the ssh resolver moves into ssh-binary.ts so main.ts does not grow. The
launch-config reader and config_defaults.py are back to what they were.
Refs #132508
Moves the override from two HERMES_* environment variables to
desktop.ssh_connect_timeout and desktop.ssh_forward_timeout, in whole
seconds up to 120. These are non-secret behavior settings, so they belong
in config.yaml. They are read once before the first window, the same way
desktop.ssh_path is, and passed to every SSH connection the app opens.
The value is validated in full. Only a positive whole number counts.
Values like "45s" or "1.5" are ignored with a startup warning and the
15 second default is kept, instead of being read as a numeric prefix.
Refs #132508
The two 15s budgets in ssh-connection.ts were hardcoded with no override,
and the connect budget reaches ssh as -o ConnectTimeout on the command
line, so the user's SSH config cannot raise it either — on lossy links
(in-flight Wi-Fi, congested hotspots) every attempt failed with
'kind=timeout ... timed out after 15000ms' and the Desktop looped on boot
failure (#132508: 137 of 155 attempts in a two-hour window).
Resolve both from HERMES_SSH_CONNECT_TIMEOUT_MS and
HERMES_SSH_FORWARD_TIMEOUT_MS following the resolveProbeTimeoutMs pattern
in backend-probes.ts: unset/invalid keeps 15s, values clamp at 120s, and
an explicit constructor option still wins.
A fallback out of credits keeps its own top-up card while the reply leads with the primary's sign-in, as on main; the billing case now sits beside the rate-limit and overflow cases, and fails if billing is routed to the primary's card. The sign-in step test that asserted Tailwind class names guarded the markup, not the layout (jsdom cannot measure it); the remaining test covers the selectable command and the rendered actions.
Reported-by: alt-glitch
A fallback that hit a rate limit or an oversized request keeps its own card (Retry, reset time, compress); the primary's sign-in card applies when the fallback was refused for auth too. The sign-in command's $ prompt stays unselectable, so a manual copy gets a runnable command.
The sign-in step is a grid item, so a one-line command set its minimum width and pushed the rest of the command, Copy, Cancel and "I've signed in" past the card's clipped edge; widening the window changed nothing. The step now shrinks to the card, the command wraps inside its box, and the text opts back into selection.
The paging suite owns its fake server and setup, so it stands alone in
transcript-backfill.paging.test.ts. transcript-backfill.test.ts returns
to its size on main. No test changes: the suite body moves byte for
byte, and the same 54 tests run.
Reporting `windowed: false` at the store head also dropped the anchor, so `advanceSessionTranscriptWindow` deleted the session's memo and the next store flush recut the window from scratch, trimming the top message off screen. The anchor and memo now stay; only `windowed` changes, and retention already ignores the anchor when the window is not windowed.
A background refresh records its newest page as the transcript tail, which puts the "Show earlier" offset back at the first page while the user is paging back. Each later click then fetched a page the store already held, the merge added nothing, and in a large chat the walk stalled short of the start with the button still offered.
The backfill now reads past a fetched page that adds no rows to the store, up to eight such pages per click, so a click adds older rows or retires the button. It also stops when a page repeats the one before or the store is empty, and a refresh that replaces the tail mid-walk restarts the walk from that tail, at most twice. The caller passes the transcript it holds and reports whether the merge grew it; without that, one page is read and applied as before. The offset itself is left as the refresh records it: counting from the newest row, it stays correct after /undo shortens the transcript, after a released transcript reopens on its newest page, and after compaction rewrites the row ids, where keeping a deeper offset across the refresh skips rows.
Walks "Show earlier" over a fake backend that pages like `order: 'latest'`, through the real graft, merge and backfill. On main, a refresh between clicks puts paging back at the newest page: the first click after it adds nothing, a refresh between every click never reaches the first row, a refresh during a click drops that click, and a refresh that re-arms a fully loaded chat leaves the button armed. The same walk after /undo, after a released transcript reopens, after compaction rewrites the row ids, and through held pages of tool turns must still reach every row, and one click stays bounded on a backend that ignores the offset, alternates held pages, or renumbers rows, and reads one page when the store is empty.
`advanceTranscriptWindow` returned `windowed: prev.anchorId !== null` when the sticky cut sat at `start === 0`, i.e. when the window was the whole store, the opposite of the invariant documented on `TranscriptWindow`. That kept `olderAvailable` true while gating off the REST backfill branch (`expandWindow` runs it only when `!windowed`), so "Show earlier" stayed armed with only `setWindowPages(+1)` left to do, which changes nothing when the window already covers the store. Report `windowed: false` and drop the stale anchor instead.
Carved out of #133657 (the window half of its first and third commits).
Keeping the paste inline skipped the size guard a local chat gets from
savePastedText, so a paste over 64 MiB went into the editor. The inline
path now honours the same byte cap. Above it the paste gets the same
error toast and is dropped.
Passing the selected chat from ContribWiring pushed that function past
its code-health cap. The composer actions hook now reads the selected
chat itself when no stored chat is passed, which is what the main
composer does. A composer that passes null, a tile with no stored chat,
does not borrow the selected one.
A Bot Mode sidebar read sent recents_profile=<bot> while the request
profile stayed ambient, so Electron added ?profile=<ambient> and the
gateway grant check refused the pair (403 profile_scope_mismatch): the
bot's recents and cron sessions never loaded. Single-profile list reads
now carry the named profile as the request scope.
Cron jobs return to the ambient profile: Run now, Manage and the jobs
overlay all write $cronJobs for $profileScope, so a bot-scoped list
was replaced by their next refresh.
Review follow-ups on the #126732 Bot Mode sidebar scope:
- The sidebar re-scopes to a selected bot only when the bot's route is on
the connection the window's list/search reads ride; a bot on another
source no longer paints this source's rows under its name. The watcher
also refreshes when the window's connection moves.
- A not_scoped bot routes at the active source (host.state.connectionId),
never a guessed `local`, so the "+" on a remote window starts the chat
on the bot's gateway. Unknown active source stays blocked.
- Server-side search uses the same scope as the list.
- A messaging/cron row's persisted unread flag paints its dot.
- The tile pre-fetch gate reads listed slices only; a parked hidden row
(owner stub) never refreshes, so it froze open bot tiles.
botModeFetchScope, the fetch-profile ladder its callers repeated, the
Bot Mode switch watcher and the sidebar display-scope hook move to
app/session/hooks/bot-mode-fetch-scope.ts. Keeps the touched hooks and
facades inside their code-health caps; no behaviour change.
The sort-imports and unused-imports eslint rules are part of check:lint
and the PR's changed files failed them (workspace-scope import order, six
leftover $atoms/setters after the ownerLookupSessionRows rewrite). Fixed
mechanically with eslint --fix; no behaviour change.
Co-authored-by: Jerry Liu <953639086@qq.com>
Bot Mode opened the canonical Bot Chat (by name, never recency) while the
Sessions sidebar fetched/filtered the ambient gateway scope instead of the
selected bot's profile, so a bot's Telegram DM-topic threads (messaging
slice only, one row per thread) had no door. Every recents-only session
lookup missed messaging rows entirely, leaving even a visible Telegram row
with no working open/rename/delete.
Scope the sidebar fetch + display to the selected bot's workspace route
(logical profile for override-aware fetch, backend target for row
matching); All-profiles keeps fanning out; blocked/empty targets fall back
to ambient. Publish a route for local bots (not just scoped remotes) so
the sidebar and the '+' target resolve the bot's own profile. Resolve all
recents-only owner lookups across every slice via the shared owner index.
Preserves gateway origin scoping (profile-scoped Desktop fetch, no
cross-profile enumeration), DM-topic lane isolation (threads stay distinct
rows), and the hidden-flag contract (plumbing hidden, gateway threads
visible).
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
Review findings on #155654:
- 'Chats get the wrong owner': rows are tagged, and registry totals deduped, by the backend the
aggregate was actually read from (aggregateBackend: the app-global remote in mixed mode).
- 'Readiness drops saved proxy headers': readiness goes through waitForRemoteHermes with the full
resolved connection (headers, cloud cascade), the path every other remote boot uses.
- 'Offline server blocks healthy chats': the global contribution has a 10s read budget and settles
as a named error next to the healthy profiles' rows; the dial keeps running for a later refresh.
main.ts is ratcheted on file length. The global-remote dial/cache, its
request router and the aggregate fetch options now live in
electron/global-remote-session-route.ts; probeRemoteAuthMode moves there
too (fetchPublicJson injected) so main.ts ends net shorter than main.
Tests now drive fetchPrimaryProfileSessions' options shape for both the
plain and the merge-prefix read.
A paste past the large-paste threshold becomes a text attachment. The
gateway refuses file.attach for a session that is not a local one, so in
a Telegram, Discord or other messaging-platform chat that attachment
could never be sent and the turn failed with permission_denied. The same
text typed as a message went through.
The composer actions hook now knows which stored chat it sends to. When
that chat is listed as a messaging-platform session, the paste is not
written to a file and falls back to the existing inline insertion.
Every other chat still gets the attachment.
Two more ownership gaps in the creation notices:
- The Configure model owner was the connection active at Create, so a
draft created on one gateway and submitted after a switch pinned the
action to the other gateway. The flight now records the connection it
created the draft on, and the action uses that.
- The warning guard compared only the profile name, so a same-named
replacement draft (Create on changed during readiness, then
Capabilities reopened) let the discarded draft's warnings through. The
flight's record (owner and warnings) is now compared by identity.
Drop the rename-away-and-back case, which only pins main's draft reuse
and involves no warnings, and share the store-notice cleanup between the
harness and the warning suite.
Two gaps in the persistent creation notices:
- After a gateway switch, a roster that does not list the bot's
connection made Configure model fall back to main's unscoped row, which
routes to the gateway switched to and can open a same-named bot there.
The fallback is now pinned to the creating connection unless that
connection is still the active one.
- A Create on change while the readiness probe runs discards the bot,
but its creation warnings were still published. They are now published
only while the draft is still the recorded one.
The New Agent dialog had been rewritten around a draft lease to carry
creation warnings. Review found two regressions in that rewrite: a
rename away and back while a create was in flight could send a second
profiles.create for a profile that already existed, and the Configure
model fallback row missed the appearance saved under the bare name.
Go back to main's draft code and add only what the warnings need:
- the in-flight create records the warnings with the draft it records;
every discard, the reset after a create and the dialog unmounting drop
them, and Create publishes them once as a persistent notice naming the
profile and machine;
- the needs-model notice is persistent, and Configure model opens the
bot's live roster row on the connection it was created on, else
main's row.
Tests drop the cases for behaviour this removes (replacing an in-flight
create, waiting for its configure step, disabling the name and target
controls while Create finishes) and the unused OAuth mock and
StrictMode option.