Commit Graph

419 Commits

Author SHA1 Message Date
Teknium
b87977cadd refactor(api): remove browser-extension control (its browser tools are gone)
The broker's capability allowlist named only the deleted browser_navigate/click/type/... tools, so a
bound extension controller silently did nothing (review P1-1); owner ruling: remove the feature.
Drops the broker, artifact store, extension router, /v1/browser-control + /v1/artifacts routes,
browser.controller.* RPCs/events (contracts regenerated) and the per-request controller identity.
The authenticated-identity helpers bot relay and session ownership still use move to
gateway/session_identity.py; persisted API admissions carrying 'browser_control' still recover.
2026-10-23 01:42:27 -07:00
Teknium
433e420be4 refactor(browser): drop /browser use, the browser.manage use action and the downgrade notice
browser_exec is the only core browser path, so there is no Browser Use /
built-in tools switch to flip and no silent downgrade to announce.

- classic CLI, Ink TUI and the gateway browser.manage RPC lose the `use`
  action (contract regenerated: BrowserAction, enabled, browser_use);
- /browser status no longer reports a mode; the Chromium-fallback line for
  Lightpanda and the dead "chrome" engine row go with the built-in tools;
- browser_backend_notice leaves the session snapshot, the CLI banner and
  the canonical contract.

