Commit Graph

2895 Commits

Author SHA1 Message Date
Teknium 34271eb069 feat(desktop): make the multi-gateway Connections registry discoverable
The multi-connection registry (Settings -> Connections) shipped with no
entry point outside the settings nav, and the product-owner report was
blunt: 'I didn't see any obvious way to hook up multiple gateways.'

- Profile rail: a plug pill pinned beside Manage ('Connect another
  Hermes gateway...') deep-links to /settings?tab=connections. Always
  visible, including for single-profile first-run users.
- Command palette: Settings -> Connections is now a searchable entry
  (keywords: add gateway, remote, ssh, cloud, instances, registry).
- i18n: profiles.connectGateway added to en/types/zh; other locales
  fall back through defineLocale.
- Tests: profile-rail-connect.test.tsx covers the deep link and the
  single-profile visibility guarantee.
2026-08-16 02:44:21 -07:00
David Dudok de Wit 58a9062f60 fix(desktop): resolve sessions from sidebar caches
Consult messaging and cron caches before the by-id fallback so opening a sidebar row neither depends on a redundant network lookup nor duplicates it into regular recents.

Co-authored-by: protas-box <protas.box@icloud.com>
2026-08-16 02:44:08 -07:00
David Dudok de Wit 4e4d37f6bf fix(desktop): harden profile-scoped refreshes 2026-08-16 02:44:08 -07:00
David Dudok de Wit 4f670a3f95 fix(desktop): reject stale profile refreshes 2026-08-16 02:44:08 -07:00
David Dudok de Wit 8477a5a83d docs(desktop): document profile scope helpers
Add JSDoc to the exported helpers introduced by the profile-scoped sidebar change.
2026-08-16 02:44:08 -07:00
David Dudok de Wit a0f22234bc fix(desktop): ignore stale messaging page responses
Sequence per-profile platform pagination so an older overlapping response cannot replace a newer, larger page.
2026-08-16 02:44:08 -07:00
David Dudok de Wit 1f24b3ed2e fix(desktop): retain messaging totals per profile
Key resolved platform totals by Desktop profile and source so profile switches neither inherit another profile's count nor discard a count that was already resolved. Keep the full reset for connection configuration changes.

Co-authored-by: frendo <frendo.wu@gmail.com>
2026-08-16 02:44:08 -07:00
David Dudok de Wit e264b48394 fix(desktop): scope messaging to active remote profile
Complete the sidebar profile-scope contract across remote Electron routing, older-backend fallbacks, standalone messaging refreshes, and pagination. Reject stale profile responses and keep the explicit all-profiles view unified.

Co-authored-by: 墨綠BG <s5460703@gmail.com>

Co-authored-by: liuhao1024 <sunsky.lau@gmail.com>
2026-08-16 02:44:08 -07:00
hermes-seaeye[bot] 0a3e61cf07 fmt(js): npm run fix on merge (#87607)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-08-16 09:43:56 +00:00
Teknium 1c3fbd21ae feat(desktop): background MCP health checks with re-auth nudges
MCP server problems (expired OAuth tokens especially) were only
discovered when the user visited the MCP page and a probe ran. Now a
renderer-side background checker (store/mcp-health.ts) sweeps the
active profile's enabled HTTP/SSE MCP servers on gateway connect and
every 30 minutes, and fires an in-app notification with a "Sign in"
action ("<name> MCP needs re-authentication") that navigates to the
MCP page with ?server=<name> so useDeepLinkHighlight focuses the
server and its Authenticate button. Navigation only — OAuth flows are
never auto-launched.

stdio servers are deliberately excluded: probing a stdio server SPAWNS
a local process, so a background timer must never touch them. Only
url-shaped servers (where OAuth expiry lives) are swept, sequentially.

The tab's probeCache/serverFingerprint/probeKey/NEEDS_AUTH_RE moved to
a shared lib/mcp-probe-cache.ts (behavior identical) so the page and
the checker share one probe cache and its 5-minute TTL — neither
surface re-probes what the other just learned.

Notifications fire only on a TRANSITION into needs-auth/error (pure
state machine, unit-tested), hard-capped at one per server per app
session, keyed per profile. Profile switches drop pending timers and
re-arm for the new profile; sweeps never run while the gateway is
disconnected. No new config knobs. i18n keys added across
en/zh/zh-hant/ja/ar + types.
2026-08-16 02:36:54 -07:00
hermes-seaeye[bot] 5d33efd990 fmt(js): npm run fix on merge (#87599)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-08-16 09:32:26 +00:00
Teknium 56eafcff3c feat(desktop): hermes:// deep link to install MCP servers with explicit confirmation
Adds hermes://mcp/install?name=NAME&config=B64 (base64url or standard
base64 JSON), mirroring Cursor's mcp/install deep link, so vendors and
docs can offer an "Add to Hermes" button.

- Electron: the existing generic hermes:// handler already forwards
  {kind, name, params}; only its comment is updated (no new handler).
- Renderer: use-desktop-integrations routes kind=mcp/name=install into
  a pending-install store; a new confirmation dialog shows the server
  name and the FULL pretty-printed config (attacker-controllable input),
  with a prominent caution for stdio command entries. Nothing is written
  until the user confirms; existing names require a rename or cancel.
  On confirm the server is merged over a fresh fetch of the current map
  via saveMcpServers, then navigation lands on /skills?tab=mcp&server=…
  so useDeepLinkHighlight focuses the new row.
- Validation: name ^[A-Za-z0-9._-]{1,64}$; config must decode to an
  object with a string http(s) `url` or a string `command` (never both);
  payloads over 32KB rejected; failures surface as a toast.
- Pure parser in src/lib/mcp-deeplink.ts with unit tests (url shape,
  command shape, bad base64, non-object, javascript: URL, oversized).
- i18n keys in types + en/zh/zh-hant/ja/ar.
- Docs: "Add to Hermes link" section in the MCP config reference.
2026-08-16 02:25:14 -07:00
rainbowgits 3e0bf6dcaa fix(desktop): hoist GatewayMock type into #82462 edit recovery suite
CI typecheck failed because GatewayMock lived only in the previous describe.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-16 02:24:40 -07:00
rainbowgits e14b095f20 fix(tui): map lineage edit ordinals past compression prefix
Desktop/TUI count full displayed lineage after compression, but
prompt.submit validated truncate ordinals against tip-only history.
Translate via display_history_prefix and recover stale 4018s on Desktop.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-16 02:24:40 -07:00
Teknium e22fa90769 feat(desktop): MCP fleet cost/usage overlay with schema token estimates and 30-day usage
Each configured server row on the MCP Capabilities page now shows what it
costs and whether it earns its keep:

- ~per-call token estimate of the server's tool schemas, summed over ENABLED
  tools only (ceil(schema_chars/4) via the existing include/exclude filter)
- 30-day usage count from getUsageAnalytics(30), cached per scope profile
  like the Toolsets tab's toolCallsCache, mapped to servers via the
  mcp__<server>__<tool> registry-name convention (tools/mcp_tool.py)
- a subtle muted "unused" pill on enabled, probed-ok servers with nonzero
  schema cost and zero 30-day uses — never a dialog

Backend: the /api/mcp/servers/{name}/test probe now fills an additive
per-tool `schema_chars` (length of the SAME converted registry schema the
agent registers). Older backends omit it → renderer shows counts only;
older renderers ignore the extra key. Display-only: nothing changes what
schemas are sent to models, no config knobs.

i18n keys (costTokens/usage30d/unusedPill) added to types/en/zh/zh-hant/ja
(ar inherits en via defineLocale overrides). Pure math lives in
lib/mcp-cost.ts with unit tests; Python wire shape pinned in
tests/hermes_cli/test_web_server_profile_unification.py.
2026-08-16 02:24:32 -07:00
Teknium 577093def2 perf(desktop): hydrate transcripts with a small tail page + on-demand older-page backfill
Replace the fixed 500-message REST hydration (getLatestSessionMessages)
with a 120-row newest-first tail page. When the page comes back full, a
new per-session tail store records "possibly truncated + next offset";
"Show earlier" — once the DOM budget and the in-memory store window are
both exhausted — fetches the next older page via the new
getOlderSessionMessages helper (order latest + offset, matching the
backend's back-from-newest paging semantics) and prepends it to the
session store, deduped by durable row id and race-guarded against
session switches. Legacy backends without pagination metadata fall back
to the one-shot full transcript and retire the action.

Tail-page refreshes (background sync, post-turn rehydrate, re-activate,
cold-resume prefetch) graft the refreshed tail onto any backfilled
prefix instead of clobbering it, preserving reference identity on
no-ops. includeCompacted stays on every read — compaction-archived rows
remain part of the durable display history.
2026-08-16 02:24:25 -07:00
Teknium c6db20726a fix(desktop): give Windows start-marker PowerShell probe a 30s budget
PowerShell 5.1 cold starts take 2.4-8s on affected Windows hosts, so the
shared 3s execText timeout hard-failed the parent start-marker probe for
any PID that still needs the PowerShell path (e.g. backend children).
Make execText's timeout overridable and raise the marker probe to 30s.

Fixes #87169
2026-08-16 02:14:35 -07:00
yu-xin-c c3d74603aa fix(desktop): avoid PowerShell parent marker boot gate 2026-08-16 02:14:35 -07:00
Teknium 8033389662 fix(desktop): match custom provider aliases in model catalog menu
Fixes #87035
2026-08-16 02:08:53 -07:00
Teknium eb2dceb4d4 fix(desktop): show failed status for timed-out subagents in fallback stream path
Fixes #87200
2026-08-16 02:08:04 -07:00
Junhao Wang 53daff0644 fix(desktop): don't cancel the running turn on Esc while an overlay is open
The composer's global Esc-to-cancel listener (useComposerEscCancel) fires
whenever the turn is busy and the active composer matches — but overlays
(Settings, Command Center, agents, cron, …) cover the chat while the
composer stays mounted and 'active' beneath them, so pressing Esc on any
of those pages interrupted the session the user wasn't even looking at.
OverlayView's own escape-layer Esc-to-close fired too, but the stream was
already dead.

Stand Esc down with composerFocusBlockedBySurface() — the same signal the
type-to-focus path uses (BLOCKING_OVERLAY includes OverlayView's
[data-overlay-surface] marker). Esc on an overlay now closes the overlay
via its escape layer instead of canceling the stream beneath it.

Fixes #82618
2026-08-16 02:03:49 -07:00
Ryan Hart c32dd7580a fix(desktop): identify unsafe update blockers 2026-08-16 02:03:22 -07:00
Ryan Hart 7af27c65ab fix(desktop): close safe preview blockers before update 2026-08-16 02:03:22 -07:00
YappLeCunt a7b25b3c00 fix(desktop): never reap a backend whose parent Electron is alive
reapOrphans() treats any recorded backend with a matching process identity
as orphan-reapable — including a backend owned by another live instance. The
ownership file is shared across instances, so a second launch that reaches
reap (even without the lock) SIGTERMs the running instance's backend.

Claims now record the spawning Electron (parentPid + parentStartMarker, the
same values already passed to the backend as HERMES_PARENT_PID /
HERMES_PARENT_START_MARKER), and reapOrphans() skips any entry whose parent
is still running. Even a second instance that wins a stale lock can never
kill a live instance's backend. Legacy entries without parent data keep the
old behaviour.

Known tradeoff: a parent-liveness probe failure preserves the record, so a
genuinely orphaned backend under a still-running parent is leaked until it
dies naturally. That is preferable to killing a live instance's backend.

Tests: parent-aware reap in backend-ownership.test.ts (live parent
preserved, dead parent still reaped, probe failure preserved, parent
identity round-trips through claim/parse).
2026-08-16 01:57:34 -07:00
YappLeCunt df89995674 fix(desktop): keep startHermes inert without the single-instance lock
startHermes() is the only entry point that can reap, spawn, claim, and
therefore destroy a backend. Belt-and-suspenders on the exact killing line:
even if some future path reaches it in a lock-losing process (a refactor, a
dev harness, a race), the instance stays inert — no reap, no spawn, no
claim — instead of SIGTERMing the running instance's backend (#87295).
2026-08-16 01:57:34 -07:00
YappLeCunt 7cc006a2ef fix(desktop): hard-exit a lock-losing second instance before ready
app.quit() does not stop a lock-losing instance from reaching whenReady:
the before-quit teardown coordinator defers the quit (event.preventDefault
+ async backend shutdown), and ready fires in that window. The losing
instance then runs the full startup whose reapOrphans() SIGTERMs the
running instance's live backend (#87295).

The lock-loser holds no state and no backend — requestSingleInstanceLock()
has already delivered the argv to the primary by the time it returns false —
so there is nothing to clean up. app.exit(0) terminates immediately, before
ready, so a second launch routes into the running window and never touches
backend machinery.
2026-08-16 01:57:34 -07:00
fangliquanflq a6f405314f fix(agent): cover provider wait teardown paths 2026-08-16 01:55:00 -07:00
fangliquanflq 0fd059e745 fix(agent): preserve stalled-provider escalation 2026-08-16 01:55:00 -07:00
David Metcalfe ca50ff332f fix(desktop): reject bare modifier combos in the input gate
Review NIT: a malformed stored binding of just 'mod'/'ctrl' (never
produced by comboFromEvent) could pass the shape-only mod/ctrl check.
Reject bare-modifier bases in actionAllowedInInput and pin it in the
suite.
2026-08-16 01:52:51 -07:00
David Metcalfe a11fb1cd89 fix(desktop): restore mod-chord keybinds while typing in inputs
#86586 replaced the combo-based input gate (any Cmd/Ctrl chord fires
while typing) with an action allowlist that dropped session.new and
every other mod-chord not explicitly listed. ⌘N/⌘T/⌘⇧N and friends
became dead keys whenever focus was in the composer.

Restore the pre-regression rule: primary-modifier chords stay global
even in text fields; the allowlist now gates only bare/Shift/Alt combos,
so rebound letter keys can never hijack typing. Text-navigation chords
(Ctrl+Arrow/PgUp/PgDn) still stay with the input.
2026-08-16 01:52:51 -07:00
Teknium a15de34545 feat(desktop-sdk): host.deleteProfile — teardown-routed profile delete for plugins
Plugins deleting profiles via `cli.exec ['profile','delete',…]` bypass the
Electron-side DELETE /api/profiles interception (prepareProfileDeleteRequest),
so a live pool backend — e.g. one the roster's hover pre-warm just woke —
holds the profile dir open and the renderer's reconnect respawns it
mid-delete, recreating the directory (#52279). Bot Mode's right-click Delete
hits this every time because right-click hovers the row first.

Add host.deleteProfile(name) to the plugin SDK: routes through the same
teardown-routed REST path core's DeleteProfileDialog uses (backend teardown
first, next request routed away), rejects on 'default', and re-homes the app
to the default profile when the deleted profile was the live gateway's —
mirroring the core dialog's ordering.

Reported by @BkashJosi (Bot Mode: deleting a bot errors while its session
is awake).
2026-08-16 01:28:47 -07:00
embwl0x 7a1b2cd0d1 test(desktop): preserve bounded deferred resume 2026-08-16 01:28:26 -07:00
embwl0x 60be8ef26d perf(desktop): make session resume incremental 2026-08-16 01:28:26 -07:00
Teknium 37445d6dc2 feat(desktop): unify MCP Servers and Catalog into one coherent list
The MCP tab's left column previously split the configured fleet and the
Nous-approved catalog behind a Servers/Catalog tab toggle. Installed
entries appeared in both views and the install button lived a tab flip
away from the list it fed.

Now one scrolling column: configured servers (live status, toggles,
probes) on top, a Catalog section below offering only entries not yet
installed. Installing moves the entry up into the fleet list; the
zero-servers empty state keeps the catalog visible beneath it instead
of hiding it behind a full-page invitation.

Bot Mode's Advanced view embeds this same McpTab via the plugin SDK, so
the unification mirrors there automatically.

- removed leftView state + TextTab toggle; section headers reuse the
  existing tabServers/tabCatalog strings (no i18n changes)
- availableCatalog memo filters installed/name-clashing entries
- catalog memoized to satisfy react-hooks/exhaustive-deps
2026-08-16 00:58:50 -07:00
hermes-seaeye[bot] 1f8f79b320 fmt(js): npm run fix on merge (#87505)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-08-16 07:11:41 +00:00
Teknium 6bb8f60f57 fix(desktop): defer credential-warning onboarding to the first chat attempt
Switching to a profile with no provider configured popped the blocking
onboarding overlay (Nous Portal / provider picker, "gateway isn't
ready") the moment the profile's runtime info arrived — punishing the
user for merely looking at an unconfigured bot/profile.

The passive credential_warning (session create/activate/resume info,
stream heartbeats) is now stashed instead of opening the overlay.
The submit path consumes it when the user actually tries to chat and
opens onboarding then, before the doomed send; the draft stays in the
composer. A warning-free session event clears the stash, so healed or
switched-away profiles never fire stale onboarding. Turn-error paths
(a real failed send) still open onboarding immediately, unchanged.
2026-08-16 00:06:07 -07:00
Teknium f3bf718a62 feat(desktop): drag-resizable panes on the Capabilities Skills tab
The Skills tab's three panes are now all drag-resizable:

- List/detail column seam: MasterDetail grows an optional resizeId that
  turns the seam between the rail and the detail pane into a vertical
  drag sash (same visual language as DetailPane's top-edge sash). The
  rail width persists in the shared pane store under that id;
  double-click resets to the default 0.75fr track. Skills and Tools
  tabs share one id so the split stays consistent across tabs.
- Skills Hub section: the embedded hub picker's top edge is now a drag
  sash — pull the hub pane up to grow it (the skills list above
  absorbs the change). Height persists through the same pane store,
  double-click resets, and the cross-origin iframe gets
  pointer-events:none during the gesture so it can't swallow the drag.
  Replaces the old native CSS corner-resize handle.
- The skill editor bottom pane already resized via DetailPane's sash.

MASTER_DETAIL_WIDE_COLS keeps its exported shape (MCP tab reads it) —
the --md-split var falls back to the declared track when unset, so
grids without a sash render exactly as before.
2026-08-15 22:58:30 -07:00
Teknium d5773bfc3a feat(desktop): Skills tab hub browser + full-skill detail pane; drop Browse Hub tab; SkillsView SDK export
Consolidates the Capabilities view around the Skills tab and opens the
whole surface to plugins:

- Skills tab: the embedded Skills Hub picker now renders BELOW the
  installed-skills list, expanded by default, with the update-all action
  in its header. "+ Add to this Agent" picks are refused with a toast
  when the skill is already installed in the scoped profile (name and
  identifier both checked against the unfiltered list).
- Detail pane: shows the ENTIRE skill for any provenance — frontmatter
  metadata rendered as key/value rows plus the full SKILL.md body —
  via the existing GET /api/skills/content (new getSkillContent fetcher,
  profile-scoped, cached per skill+scope).
- Browse Hub top-level tab removed (hub.tsx deleted, tabHub i18n keys
  dropped); the hub lives inside Skills now. Legacy ?tab=hub URLs fall
  back to Skills via useRouteEnumParam. Hub actions/store and all hub
  REST fetchers are unchanged.
- SkillsView gains `embedded` (tab state local to the component instead
  of the route ?tab= param) and `fixedProfile` (pins every tab to one
  profile; the scope selector hides and the profiles roster fetch is
  skipped) and is exported from @hermes/plugin-sdk — so Hermes-Bot-Mode
  can render the real Capabilities surface inside its create/edit agent
  Advanced section pinned to a bot.
- i18n: hub.alreadyInstalled (en + zh; others fall back).

Tests: index.test.tsx 8/8 (new: full-skill detail pane renders
frontmatter+body; picker refuses already-installed picks and is expanded
by default); toolset-config-panel 28/28; hermes-parity 11/11. Typecheck
(3 tsconfigs) + eslint clean.
2026-08-15 17:15:44 -07:00
Teknium 9c58a78a7d feat(desktop): Capabilities-wide profile scoping + one-click hub installs on the Skills tab
Extends the Capabilities "Configuring:" profile selector (#86548) from
Tools/MCP to the WHOLE view — Skills, Tools, MCP, and Browse Hub now all
read and write the same selected profile — and brings Bot Mode's
one-click Skills Hub picker into the main Capabilities -> Skills tab.

Scope widening:
- skills/index.tsx: the selector renders once above whichever tab is
  active. Skills list, toggles, bulk ops, editor, and archive are scoped
  via the trailing-profile pattern; the skills RQ key gains the scope key.
  Toolsets analytics (usage badges) load per scope. SkillsHub and the
  hub picker are keyed/remounted per scope. Scope changes drop the open
  editor/archive dialog and in-flight analytics (same hazards as an
  app-wide profile switch); an app profile switch clears the override.
- hermes.ts: getSkills, setSkillEnabled, get/edit/deleteLearningNode,
  getUsageAnalytics, and all seven skills-hub fetchers take the optional
  trailing profile? (omitting preserves exact app-wide behavior).
- store/hub-actions.ts: runHubAction threads profile through spawn and
  getActionStatus polling so install/uninstall/update and their logs run
  against the scoped backend.
- hub.tsx: sources/search/preview queries keyed+scoped per profile;
  install/uninstall/update/scan route to the scoped profile.
- archive-skill-confirm-dialog.tsx: optional profile prop.

One-click hub installs (from Hermes-Bot-Mode):
- skills/embedded-hub-picker.tsx: collapsible, resizable iframe of the
  live Skills Hub (hermes-agent.nousresearch.com/docs/skills?embed=picker)
  on the Skills tab. Origin-checked hermes-skill-pick postMessages route
  through the standard hub action pipeline (background action, tailed
  log, optimistic flip, Skills list + slash-completion invalidation),
  scoped to the selected profile.
- i18n: skills.hub.picker* keys (en + zh; others fall back).

Tests: index.test.tsx — new case asserts picking a profile on the Skills
tab refetches skills scoped to it and routes toggles there (6/6);
toolset-config-panel 28/28. Full typecheck (3 tsconfigs) + eslint clean.
2026-08-15 16:21:56 -07:00
hermes-seaeye[bot] 17c7b0bebd fmt(js): npm run fix on merge (#87296)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-08-15 22:15:27 +00:00
Teknium 3e8ab06107 fix(desktop): never send ordinal-only truncation — resolve durable row ids by content
Client half of #87059. The gateway now fails ordinal-only truncation
closed for durable sessions (#87150), which turned the mis-aimed cut into
a visible edit-resend error for any bubble without a bound rowId (edit
after an interrupted turn, unstamped resume). Make the Desktop always
produce a durable address or degrade safely:

- runRewindSubmit: when a truncation request lacks a durable address,
  resolve the target's row id by exact content against session.history
  (which ships row_id per persisted row). Resolution is
  exact-or-nothing: a unique text match wins; ambiguity is accepted only
  when the target is provably the newest persisted turn (the
  edit-after-interrupt shape). Anything else degrades to a PLAIN
  resubmit — never a guessed cut. The client ordinal is dropped either
  way (its space can diverge from the gateway's — the #87059 root).
- planReload/planRestore: degrade failed turns to a plain resubmit
  (extends the #86623 pattern to regenerate/restore) and carry the
  turn's persisted sourceText as the content key.
- rebindSurvivorRowIds: iterate the same failed-turn-aware ordinal
  space as the truncate math.
- session-tile-actions: reload goes through the shared runRewindSubmit
  primitive instead of a raw prompt.submit, so the tile surface gets the
  same discipline.
2026-08-15 15:09:11 -07:00
vondelomlo c2a50a8662 fix(desktop): skip failed turns in the backend-facing user ordinal space
A user turn whose submit failed keeps its optimistic bubble but never
reached the gateway, so counting it makes every later
truncate_before_user_ordinal overshoot the backend index (refused 4018,
regenerate dead for the rest of the session). Skip failed turns in the
one shared visible-user ordinal space (visibleUserMessageIndices) used by
truncate ordinals, ordinal->index resolution, and survivor-rowId
rebinding.

Based on #41275 by @vondelomlo, relocated onto the split
use-prompt-actions/ modules and widened from visibleUserOrdinal to the
shared index helper.
2026-08-15 15:09:11 -07:00
hermes-seaeye[bot] 0c50bdbdea fmt(js): npm run fix on merge (#87257)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-08-15 20:44:31 +00:00
hermes-seaeye[bot] 9c7f92bf93 fmt(js): npm run fix on merge (#87251)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-08-15 20:38:02 +00:00
Yingliang Zhang eec4d5ec19 style: order deep-parent fixture import before siblings (perfectionist/sort-imports) 2026-08-15 13:35:32 -07:00
Yingliang Zhang 9f78a0d37f fix(desktop): preserve turn-elapsed timer across session switches
Rebased onto latest origin/main. Resolved conflicts in:
- use-session-actions.test.tsx: kept both HEAD's image-attachment test
  and PR's turn-clock restoration test (orthogonal features)
- use-session-actions/index.ts, gateway-event.ts, server.py,
  test_tui_gateway_server.py, test_protocol.py: adapted to HEAD's
  refactored structure while preserving PR's turn-origin tracking
2026-08-15 13:35:32 -07:00
Tommy00748 93a9b2318f feat(desktop): show per-turn wall-clock duration in the transcript
Each assistant reply now carries a small time badge below the message text
showing how long its turn took (message.start -> message.complete), so
users can gauge task latency at a glance without hovering.

The duration is computed renderer-side from the per-session turnStartedAt
timestamp the app already tracks and stamped onto the ChatMessage at
completion (successful and failed turns alike). It is not persisted
backend-side, so messages hydrated from history have no badge — matching
how reasoning-block durations already behave.

Also adds the assistant.thread.turnDuration i18n key across all five
locale files.
2026-08-15 13:31:35 -07:00
Teknium 4b583e4476 fix(desktop): discriminate backend-confirmed turns with turnLive so the settle gate survives submit-time clock seeding
Follow-up hardening for the #74163 salvage: the no-payload settle gate used
turnStartedAt as "backend reported the turn live", but since the turn clock is
now optimistically seeded at submit (#86923), that signal is ambiguous.
Introduce ClientSessionState.turnLive, set on message.start, the running=true
session.info edge, and resume-onto-running paths; cleared by every settle.
The pre-start bail now gates on turnLive so a running=false heartbeat in the
submit gap still keeps the spinner up, while a genuinely started turn that
dies without a payload settles and unbricks the session.
2026-08-15 13:27:08 -07:00
briandevans 3e46389e40 fix(desktop): settle a turn that ends with no assistant payload
A turn that finishes without ever producing an assistant payload never
reaches message.complete, so session.info with running=false is the only
event that can release it. The busy=false branch bailed out of the state
update whenever awaitingResponse was still set and no payload had been
seen, so awaitingResponse and busy stayed latched until the app was
restarted.

That is not a cosmetic indicator. The per-session busy flag is
authoritative for isTargetSessionBusy, so submitPrompt and the slash
dispatcher silently returned false: the user typed, pressed Enter, and
nothing happened, with no error. Per-session state does not self-heal on
a session switch, so the session was effectively bricked. It reproduces
on a gateway crash mid-stream, a provider error before the first delta,
and an agent-build failure.

The bail still has a real job: submit arms busy/awaitingResponse
optimistically, so a running=false heartbeat landing in the gap before
the turn spins up is a pre-start report, not a finished turn, and
settling on it would drop the spinner and re-open the send guard
mid-flight. Gate the bail on turnStartedAt, which is stamped only once
the backend reports the turn live and cleared by every settle: null means
no turn was ever reported running, so keep waiting; non-null means the
turn started and is now reported finished, so settle.

On recovery, catch up the surfaces the missing message.complete would
have refreshed. The sidebar refresh stays unscoped so a background
session's working dot clears without the user opening it, and it fires on
the recovery edge only because the unchanged-state guard short-circuits
every later heartbeat. The transcript hydrate is scoped to the active
session so an idle background session does not cost a REST call.
2026-08-15 13:27:08 -07:00
hermes-seaeye[bot] 45af7a71fc fmt(js): npm run fix on merge (#86935)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-08-15 11:39:10 +00:00