TUI locale packs and _keys.tui.json drop the five slashCmd.ops.browser
keys whose only caller was `/browser use`.
2026-10-23 01:41:24 -07:00
Siddharth Balyan
7b0f11fc7b feat(connectors): no guest on page open, connector sign-in offer (#143248)
* feat(connectors): list hosted apps without creating a guest identity

Opening the desktop Connectors page used to create a Nous guest identity:
connectors.list, connectors.catalog, connectors.accounts and
connectors.policy.get each created one before answering, because the
Portal's catalog route needs a token. A user who only looked at the page
got an identity anyway.

While there is no identity yet (and one may still be created), those four
reads now answer without one: the catalog from a snapshot that ships with
Hermes, an empty connector list, no accounts and no rules. Connecting an
app still creates the identity, as before.

scripts/refresh_connector_catalog.py rewrites the snapshot from a
signed-in install. It leaves logos out: no client draws them.

* feat(free-tier): sign-in offer for guests who connected apps

Every free-tier sign-in offer keyed on the welcome trial, so a user on
their own model key who connected apps through a guest identity never saw
one.

The offer record now tracks two offers on the same schedule. `trial` is
unchanged. `connector` is for a guest without the trial that has connected
an app: each app that finishes connecting sets `has_connected_app` on the
guest state (so it dies with the guest) and counts as a finished task.
free_tier.status (still a pure local read) adds connector_nudge_due_in, and
free_tier.claim_nudge takes a `kind`.

The desktop reads the connector offer whether or not the trial is
available, re-reads the status after a turn or a page connect, and shows
connector copy instead of the free-allowance copy. After a page connect
settles it also re-reads the catalog and rules, so the bundled catalog
from before the identity existed is replaced by the account's own.

* fix(connectors): point the sign-in hint at `hermes auth upgrade`

`hermes connectors` told users to run `hermes login`, which no longer
exists. Both hints now say "Run `hermes auth upgrade` to sign in."

* feat(connectors): read the public catalog with no token; one guest rule per entry point

The bundled catalog snapshot listed apps a new guest cannot connect and
went stale whenever the catalog changed. With no token, the Connectors
page now reads the Nous Portal's public catalog route
(GET /api/v1/connectors/catalog/public), sent with no Authorization and
parsed with the existing catalog model. Once a token exists the page reads
the signed-in route, as before.

Whether an entry point may create the guest identity is now declared once
per entry point instead of checked inside handlers:
- managed_client(creates_guest=...) is required: connect (page, agent,
  card retry) and the explicit lists (CLI `hermes connectors list`, agent
  manage_connections status/display) pass True, unchanged.
- account RPCs declare creates_guest on _account_method: catalog,
  accounts and policy.get never create one; tools and the account writes
  still do.
- the page's connectors.list never creates one; connect does.

With no token the page reads give true answers: public catalog, empty
connected list, no accounts. The invented "unrestricted" policy is gone:
the desktop asks for rules only once the list has rows, which needs a
token, and policy.get without one refuses with sign-in-required.

Deleted: the bundled snapshot, its refresh script, and the no-identity
stubs.

* fix(connectors): CI and review round: older backends, outside connects, link connects, guest opt-out

- CI: test_legacy_fallback_ticket_profile_verbs faked managed_client with
  no arguments and gave the secondary profile no token, so the page list
  (now token-gated, creates_guest=False) never reached it. The fake takes
  the new keyword and the profile holds a token.
- Older backends: a trial claim sends free_tier.claim_nudge with no
  params again. An older backend rejects the unknown `kind` key and would
  have dropped the trial offer; the new backend defaults to the trial.
  Only the connector claim sends `kind`.
- Outside connects: while the page's list is empty (no identity), every
  finished turn or connect re-reads the list and catalog. An agent connect
  in a chat then moves the page to the signed-in routes and its rules.
- Link connects: an agent status read that sees a connected app on a
  guest without the flag arms the connector offer, so messaging and
  one-shot connects (no operation watcher) count too.
- Opt-out: the connector offer requires nous.guest to be allowed.

* fix(connectors): the Connectors page list arms the connector offer too

A guest whose apps were connected by an older Hermes has no has_connected_app flag, and only the operation watcher or the agent's status read set it. The page's connectors.list now passes its rows to note_connected_apps_seen, which owns the any-connected check for both list reads.

* fix(connectors): review round 3: accounts after an outside connect, retryable offer record

- An identity created outside the page (an agent connect in a chat) now also re-reads the accounts cached while there was none, so the new account row, rename and remove show up.
- note_app_connected records the connector task before it sets has_connected_app. The flag ends list-read sightings, so a failed schedule write no longer leaves the offer unarmed for good.
2026-10-23 06:08:27 +05:30
Teknium
feecf7cbd2 fix(usage-window): the status bar drops the plan gauge once a reply arrives off a window plan
Greptile: "Old allowance stays visible" (gateway/session_usage.py:101-102).

Both usage builders (gateway/session_usage.py::tui_usage and
tui_gateway/server.py::_get_usage) always send `calls` and send
`plan_gauge` only on a window plan, so a complete usage payload without
the key means the session is off the plan (or the allowance reset).
Desktop merged every payload into the stored usage, which kept the old
gauge forever. The new `mergeUsage` (apps/shared usage-tick) clears it on
complete payloads and keeps it across partial ticks; usageFromTick forwards
a top-level frame's gauge so a canonical counters-only frame is complete
too. The wire stays byte-identical for accounts never on a window plan.
The Ink TUI never reads plan_gauge, so it has no stale copy.
2026-10-22 14:34:55 -07:00
Teknium
e106c2c9fa fix(usage-window): a pinned current model never takes the Recommended heading in the composer menu
Greptile: "Headings mislabel pinned current models". sectionAt assumes picks-first order,
but the composer menu prepends a current model the catalog omits, so with featured A and
pinned custom X, X got "Recommended" and A "Other models". Re-apply the picks-first
order (splitRecommended) after the pin, and state the order contract on sectionAt.
2026-10-22 13:50:11 -07:00
Teknium
655926daba fix(usage-window): carry the plan gauge on the canonical usage feed
Greptile: "Normal Desktop usage omits gauges". plan_gauge was built only in
tui_gateway/server.py::_get_usage (the embedded backend), but a normal local
Desktop session reads its session.usage ticks and message.complete usage from
gateway/session_usage (usage_stats -> tui_usage), so the status-bar allowance
never showed. Move the builder to gateway.session_usage.plan_gauge, use it on
both paths (omitted off a window plan, as before), and type it on the Usage,
SessionStats and session.usage contracts (regenerated).
2026-10-22 13:50:11 -07:00
Teknium
c00f999ba4 Merge origin/main into window-plans
Resolves the desktop i18n conflicts: main moved en/ru errorCodes into
en_error_codes.ts / ru_error_codes.ts, so usage_window moves there; ar/ja/zh/
zh-hant keep both usage_window and main's workspace_unavailable. _keys.desktop.json
regenerated.
2026-10-22 12:53:41 -07:00
Austin Pickett
92663ae805 feat(desktop): install with +, switch once installed; tier badges on the install dialog (#142708)
* fix(desktop): catalog card actions sit above the card-wide hit area

On compact and hero cards the action slot comes before the title button,
whose ::after stretches over the whole card and painted on top of it, so
clicks on the switch or + opened the details instead.

* feat(desktop): install catalog entries with +, switch only once installed

Install is one-way, so it is now a + button instead of a switch that also
meant enable/disable. Installed entries keep their on/off switch. Featured
cards and the detail spell it out as "+ Install". A plugin's Uninstall
moves from the header trash icon to a labelled row at the bottom of its
detail.

* feat(plugins): badge the install dialog with the catalog tier

The dialog called every catalog pick Verified. It now says Official,
Verified or Community. plugins.catalog.lookup returns the tier so
hermes://plugin/install?catalog= links badge the same as in-app picks.

* refactor(desktop): plugin Uninstall row is its own component

Keeps PackageRow under its code-health complexity cap.

* chore(i18n): regenerate desktop locale keys for catalog.install

* fix(desktop): "Install here" badges the catalog tier too

The third way into the install dialog opened it with a catalog name but no
tier, so a community package still read Verified. Read the tier from the
cached catalog by name; uncached keeps the generic badge. Also note why the
catalog path passes entry.source as the tier.
2026-10-22 11:28:08 -04:00
Siddharth Balyan
944c3a4340 Merge pull request #142919 from NousResearch/sid/drop-serve-era-desktop-spawn
refactor(desktop): delete what only the Desktop's own hermes serve reached
2026-10-22 14:47:55 +05:30
alt-glitch
fe46dc282c chore: trim comments the code already says across the onboarding stack
Comment and docstring edits only (no code or assertion changes): bug
history in module docstrings, narration, cross-refs and test copies of
the handshake comment go; WHY comments on ordering, locking, the launch
profile scope and the old-backend wire constraint stay.
2026-10-22 13:43:01 +05:30
alt-glitch
5e2b545dd9 fix(desktop): give a fresh install its onboarding and free trial again
Since the unified gateway (#106742) the Desktop attaches to the shared
gateway instead of spawning its own `hermes serve`. Onboarding, the
welcome-trial claim and free inference decide "is this the Desktop app on
this machine?" from HERMES_DESKTOP and the spawn token in the process
environment, which the gateway never has. So `onboarding.state` answered
eligible:false for every new user, who landed on the provider picker with
no free account.

The answer now comes from the connection:

- The Desktop sends `client.capabilities {desktop_local: true}` first on
  every socket, as a call of its own, before the boot's first
  `onboarding.state` (the backend reads frames in order). An older backend
  refuses only that call and keeps the server_requests answer.
- The gateway counts it only on a native-ticket connection, so a remote or
  tunnelled client never gets the trial.
- Requests on that connection run under `serving_local_desktop(True)`, and
  a chat it creates records the declaration in its launch policy, so the
  chat's later turns run the same way (`local_desktop_turn`).
- A trial-only user has no configured model; a canonical chat freezes its
  model at creation, so the chat now freezes the free model
  (`_welcome_trial_model`) instead of refusing.

Live: a --fresh-install sandbox launch minted a guest account, opened the
onboarding chat and the free model answered.
2026-10-22 13:42:49 +05:30
Teknium
b3e7289110 fix(gateway): groups.state names the member answering a hosted room
Gateway-owned group rooms only reported a room-wide `working` flag, so a
client had no way to show which bot was busy. `HostedRoomService.status`
now returns `member_activity`: the room's live tasks (queued, running,
stopping) with their member, in admission order. `working` derives from
the same list. The field is optional in the contract, so older gateways
simply omit it.

Fixes #102196.
2026-10-21 23:18:49 -07:00
rob-maron
cafa03f7f4 PR review comments 2026-10-21 23:05:11 -04:00
rob-maron
83c5737be2 merge main in 2026-10-20 21:19:31 -04:00
rob-maron
15307dece7 Usage-window plan support 2026-10-20 21:04:30 -04:00
Teknium
e6da913585 Merge pull request #138820 from NousResearch/austin/feat/capabilities-catalog
feat(desktop): redesign Capabilities catalog (Skills, Plugins, Connectors, Tools)
2026-10-20 10:53:27 -07:00
Teknium
ad5d16236b fix(desktop): New Group Chat offers only the bots groups.create will seat
In canonical mode the picker filtered by connection membership alone, so it
offered parked profiles, retiring siblings, and (on a profile-bound
socket) siblings the caller may not seat. groups.create then refused them
by name, which left #141178 only half fixed.

groups.capabilities now returns seatable_profiles: the roster
gateway/session_hosted_members.member_roster gives THIS caller (served
bots minus problem/retiring ones, plus usable hosted_rooms.profiles
entries; served siblings only for a host-scoped socket). It is the same
rule and the same host_scope flag the create handler validates with. The
field is optional in the contract (TS + OpenRPC regenerated), and a gateway
that predates it keeps the connection-only filter.

The Desktop picker keeps a canonical-mode bot only when its target profile
is in that set.

Tests: tests/gateway/test_hosted_group_members.py::
test_capabilities_name_exactly_the_profiles_this_caller_can_seat (base:
KeyError 'seatable_profiles'), and canonical-group-capability-gates.test.tsx
"canonical creation offers only the bots the authority says this caller can
seat" (base: the parked bot is rendered).
2026-10-20 08:42:13 -07:00
Austin Pickett
d0e5cf43a8 Merge remote-tracking branch 'origin/main' into mergemain-138820
# Conflicts:
#	apps/desktop/src/app/capabilities/plugins/plugins-tab.tsx
#	apps/desktop/src/i18n/en.ts
2026-10-20 08:54:46 -04:00
Teknium
60affe7fe2 feat(mcp): forward MCP notifications/progress as live tool.progress events
MCP tool calls now send _meta.progressToken, so servers that emit
notifications/progress (Meshy refine, creative-lab) report live progress.
The executor binds a per-call relay; the MCP handler forwards each
notification to tool_progress_callback as a throttled (<=1 per 500 ms,
final always) tool.progress event. Surfaces:
- gateway event stream + legacy TUI gateway: tool.progress
  {tool_id, name, progress, total, percent, message} (contract registered)
- Desktop: running tool row shows '42% · <message>' beside its timer;
  plugins subscribe with ctx.onEvent('tool.progress')
- CLI: the running tool spinner shows the same text
Documented in the Desktop plugin SDK guide.
2026-10-20 04:41:58 -07:00
kshitijk4poor
98159a3200 feat(gateway): session.resume carries the session's todo snapshot
Symptom: a client attaching to a session with a plan (the classic CLI's
/resume, `chat -c`, /branch) gets no todo list from the owner's
session.resume reply. The only todo source is a later todo.updated frame,
which fires only when the model calls the todo tool again.

Root cause: the canonical snapshot (AuthorityConnection.resume) never had
a todo field. The TUI-gateway reply has carried todo_state since the
revisioned snapshots (itsflownium, 2026-08-29, 393af4a310); the owner
runtime (#106742) did not carry it over.

Change: the reply adds `todo_state`, the newest paired todo result in the
transcript it already loads (tui_gateway's _todo_state_from_history,
through the server module it is bound to, as session.resume's
display projection does). This is the snapshot the session's agent
hydrates from and its todo.updated frames carried. null when the session
has none. CanonicalSnapshot gets the optional field (the existing
TodoState model); TS and OpenRPC regenerated.

Why: the gateway stays the only source of task state, and a first
resume shows the plan with its revision.

Refs #134889
Refs #139158 (package 1)
Follows up #141090
2026-10-20 15:51:03 +05:30
Teknium
165a2f0149 fix: a message typed into a running cron chat says why it was refused (#141348)
A cron session only runs its own frozen fire. Anything else admitted into it
(a message typed into the Desktop chat while the job ran) made
session_cron.execute raise admission_conflict, which _execute_claimed logged
as a traceback and settled as the opaque "The admitted turn failed." card.

session_cron.execute now settles that admission as a failed turn whose text
names the restriction and whose error_surface is
{layer: gateway, code: cron_session_read_only, retryable: false};
completion_payload forwards a captured error_surface on message.complete.
The job itself still never runs for it.

Desktop gives cron_session_read_only its own card copy and the
"Start new chat" action instead of Retry. The TUI already renders the
specific text (no `error` field, so the bare-error rewrite does not apply).

"Copy error details" stamped `time:` with the copy moment, so a stale failure
read as a fresh incident. It now uses the bubble's recorded completion time
(the terminal frame's), or the hydrated row's own timestamp, and omits the
line when neither is known.

en.ts is over its size cap: the error-card layer tables move to
en_error_layers.ts to offset the new copy.

Salvages the idea of #141369 by @Ehsan-hash (cherry-picked as the parent
commit); this trims it to the cron producer, drops the new wire timestamp
field and the per-site allow-list in completion_payload, and reuses existing
bubble timeline metadata for the diagnostics time.
2026-10-20 03:19:01 -07:00
Ehsan-hash
9bd07143a0 fix(gateway): explain read-only cron session failures 2026-10-20 03:19:01 -07:00
Teknium
b2c269f665 fix: re-admit only a correction the owner marks undelivered
A live agent's 'rejected' can follow delivery: Codex turn/steer returns
False on an ACK timeout even when the server already consumed the steer.
The TUI read every same-generation 'rejected' as "never delivered" and
re-sent the words as prompt.submit, so the correction could run twice.

correct() now marks the no-agent refusal with delivered: False (declared
on CanonicalCorrectionAck, contracts regenerated). The TUI re-admits only
that reply plus the three pre-agent error reasons; a plain 'rejected'
settles as refused with the input retained, as on main. The salvaged
gateway tests are trimmed to the no-agent case plus a live-agent refusal
that must carry no marker.
2026-10-20 03:09:11 -07:00
Teknium
bd6e94352b fix(desktop): a correction refused before any agent saw it is re-queued, not dropped
A pane whose busy belief outlived its turn (a session switch, a reclaim)
sends the next message as session.steer / session.redirect. The owner
refuses it before delivery (execution_not_ready / stale_generation), and
both Desktop correction paths (the primary redirectPrompt and the tile
steerPrompt) threw that as a failed send: the optimistic row was
discarded, "prompt failed" toasted, and the composer's keep() fallback
never ran, so the text was lost.

Those refusals are now answered as "not corrected": the action returns
false and steerDraft's keep() re-queues the frozen words as the next turn.
A refusal that may have reached the turn still surfaces as an error.
isUndeliveredCorrectionRefusal lives in @hermes/shared so the TUI uses the
same reason set.

Fixes #141644
2026-10-20 03:09:11 -07:00
alt-glitch
c5a3c0f876 fix(plugins): address review — dashboard scan override, feed and pin-aware update signal, subdir coverage
- Dashboard: the update route answered a scan block with a bare HTTP 400,
  so the browser page could not show the findings or send force. It now
  passes scan_blocked through (update route only; install is unchanged),
  and the page's update button runs the same consent-then-scan flow as
  Desktop through web/src/lib/plugin-update.ts. AgentPluginUpdateResponse
  moves to web/src/lib/api-plugins.ts (api.ts is over the size cap).
- Saved update checks now record the install they were checked against
  (source, revision, pin). A result is dropped once any of those changed,
  so a --ref pin or a reinstall from another source no longer shows an
  Update button that update refuses. An update_url feed's version target
  is offered too (the old match compared it to a commit and never hit);
  the row field is update_target, a commit or a version.
- Each finding in the Desktop dialog shows its description.
- Tests: a real subdirectory install exercises the re-clone path (caution
  needs force, dangerous refused even with it, refusals leave the tree and
  record alone); the dashboard route returns findings and applies with
  force; the saved signal drops on update, new source and pin.
- locales/_keys.desktop.json regenerated for the new Desktop strings.
2026-10-20 12:26:35 +05:30
alt-glitch
3ac037670a fix(plugins): Desktop and the dashboard update git-installed plugins through the CLI's path
Desktop's plugins.manage update refused every non-catalog install ("not a
catalog install — update it via the CLI") and kept its own third copy of
the re-pin logic. It now calls dashboard_update_user_plugin, the same
function the dashboard route uses, so catalog and git installs update the
same way on every surface.

A scan block comes back as ok=false + scan_blocked + scan_verdict +
scan_findings (the shape install already returns) with nothing changed;
the client retries a caution verdict with force. The dashboard route reads
force from its body next to accept_capabilities.

The Plugins tab can only offer Update when it knows an update exists. Git
installs had no such signal, so the row never showed a button. The gateway
already runs the update check every plugins.auto_update_check_hours, and
`hermes plugins check-updates` runs it on demand; both now save the results
next to the cadence marker. The plugin list reads that file (no network per
listing) and sets update_available + latest_sha on git rows. A saved result
is ignored once the install's revision moves past the one it compared.
2026-10-20 12:26:35 +05:30
Austin Pickett
93600451dd feat(catalog): featured hero becomes a slider when there are several picks
featuredPicks (apps/shared) returns every curated pick starting at this
week's rotation, so slide one is still the website's pickFeatured entry.
CatalogFeaturedSlider shows one pick bare; several get scroll-snap slides
(swipe/trackpad), prev/next and dots, advancing every 7s unless hovered,
focused, hidden or reduced-motion. Off-screen slides are inert.
2026-10-20 00:35:46 -04:00
Austin Pickett
115b0fccd4 refactor(catalog): one official-skill-source list and one docs origin
OFFICIAL_SKILL_SOURCES / isOfficialSkillSource live in apps/shared and
replace three hand-kept copies (desktop curation, desktop discovery, the
website skills hero). catalog-data reuses CATALOG_ORIGIN instead of its
own DOCS_ORIGIN copy. The plugin hero's official check reads the tier.
2026-10-19 22:57:43 -04:00
yoniebans
ad7c5a1d88 fix(gateway,desktop): the live session poll names each session's source, so a messaging settle never lights unread before its row loads 2026-10-19 23:04:43 +02:00
yoniebans
4b12ad037e fix(desktop): a turn Desktop sends into a messaging session lights the unread dot
Messaging completions were all skipped for the unread dot, including a turn the
user sent from Desktop, which lit the dot before the shared gateway listed
messaging sessions in Desktop's live poll. Desktop now records the admission id
of each of its submits the owner accepted to run, and the turn's stamped
message.complete marks the session unread when its admission is one of those
and the conversation is not on screen. The busy-to-idle edge still never lights
a messaging session, so no settle path can attribute one turn's completion to
another.

Refs #134889 (RT-18)
2026-10-19 23:04:43 +02:00
Austin Pickett
94c5aaa11e Merge origin/main into austin/feat/capabilities-catalog 2026-10-19 09:59:18 -04:00
Teknium
dfb4ecd911 fix: a stop typed as a busy correction ends the voice chat on the shared gateway
In Ink's interrupt and steer busy modes, text typed during a running turn
goes to session.redirect / session.steer, not prompt.submit. The typed
stop-phrase check only ran in prompt.submit, so a bare "stop" in a LOCAL
voice chat reached the running agent and voice chat stayed on.

The owner's correct() now makes the same _typed_voice_stop decision (attached
submitter, LOCAL session, voice on, bare stop phrase) after authorization and
before the generation fence, and answers {voice_stopped: true}. The canonical
CanonicalCorrectionResult becomes Ack | CanonicalVoiceStopped (generated TS
and OpenRPC regenerated); the dispatch test proves it through the real
contract parse.

Every client settles that reply instead of treating it as a refusal that
re-sends the text as a prompt (which would admit "stop" as a turn):
- Ink: settleControlReply renders the stop-phrase event and settles the
  item; the running turn's busy state is untouched.
- Desktop: redirectPrompt drops the optimistic bubble and reports accepted,
  so the composer does not re-queue it.
- ACP: /steer reports the stop-phrase notice and does not send a prompt.

Greptile review on #141508.

Refs #134889 (TUI-26)
2026-10-19 06:54:34 -07:00
Teknium
24b0b4d9a1 fix(voice): a typed stop phrase ends the voice chat on the shared gateway
Ink sends prompts to the canonical prompt.submit on the shared gateway, which
had no stop-phrase check. A bare stop phrase typed during a voice chat was
admitted as a turn and reached the agent. The spoken stop and push-to-talk
worked.

AuthorityConnection.submit now checks first, for a submitter attached to
the session whose gateway /voice mode is on. It reuses the sidecar's check
(methods_prompt._consume_typed_stop_phrase, split out of
_typed_stop_phrase_response) and _end_session_voice_chat, so the owner's
per-session mode goes off and that session's capture ends. Nothing is
admitted, and the reply is {voice_stopped: true}.

The canonical contract declares that shape: the prompt.submit result is now
AdmissionStatus | CanonicalVoiceStopped, and the shared artifacts are
regenerated. On a canonical reply, Ink settles the queue item, releases busy
and renders the existing voice.transcript stop_phrase event locally, so the
notice and mode flags are the ones the sidecar path already shows (existing
gatewayMsg.voice.stopPhrase string, no new text).

Refs #134889 (TUI-26)
2026-10-19 03:41:28 -07:00
Teknium
90b2022265 Merge pull request #141338 from NousResearch/fix/pkg12-acp-modes
fix(acp): restore Accept Edits / Don't Ask as a gateway-owned per-session edit policy
2026-10-19 01:34:21 -07:00
Teknium
fa2836d1ee Merge pull request #141331 from NousResearch/fix/pkg12-remote-replay
fix(gateway): replay waiting prompts after a legacy reconnect (salvage #140456)
2026-10-19 01:15:02 -07:00
Teknium
10a2956b15 test(shared): drop constructor parameter property from legacy replay fake socket
The web TypeScript project includes apps/shared/src and enables
erasableSyntaxOnly, so `constructor(public url: string)` failed its
build with TS1294. Use an explicit field and assignment.
2026-10-18 20:33:19 -07:00
Austin Pickett
d8395b9cf8 Merge origin/main into austin/feat/capabilities-catalog 2026-10-18 23:04:44 -04:00
Austin Pickett
a8d70670e1 feat(catalog): feature the Claude SDK provider plugin
Adds claude-subscription-directsdk to the head of the featured plugin
rotation (weekly, shared by the site and the app).
2026-10-18 22:53:49 -04:00
Teknium
8930c3c632 feat(gateway): session.export returns the /save transcript for the client to write
/save on the shared gateway wrote the export on the gateway host
(session.save), and took no format or redact argument. That works for a
local Ink but not for a remote Desktop, where the gateway's disk is not
the user's.

New owner verb `session.export {session_id, profile?, format?, redact?}`
renders the stored transcript like the classic CLI's /save (format via
normalize_save_format: json (default) / md / markdown / html / snapshot;
the force-redaction pass when redact is true) and returns {format,
filename, content}. It writes nothing; the client decides where the file
goes. session.save stays for shipped clients.

session.export has no sidecar handler, so its contract is declared
owner-only (canonical_method) and the shared artifacts are regenerated.
The test runs through the real owner dispatch and contract parse and
checks that nothing is written on the gateway host.

Refs #134889 (T10, T11)
Refs #141321
2026-10-18 19:40:20 -07:00
Teknium
8729dd9e74 fix(acp): restore Accept Edits / Don't Ask as the session's owner-held edit policy
The gateway ACP projection advertised only Default and refused main's other modes with
acp_edit_policy_mutation_unavailable: the owner had no verb for an editor's edit policy.

The policy is now plain data on the session's frozen LocalSessionPolicy
(edit_approval_policy: ask / workspace_session / session, default ask), written by a
revision-fenced `session.mutate edit_policy` ({policy}), so it lives in the session's stored
receipt and survives an owner restart. Only an ACP session takes it. The owner's edit guard
(gateway/session_local_editor.py) applies it before the editor's consent with main's rule
(should_auto_approve_edit): Accept Edits lets workspace/temp edits run, Don't Ask any edit,
and sensitive paths (.env, .git, .ssh, keys) always ask. session.info reports it to every
attached surface; the ACP projection advertises all three modes, maps set_session_mode and
set_config_option(edit_approval_policy) onto the mutation, shows a new editor the session's
mode, and projects another surface's change as current_mode_update.

A receipt main minted has no field: it restores as ask, and policy_identity skips the field
at its default, so stored credential references still match. The commit keeps the cached
agent (the policy is read per edit, not by the agent).

Refs #134889 (ACP-7)
Refs #141321
2026-10-18 18:58:27 -07:00
Teknium
26d994b62b test(gateway): pin legacy replay_epoch refusal scope and restart detection
On top of the salvaged #140456: the production dispatch still refuses any
other unknown key on session.events.since, and a reconnect to a restarted
standalone serve (new `epoch` on the answer) still drops the stale cursor
without the client sending the process epoch.

Refs #134889 (DB-7)
Refs #140455
Refs #141321
2026-10-18 18:40:38 -07:00
David Dudok de Wit
6930e77a1b fix(gateway): replay missed events and prompts after a legacy reconnect
The shared client sent the process epoch on session.events.since when a
session had no epoch of its own. The legacy /api/ws contract refused that
key, so a reconnect replay never ran and a pending approval or clarify
request was lost. Send the epoch only when it belongs to that session, and
accept and ignore the key on the legacy contract so a client that still
sends it replays against an updated backend.

Refs #140455

(cherry picked from commit 2e6217148a1481a16703beec338f5bb0ea749315)
2026-10-18 18:40:38 -07:00
Teknium
5541fa6c29 Merge origin/main into fix/pkg10-creds-a
Resolves hermes_cli/gateway_agent.py's prompt.submit against main's stop-before-submit fence: keeps main's reattach and CallStopped guard, and a turn stopped before the submit gives back its /model --once pick, since nothing was sent.
2026-10-18 10:59:23 -07:00
Teknium
b0bb0d8749 fix(contracts): admit model_override.reasoning on prompt.submit
`/model first --once --reasoning high` failed its turn with `invalid_params`
(on main it ran at effort=high). The CLI has sent `model_override.reasoning`
since the one-turn reasoning fix, and the owner's turn code reads it
(`gateway/session_cli_turn.py`), but the canonical WS contract
`CanonicalModelOverride` declared only `model` and `provider`. `Params`
forbids extra keys, so the dispatcher's `canonical_param_problems` refused the
submit before admission and no request reached the provider. Unit tests
passed because they record the submit on a connection stub that sits below
contract validation.

Declare `reasoning: str | None` on the contract. Value checks stay with the
owner, which already refuses a level `parse_reasoning_effort` can't read, as
for every other canonical method. Regenerate the shared TS/OpenRPC artifacts.

The new test runs the recorded `prompt.submit` from a real
`/model ... --once --reasoning high` through the production
`canonical_param_problems` check, and pins every key the CLI puts in
`model_override` (`model`, `provider`, `reasoning`) to the contract.

Live-pass finding on #140969 (package 10)
Refs #134889 (CLI-36)
Refs #140719
2026-10-18 06:18:24 -07:00
Teknium
936ec14ee4 fix(tui): queue a Desktop prompt in the gateway owner's FIFO instead of refusing it
On a Bot Chat the gateway also owns, a legacy `hermes serve` backend refused the
user's own typed prompt with 4090 SESSION_NOT_OWNED whenever the gateway's
durable ledger held a running or queued turn (a message_agent delivery), and the
Desktop offered "Start new session".

#106742 is one owner and one FIFO, with clients that submit. prompt.submit now
hands such a prompt to the ready gateway serving the session's profile home
(tui_gateway/owner_forward.py): it attaches, admits the prompt into the owner's
durable FIFO with a fresh submission id and answers {status: queued,
forwarded: true}. The owner runs it after the current turn, exactly once;
nothing runs in the legacy backend. The owner's pending list (as
pending_submissions), message.start and message.complete for that admission are
relayed onto the Desktop's live session; a lost relay settles with an empty
completion and the client re-reads the stored transcript.

An `unknown` admission, or work with no running gateway, keeps the
SESSION_NOT_OWNED refusal (never forwarded past). A prompt the owner cannot take
(rewind, attachments, owner refusal) gets a named 4090 SESSION_OWNER_BUSY
refusal that says why and to send it again when the current turn ends.

Red on main: tests/tui_gateway/test_legacy_submit_forwards_to_owner.py (3 failed:
SESSION_NOT_OWNED / no forwarder). Real SessionDB, real started admission, real
SessionAuthority + AuthorityConnection as the owner; only discovery and the
socket dial are replaced.

Refs #134889 (RT-37)
Refs #140385
Refs #140719
2026-10-18 03:28:00 -07:00
yoniebans
756ed9c717 fix(gateway): serve the connection card with the legacy handlers' policy, errors and resume snapshot 2026-10-18 12:27:21 +02:00
unsupportedpastels
8196fbc124 fix(gateway): list a steer in transfer as steering so a returned prompt keeps its card
A transfer is terminal/steering in storage, so pending snapshots dropped
it. Desktop permanently retires an admission a newer snapshot no longer
lists. When a snapshot was published between the steer's commit and its
settlement (another submit, an attach) and the text then never reached the
turn, the owner put the same admission back to `queued`, Desktop rejected
that as older than `retired`, and the prompt still ran later with no card
to edit or delete.

The owner now lists every admission in transfer (from its claim's fence)
in session.info and attach snapshots: status `started` like its receipt,
no controls, and the new `steering: true`. Desktop hides that card but
never raises the admission's rank on a `steering` listing, so the owner's
later `queued` listing repaints it; an ordinary started row still only
moves forward. The contract gains the optional `steering` field and the
prompt.steer_queued doc now says that an interrupted transfer's completion
frame reports `cancelled`, as an interrupted turn's does. Contracts
regenerated.

Refs #134889 (RT-35)
Refs #140208
2026-10-17 14:25:35 -04:00
unsupportedpastels
98efa9dfad feat(gateway): steer and edit a canonical queued prompt from Desktop
Desktop's queue panel rendered only Delete for a server-owned (canonical)
queued row. The guard was deliberate: the gateway had no verb that could
steer or edit a queued admission, and composing prompt.cancel with
session.steer or with a resubmit is two writes. The drain can claim the row
between them, so the prompt either runs twice or is lost.

Add two owner verbs that consume the still-queued admission in the owner's
own write transaction:

- prompt.steer_queued {admission_id}: only while the running claim has
  adopted its agent (else steer_unavailable, before the row is touched: it
  stays queued and runs in FIFO order). The row goes queued -> terminal
  'steering' bound to that claim's (owner_epoch, generation), so the drain
  can never also claim it, and the text is then handed to the claim's agent
  while that execution still runs. The transfer settles in the claim's own
  terminal write: 'steered' when the claim completed with the text
  delivered, 'interrupted' when it ended any other way (never replayed),
  and queued again in its own FIFO place when the text never reached the
  agent (the turn ended first). An owner restart settles a transfer left
  open as 'interrupted'. Until settled the receipt reads 'started'. The
  fence is an in-memory transfer record changed under the session stream
  lock; the SQLite writes run outside that lock, so a held writer never
  stalls the owner loop (loop-side receipts, attaches and publication take
  it).
- prompt.replace_queued {admission_id, submission_id, text, ...}: cancel
  the queued row inside the admission write of its successor, which joins
  the back of the FIFO under a NEW admission identity. That write also
  binds the new identity to the row it retired; the exact-replay path
  checks the binding inside the same transaction, so a retry naming the
  same old admission answers the same replacement and any other old
  admission under that submission_id is admission_conflict. Ordinary
  prompt.submit payloads are unchanged.

Refusals: admission_started, session_idle, steer_unavailable,
admission_conflict, queue_full, unsupported_control, not_found.

Each pending row names the queued-row verbs its owner serves (controls:
steer/replace): text-only rows of sessions launched from an interactive
local surface (cli, tui, gui, acp), whose observers settle a steered or
cancelled row. Hosted-room, cron, kanban and a2a producers read a saved
result for any other outcome, so their rows are never offered either verb
and both verbs refuse them (unsupported_control). Desktop shows Steer and
Edit on a canonical row only when the row lists them, so an older gateway
keeps Delete only. Canonical rows never get Next: reordering would break
the owner's one FIFO. Local rows are unchanged.

Edit loads the row into the composer; Save calls prompt.replace_queued and
keeps the edit open until the owner answers. A refusal, or the owner
starting the row mid-edit, keeps the edited text in the composer as an
unsent draft (followed by the draft it interrupted) with a short notice.
The composer holds presentation state only; the owner's FIFO never pauses.

Both verbs are declared in tui_gateway/contracts (generated TS/OpenRPC
regenerated).

Refs #134889 (RT-35)
Refs #140208
2026-10-17 14:25:35 -04:00
unsupportedpastels
dffd733b15 fix(shared): key usageFromTick's compression count on context_source
usageFromTick decided whether a top-level tick carried a compression
count on context_length, so a session whose compressor has no known
window (context_length null) lost its count in Desktop and Ink. Its
Python twin, session_usage.tui_usage, keys on context_source, which
usage_stats sets exactly when a compressor exists (the embedded
_get_usage's "if comp"). Both readers now use the same rule.

Refs #134889 (RT-33)
Refs #140194
Refs #140208
2026-10-17 14:13:01 -04:00
unsupportedpastels
f09ade9340 fix(gateway): match the embedded ticker's usage view on session.usage; deprecate the flat counters
The salvaged commit (#140195) makes a local viewer's session.usage frame
carry tui_usage(stats) under `usage` next to the flat counters, so a
Desktop bundle that reads only `payload.usage` (anything before
usageFromTick) fills its context, cache-hit and t/s meters again.

That nested view must be what the embedded backend's ticker sends
(`{"usage": server._get_usage(agent)}`), field for field. It was not in
one case: _get_usage reports `compressions` whenever the agent has a
compressor, but tui_usage keyed it on `context_length`, which usage_stats
sets to None while the compressor does not know its window yet. Key it
on `context_source`, which usage_stats sets exactly when there is a
compressor. Same counters, no new state.

The top-level counters on session.usage are now documented as deprecated
in SessionUsagePayload and usage_frame (kept for hermes_cli.gateway_agent,
the Ink TUI and Desktop's usageFromTick); the generated contract files
are regenerated for the docstring.

Tests: the published nested view equals _get_usage(agent) for a steady,
an unsized-compressor and a fresh agent; Desktop's handleEvent paints the
meters from the dual frame, from its nested view alone (the pre-
usageFromTick reader) and from the deprecated counters alone.

Refs #134889 (RT-33)
Refs #140194
Refs #140208

Co-authored-by: herovivian <herovivian@gmail.com>
2026-10-17 14:13:01 -04:00