Commit Graph

4908 Commits

Author SHA1 Message Date
Teknium
ff29484938 fix(tts): find_voices={} browses voices instead of falling to speech
An empty find_voices object is the model's way to browse the library with the
defaults, but a truthiness check sent it down the speech path ('Text is
required', or audio instead of a search). Check for presence, in the handler and
the display formatter (Greptile P1 on #144633).
2026-10-25 16:39:44 -07:00
unsupportedpastels
dfe5b10677 fix(gateway): compare a managed worker's birth by its kernel start on Linux
On Linux psutil's create_time() is the cached /proc/<pid>/stat start ticks
plus boot_time(), and psutil 7.2.2 re-reads /proc/stat btime on every call.
WSL2 re-anchors btime after host sleep, so the owner's read of a live
worker's birth drifted from the one the worker reported in its hello, and
the exact-equality fences (reservation, worker.adopt/persist, delegation
dispatch, the launcher signal and the Kanban owner receipt) refused it:
every Kanban card, cron run and subagent ended permission_denied.

worker_birth() reads the kernel start ticks since boot
(create_time(monotonic=True)) on Linux and keeps process_birth() elsewhere;
every managed-worker identity fence now uses it. The spawn ledger keeps
process_birth() so its persisted epoch births still match after an update.
An owner_admitted receipt written before this change reads as another
process: its reclaim pauses, the fail-safe direction.

Refs #143547

Co-authored-by: Sebastian Hänisch <5960303+TKCen@users.noreply.github.com>
2026-10-25 19:25:17 -04:00
unsupportedpastels
7cd7ec0a47 test(terminal): cover overlapping holds and the idle restart after the last exit
Addresses review feedback on #144597.

Refs #143547
2026-10-25 19:14:26 -04:00
unsupportedpastels
79e0464fd9 fix(cli): keep the -w worktree as session.create's cwd on a mounting docker backend
The previous commit sent os.getcwd() for every non-local backend. hermes -w
puts the generated host worktree in TERMINAL_CWD without a chdir, so with
docker_mount_cwd_to_workspace the gateway froze the original checkout,
bind_turn_workspace registered it and docker mounted it at /workspace:
commands edited the checkout instead of the isolated tree.

_launch_cwd() now sends TERMINAL_CWD whenever it is a directory on this host
(local backends and the -w worktree) and falls back to the launch dir only
when it is not (a docker/ssh terminal.cwd naming a path inside the sandbox).

The remote execute_code reaper test now reaches the session-kernel call
instead of stopping at the python3 probe.

Refs #143547
2026-10-25 19:14:26 -04:00
unsupportedpastels
e24c9a5086 fix(terminal): keep the idle reaper off an environment with a call in flight
_cleanup_inactive_envs reaped any key whose _last_activity was older than
lifetime_seconds (default 300 s). Only background processes refresh that
stamp, while a foreground command may run for 600 s, so a long build or
test suite had its Docker workspace container stopped (exit 137), its
Modal sandbox terminated or its SSH control master closed mid-command.

terminal_tool and the remote execute_code path now hold the env keys they
were stamped under (_call_in_flight, refcounted, released in finally) from
acquisition through the approval wait and execution; the reaper skips held
keys, and release restamps so the idle countdown starts at call end.

Refs #143547

Co-authored-by: Genesis Guerrero Martinez <2824293+gengue@users.noreply.github.com>
2026-10-25 19:14:26 -04:00
Teknium
f219708926 feat(tts): fold voice search into text_to_speech's ElevenLabs schema (find_voices)
Teknium: the ElevenLabs variant of text_to_speech is where voice search belongs, not a
separate tts_voices tool. The ElevenLabs schema now carries voice_id plus a find_voices
object (text optional there); other providers' schema is byte-identical to main.

Live search findings folded in: the library is the default source and sorts by a year of
usage (most-used first); use_case (e.g. characters_animation) and sort filters; library
voices with a custom credit rate show credit_rate; the description tells the model the
library matches words literally, so a role word that finds nothing ('dwarf') falls back to
describing the sound ('gravelly old' + filters).
2026-10-25 15:58:23 -07:00
Teknium
10a30ead42 fix(tts): uncache the tts_voices check so a provider switch shows it at once
A cached False from an Edge listing could stick under the new config
fingerprint after switching to ElevenLabs (Greptile P1). The check is local and
config-backed, so mark it no_cache_check_fn; test drives the switch through
get_tool_definitions.
2026-10-25 15:58:23 -07:00
Teknium
c975831fbc feat(tts): let the agent pick ElevenLabs voices (voice_id + paginated tts_voices search)
With tts.provider: elevenlabs, text_to_speech gains an optional voice_id and a new
tts_voices tool searches the user's account voices (/v2/voices) or the public
Voice Library (/v1/shared-voices) with query/gender/age/accent/language filters and
an opaque next_page cursor. Both are gated on the ElevenLabs provider (dynamic
schema override + check_fn), so every other provider's surface is unchanged. A
per-call voice_id never rewrites config; a stale one sent under another provider is
ignored with a warning.
2026-10-25 15:58:23 -07:00
Teknium
ca5246bff9 fix(tts): stop downgrading tts-1/tts-1-hd on the managed audio gateway
The Nous audio gateway now serves tts-1 and tts-1-hd (it bills any model with a
priced NAS rule and fails closed otherwise), but the client still coerced every
model except gpt-4o-mini-tts, so tts.openai.model: tts-1-hd silently became
gpt-4o-mini-tts with a 'does not support model' warning. Widen the served set;
unserved models (e.g. dated snapshots) still fall back. Desktop client-direct
voice shares the same set.
2026-10-25 13:07:21 -07:00
unsupportedpastels
2c8e2e02af fix(gateway): resolve a bare custom provider to its named entry
custom is the billing class every named endpoint reports, not a route. Launch
policy, stored rows, synced runtimes and /status now carry custom:<name>,
matched by base URL and model in the owning profile. Also fixes the model-switch
crash on a profile-following session and accepts --source desktop as gui.
A client asking for a gateway-only label (cron, kanban, bot_room) is refused as
"reserved for the gateway", and a Kanban worker's descendants no longer inherit
its kanban label, so `hermes chat -q` from a task shell starts normally.

Rows MP-19, MP-20, MP-23, MP-25, MP-28; CLI-43.

Refs #143547
2026-10-25 11:34:11 -04:00
xxxigm
b247d79166 fix(fs): serve /workspace files from the session's docker workspace sandbox
Chat and artifact downloads name a session whose container is default:ws:<digest>, so the host copy is that sandbox rather than the shared default directory.
2026-10-25 10:42:07 -04:00
Teknium
850efff14f fix(vault): check the page origin before entering a backend's fill_context
After rebasing onto the shared origin guard (_bound_page_origin), browser_vault fill still entered the
backend's fill_context before the guard ran: a page on the wrong origin opened a plugin's manager
session or lock just to be refused. enter_code checked first, but then resolved the code from inside
the context without looking at the item again.

Both paths now run in this order, for built-in and plugin items alike: read the item's metadata, run
_bound_page_origin (plus the card confirmation for payments), and only then enter fill_context. Inside
the context a backend with its own fill_context has the item re-read, and the fill is refused unless
the frozen item still binds the checked origin. The origins checked and the secret resolved therefore
come from one snapshot, as the plugin guide promises. The built-in managers keep the default no-op
context and are not re-listed.

A plugin error while reading metadata for enter_code is now the same backend_unavailable refusal fill
gives. The write half of fill moves into _fill_bound_page, unchanged.

Tests: a plugin OTP on a foreign origin is refused with the backend never called (no context, no
resolve_otp, no prompt, nothing written; red on the pre-rebase head); an item re-bound inside the
context is refused for fill and enter_code before its secret is resolved (red for enter_code without
this change); the fill call order is now get_meta, fill_context, get_meta, resolve_password.
2026-10-25 05:32:43 -07:00
Teknium
ded478f82f fix(vault): judge a login backend's name without running plugin code
The shared registrar read provider.name before the login-backend registry's static check, so a
name property (or a __getattribute__ hook) ran plugin code there and its exception text reached
the loader log.

The login-backend row now runs agent.vault_backend_registry.static_name first: it inspects the
class and instance dicts only, refuses attribute-access overrides and non-plain names, and logs a
fixed refusal reason.
2026-10-25 05:32:43 -07:00
Teknium
67ea21b293 fix(vault): copy plugin metadata inside the guarded call
PluginLoginBackend guarded the plugin method call but validated and later read the returned
VaultItemMeta outside it. A subclass or lazy accessor could raise there, and browser_vault list
copied that exception text into the model-facing result.

Validate and copy every returned field (metadata, passwords, codes, secret dicts) into
core-owned plain objects inside the same fixed-message guard.
2026-10-25 05:32:43 -07:00
Teknium
5c4c661ae6 fix(vault): automatic one-time codes run inside the backend's fill_context
browser_vault enter_code called resolve_otp outside the backend's fill_context. A plugin that opens
its manager session (or lock/snapshot) in that context filled the password, then failed to mint its
stored code, and Hermes silently fell back to asking the user.

Mint and write the code inside fill_context, as a password fill does; a backend without a code
(or failing to give one) still falls back to the user's prompt.
2026-10-25 05:32:43 -07:00
Teknium
895eb4ed9c feat(vault): login backends only from bundled or verified/official catalog plugins
Password-manager integrations must come from verified sources. ctx.register_login_backend
now refuses every plugin that is not bundled with Hermes or installed from the plugin
catalog at tier verified or official and at the catalog's reviewed pin.

Provenance is read from the installer-owned .install-metadata.json catalog block of the
manager's own home (tier, pin, allow_removed), never from the plugin tree, so a repo that
commits a forged .hermes-catalog.json gains nothing. Local directories, Git URL installs,
community-tier entries, --ref (off-pin) and --allow-removed installs, project plugins and
pip entry points are refused with a warning that names the rule. No config key relaxes it.

The registrar table gains an `admit` option (module:function over the manifest, judged under
the manager's home before the registry is touched); the factory moves from plugins.py into
plugins_registrars.py to carry it.
2026-10-25 05:32:43 -07:00
Teknium
d39883cf8c fix(vault): a plugin backend returning malformed data only breaks itself
VaultItemMeta does not type-check its fields, and browser_vault_list reads
them (len(meta.allowed_origins)) outside its per-backend guard, so one plugin
item with allowed_origins=None failed the whole listing, local vault included.
A fill_context() returning a non-context-manager raised AttributeError past
the PluginBackendError boundary (the attribute lookup ran before _call).

Plugin metas are now type-checked inside the plugin boundary (a malformed
list or meta is the plugin's fixed-text error), and fill_context's factory and
__enter__ lookups run inside _call. Review: Greptile on #143964.
2026-10-25 05:32:43 -07:00
Teknium
b2f6533cd8 fix(vault): plugin login backends only ever touch their own entries
A password-manager plugin registered with ctx.register_login_backend shares
browser_vault with the Hermes vault, 1Password and Bitwarden. On the branch
head the core consulted the plugin's own owns() (a greedy plugin received
op:/bw:/other plugins' handles), listed whatever ids the plugin returned
(spoofed vault_/op: handles), let a second plugin take over a registered
name, let a needs_unlock plugin drive the Hermes master-password prompt under
any label, read name/prefix through properties that can change after
validation, and copied plugin exception text into the model-facing list result.

Every plugin backend now reaches the vault tool only through a core-owned
PluginLoginBackend (agent/vault_backends/plugin.py):
- namespace is "<registry key>:"; ownership is decided by the core, items and
  metas outside it are dropped, resolve_* refuse foreign handles;
- the plugin gets the handle and nothing else; needs_unlock is always False;
- plugin exceptions and wrong-typed values become a fixed-text
  PluginBackendError raised outside the except (no chained context).
Registration refuses descriptor name/prefix, prefix != "<name>:", built-in
names and prefixes (derived from the built-in classes), held names, and
needs_unlock. The fill wrapper turns only PluginBackendError into a typed
refusal, so built-in fills behave as before.
2026-10-25 05:32:43 -07:00
Teknium
6a8b466263 fix(vault): bind one-time-code fills to the saved login's origin
browser_vault enter_code minted a saved login's TOTP code and wrote it into
whatever page the session was on; the password, card and address fills
already refused a page outside the item's saved origins.

Every fill of a stored secret now passes one guard, _bound_page_origin,
before the backend resolves any value: the page origin must exactly match
one of the item's saved origins, else origin_mismatch and nothing is
resolved, prompted or written. The in-page write re-asserts that saved
origin. The payment confirmation is asked only after the origin check.
enter_code without a handle still asks the user, as before.

Tests: one per fill path (OTP, password, card, address, save-then-fill)
asserting refusal before resolution on a foreign origin, plus the saved-
origin OTP success pinned to the item origin.
2026-10-25 05:06:56 -07:00
Teknium
26e8e3f4d5 Memory entries stay removable after the char limit is lowered (salvage #133029) (#144240)
* fix(memory): an entry written before a limit was lowered stays removable

The drift guard reads any entry longer than the whole-file char limit as
free text an external writer appended, on the premise that no tool write
can produce one. Lowering memory_char_limit or user_char_limit breaks that
premise: a well-formed file whose entry was written under the old limit
then refuses every replace and remove (tool, approval replay and the
Journey/dashboard delete alike) and writes a .bak each time, while adds are
blocked by the total. Pruning, the documented way back under the limit, is
refused, so the store stays locked until hand-edited.

A file that round-trips but carries an oversized entry now refuses only a
write that adds or rewrites text. A write that only deletes entries goes
through; when it drops an oversized entry the .bak snapshot is still taken
first and returned as drift_backup, so text glued onto an entry without a
delimiter is never deleted without a copy. Round-trip mismatches are
refused as before.

* fix(memory): a refused write beside an oversized entry still names that entry

With deletions now allowed past an oversized entry, a replace or edit that blows the budget
because of that entry came back as a plain budget refusal ("shorten the new content") with no
snapshot, although the oversized entry is the real obstacle. An over-budget refusal next to an
oversized entry returns the drift error and its .bak again; other refusals (no match, would
empty the store) pass through unchanged. The Journey edit/delete closure reports its budget
refusal through _error so the class is visible.

The Journey drift test (43d3d4e851) pinned "delete is refused beside free text"; it now pins
the edit refusal and that a delete leaving the oversized entry in place goes through, which is
the ruling for #133028 (removes must work while the store is over its limit).

* fix(memory): delete-only batches prune past a lowered cap; snapshots never overwrite or go missing

Review round (Greptile on e0ca0c027a8):
- A remove-only batch skips the final budget check like a single remove (the empty-store guard
  still applies), so pruning two small entries beside an oversized one is one call, not two.
- Snapshots are created exclusively (.bak.<ts>, then .bak.<ts>.<n>): two deletes of oversized
  entries in the same second no longer overwrite the first snapshot with content that lacks
  what the first delete removed.
- A delete that drops an oversized entry is refused when its snapshot could not be written,
  instead of deleting possibly glued free text with no copy.

* test(memory): freeze the clock so the same-second snapshot test cannot pass by luck

Greptile on 2eba9c5e78a: with the real clock, two deletes straddling a second boundary get
distinct backup names even without exclusive creation. Pinning time.time makes the collision
certain; reverting to overwrite-mode writes now fails the test.

* chore: retrigger CI (lost synchronize event)

---------

Co-authored-by: John Paul Soliva <soliva.johnpaul@icloud.com>
2026-10-25 03:00:43 -07:00
Teknium
079b38cd07 fix(tools): tool_search catalog keeps small servers' descriptions next to a huge one
Measured on a real config with an 832-tool Unreal MCP server plus blender (30) and
meshy (28): once the listing collapsed Unreal to its one summary line, every other
server stayed names-only, although their full lines fit the 4,000-token budget.
Step 3 of build_catalog_listing_with_form now retries the uncollapsed servers in
full form before names-only.

Two description fixes in the same block:
- one-tool groups drop their "<label> tools (1):" heading and render as bare lines
  under the catalog header (placed first so they never read as members of the
  group above);
- the connectors sentence no longer cites example apps (Gmail, Linear) the user
  may not have connected. Hosted connector tools are never listed (tool_search
  searches them remotely), so the sentence now says searches also cover the
  user's connected app accounts and how their results are named.

Prompt-surface snapshot regenerated (stock CLI tools: 11,490 -> 11,468 tokens).
2026-10-24 18:55:33 -07:00
Teknium
c98e8dc63a fix(terminal): restore the exit status without re-firing the user's ERR trap
Review finding "Error traps run twice": the PIPESTATUS capture restored the
command's status with `(exit $__hermes_rc)` as the last command inside the
eval. A non-zero restore is itself a failing command, so a user's ERR trap
ran a second time (`trap 'echo T' ERR; false` printed T twice; main prints
it once).

The restore now sits on the left of `&& :`. The list keeps the status, and
bash fires neither ERR nor errexit for a command on the left of &&, so the
eval returns exactly what main's plain eval returns.
2026-10-24 18:48:01 -07:00
Teknium
812c4bb044 fix(terminal): run heredocs and trailing-backslash commands without the PIPESTATUS capture
The capture line is appended inside the command's eval. An unterminated
heredoc read it as body text (written into the user's file or printed),
and a trailing backslash joined onto it, so `echo hi \` printed `hi`
instead of `hi \`. Those commands now run exactly as before; their runs
stay unattributed, as on main. The wrapper test now asserts the exit code
and output the model sees, not only the exit code.
2026-10-24 18:48:01 -07:00
Teknium
a615a56096 fix(terminal): default the pipe marker so env fixtures built without __init__ keep working
Environments built with __new__ (tests, plugin shims) have no per-session
_pipe_marker; a class-level empty default makes the wrapper emit no
PIPESTATUS line for them instead of raising AttributeError. Reverts the
fixture edits that papered over it.
2026-10-24 18:48:01 -07:00
BrokeSkill
2b7ab93711 fix(agent): keep shell exit codes when recording pipelines
Capture $? and PIPESTATUS together inside the eval, restore $? as the
wrapper's exit code, and trust a one-element PIPESTATUS only as side data.
Fixes the exit-code regression for if/while/!, pipefail and syntax errors.

Also initialize _pipe_marker in the two hand-built test fixtures, replace
the source-order assertion with exit-code behaviour tests, and drop the
stale claim that a piped run cannot count as evidence.
2026-10-24 18:48:01 -07:00
BrokeSkill
22f3c027be fix(agent): record piped verification runs and stop double nudges
The bash wrapper now reports PIPESTATUS, so a verifier at the head of a
pipeline is scored by its own exit status instead of the last filter's.

Command matching also collapses interpreter paths to their family and skips
the flags that leave ``-m <module>`` intact (-I, -B, -u, -O, -W/-X with their
value, py -3.x), so ``pytest | tail`` and ``.venv/bin/python -u -m pytest``
count as the runs they are. Flags that exit before the module runs stay
unmatched.
2026-10-24 18:48:01 -07:00
Teknium
9d558a14a1 fix(delegation): a one-shot-started session joins children on interactive turns
A `hermes chat -q` session resumed interactively keeps its pinned one-shot
delegate_task schema (children "are joined and return in this tool call", no
list/steer/stop) because tools[] must stay byte-stable, but dispatch decided
per admission and detached the children on the finite=False turn. Dispatch now
reads the agent's frozen one-shot pin (agent_is_oneshot) and joins inline.

Follow-up to #144177 (independent review D1).
2026-10-24 18:45:02 -07:00
Teknium
b044f7cf28 fix(memory): a one-item remove or duplicate add is not refused on an over-cap store
Greptile on 41ed1f061d9 (Forgetting one fact can fail / Duplicate adds inflate space
advice): after a cap is lowered below the store's size, the one-item batch refused a
remove that the legacy remove allows (it has no budget check), and a duplicate add
reached the overflow error with an inflated excess instead of legacy's "already
exists". A one-item batch that does not grow the store skips the final budget check;
every other batch keeps it.
2026-10-24 18:44:31 -07:00
Teknium
4353f850d3 test(memory): pin that a background review cannot empty USER.md with a one-item remove
Review finding: the one-item remove batch may now delete the last entry (matching the
legacy single remove). Pin that an unattended background review sending exactly that
batch is staged by the #105921 delete gate and the entry survives (#103419). Red with
the gate bypassed, green on this branch.
2026-10-24 18:44:31 -07:00
Teknium
07af2357ec fix(memory): a one-item add over budget returns the live entries again
Review finding: the legacy single add answered an overflow with current_entries, but
the advertised one-item batch took the #97316 no-echo batch failure, leaving the model
to consolidate against its load-time snapshot. A one-item add batch now returns the
same over-budget response as the legacy add; larger batches keep the no-echo rule.
2026-10-24 18:44:31 -07:00
Teknium
5ae17fccb8 fix(browser): name vision_analyze in browser_exec only when the session has it
Greptile finding "Browser recommends a missing tool": the non-native
browser_exec header picked its vision_analyze pointer from
check_vision_requirements(), which reports whether a vision route exists,
not whether this session exposes the tool, so a session with `vision`
disabled was told to call a tool it does not have (tools/AGENTS.md:
cross-toolset references are added in get_tool_definitions()).

The header now states only the transport fact ("Screenshots are not
attached to this tool's results. Work text-first: ..."), still never
calling the model blind, and model_tools' browser_exec rewriter appends the
vision_analyze pointer when "vision_analyze" is in the session's available
set. The native header (screenshots ride back in the result) never gets it.

Prompt-surface fixtures re-rendered: the stock render has vision_analyze,
so browser_exec gains the pointer (+8 tokens per surface).
2026-10-24 18:44:31 -07:00
Teknium
faef4e0ab8 fix(memory): a one-item remove batch can delete the last saved fact
Greptile finding "Last fact cannot be removed": with operations[] the only
advertised memory shape, the #103419 empty-store guard rejected the one way
the agent can forget the final USER.md/MEMORY.md entry, and its error pointed
at the unadvertised single remove() shape.

A batch of exactly one remove is now the deliberate single delete (same as
remove()); any larger batch that would empty a non-empty store is still
refused. Unattended background forks never reach it: the #105921 delete gate
stages their removes. The refusal text now names the one-item batch.

The #103419 store test now seeds two entries and removes both in one batch
(assertions unchanged), so it keeps pinning the consolidation case.
2026-10-24 18:44:31 -07:00
Teknium
d4403afd9f fix(file-tools): search_files mentions macOS protected-folder pruning only on macOS
The pruning only runs on a darwin host; Linux and Windows schemas carried the sentence for
nothing. Gate it on hermes_platform.host.facts.os_family().
2026-10-24 18:44:31 -07:00
Teknium
38968d7552 fix(memory): memory schema advertises each field once (operations[] only)
Top-level action/content/old_text duplicated the operations[] item fields and new_text was
advertised as an alias in both places. The schema now carries target + operations[] with the
field guidance on the items; the handler still accepts the top-level single-op shape and the
new_text alias (models drift, transcripts replay them).
2026-10-24 18:44:31 -07:00
Teknium
bb216b95bd fix(browser): browser_exec says how screenshots reach the model instead of calling it blind
The non-native header told every model whose screenshots don't ride back in tool results
"Your model cannot view images ... skip the screenshot-driven workflow described below".
The gate (_should_use_native_vision_fast_path) is a routing fact: decide_image_input_mode is
"text" when auxiliary.vision is pinned explicitly (by design, #16506) or the catalog cannot
attest the model. A vision-capable main model read the line against itself, and no
screenshot section follows the header.

Three honest variants now: attached natively (unchanged), "not attached to this tool's
results; pass the capture_screenshot() path to vision_analyze" when the vision_analyze gate
(check_vision_requirements) has a route, and "no vision route is configured" otherwise.
Lightpanda keeps its own text-first line without the misleading prefix.
2026-10-24 18:44:31 -07:00
teknium1
6e573f3746 fix(browser): text-only header no longer tells vision models they cannot see images (#131568)
The browser_exec description picks its text-first header from
_should_use_native_vision_fast_path(), which measures whether screenshots can
ride back inside TOOL RESULTS for the active provider/model. The header then
asserted a model-level fact ("Your model cannot view images") that was never
tested, and a vision-capable model on such a provider (deepseek-flash in the
report; nous/claude on this host) quoted it against itself and skipped an
image the user had attached to the conversation.

Reword the header to state only what was determined: screenshots will not
reach the model through this tool's results, work text-first, and this says
nothing about user-attached images. Same guidance, no capability claim.

Reported and diagnosed by @dcdc4747 in #131568.
2026-10-24 18:44:31 -07:00
Teknium
df92e33081 fix(skills): enforce the description limit on every write to the root SKILL.md
Greptile "Explicit paths skip the limit": patch(file_path="SKILL.md") and
write_file("SKILL.md") reach the skill's root SKILL.md but skipped the
60-char description check that create/edit/plain patch run. The check now
lives in _guarded_write whenever its target is the root SKILL.md, using the
original it already reads to keep unchanged legacy descriptions editable;
the per-action checks and edit's extra read are gone.
2026-10-24 17:11:13 -07:00
Teknium
3a3bf5648e fix(skills): one row per one-skill category, word-boundary clips, enforced 60-char descriptions
- A category holding one skill renders as a single top-level row
  ("  - computer-use: ...") instead of a header that repeats the name.
- Descriptions over SKILL_PROMPT_DESC_LIMIT (60) are clipped at a word
  boundary, never mid-word; plugin skill rows are clipped too (they were
  not at all). Snapshot v5 so cached mid-word clips are rebuilt.
- skill_manage rejects a description over 60 chars whenever the call
  writes it (create, or an edit/patch that changes it); an unchanged legacy
  description no longer blocks a body edit. The schema text says the limit
  and that a description must not repeat the category name; skills/AGENTS.md,
  hermes-agent-skill-authoring and the curator prompt match.
- test_authoring_standards reads the limit from SKILL_PROMPT_DESC_LIMIT so
  the CI hardline and the index clip cannot drift apart.
- prompt_size and the skills-index turn delta read both row depths.
2026-10-24 17:11:13 -07:00
Teknium
9515798e45 fix(skills): load a plugin skill called with the index heading as a prefix
The skills index lists plugin skills under a "plugin" heading and the
skill_view schema says to use "the qualified form plugin:skill", so models
call plugin:agent-plugin-blender-5a80e4ba:blender. That parsed as namespace
"plugin" and returned not found, so a portable plugin's skill (Blender)
never reached the agent. A bare skill name holds no colon, so a leading
"plugin:" before an already-qualified name is dropped.
2026-10-24 04:11:24 -07:00
Teknium
7ae117eb4c fix(plugins): name portable plugin skills after the plugin, not a hashed namespace
A portable plugin's skills registered as agent-plugin-<slug>-<sha8>:<skill>
(agent-plugin-blender-5a80e4ba:blender) because one manifest field named both
its plugin-data directory and its skill namespace. The hash only matters on
disk. Skills now take the plugin's own name (blender:blender), the form every
native plugin skill uses; a clash with an already-registered qualified name is
skipped with a warning naming the owner, as before. The data directory keeps
its hashed name, so no plugin data moves, and skill_view still resolves names
saved in the old form.
2026-10-24 04:01:10 -07:00
Teknium
5894e750c3 test(mcp): let the reconnect tests' fake streamable_http_client take SDK kwargs
The fake only accepted (url, http_client), narrower than the real mcp 2.3.0
signature, so passing max_sse_event_size raised TypeError before either
test reached its reconnect/shutdown assertion. Assertions unchanged.
2026-10-23 17:40:33 -07:00
Teknium
a5a0a4ae33 refactor(mcp): trim the 1 MiB SSE fix to the transport argument
mcp is pinned at 2.3.0, whose streamable_http_client always takes
max_sse_event_size, so pass the wire cap directly instead of probing the
signature. Drop the error-message rewording and its test churn: with the
SDK cap lifted, the 1 MiB failure it reworded no longer happens on
Streamable HTTP, and the wire cap's own messages are unchanged. One
invariant test stays (a >1 MiB tools/list connects; red on main).

Live: Unreal Editor 5.8's MCP server streams a tool result as SSE whenever
the call carries a progressToken (every gateway/CLI turn does), and its
CaptureViewport result is ~1.9 MB. On main that call fails with "SSE stream
failed: Server-sent event exceeded the 1048576 byte limit"; with this
change it returns the 1.89 MB image result.
2026-10-23 17:40:33 -07:00
khanaleem727-eng
7daa2e75d1 fix(mcp): accept SSE responses over 1 MiB on Streamable HTTP
httpx2 2.12 bounds every EventSource at 1 MiB by default, and the mcp
SDK's Streamable HTTP client inherits that bound unless the caller passes
max_sse_event_size. Hermes never passed it, so a server that sends
tools/list as one ~1 MiB SSE event (a 162-tool catalog) failed to connect
and was parked with 0 tools, although Hermes' own wire-body cap is 10 MiB
per event.

- Hand the SDK the wire-body cap as max_sse_event_size when its
  streamable_http_client accepts the argument (mcp 2.3), so one limit
  judges each event. Initial connect, reconnect, the SSE resume paths and
  `hermes mcp test` all build the client through this one function.
- Raise the wire cap's oversized-event error as the SDK httpx's SSEError
  too. The SDK reports an SSEError's message on the waiting request; any
  other error mid-event was swallowed as "SSE stream ended without a
  response" or answered by a Last-Event-ID reconnect that fetched the
  same event again.
- Word every cap violation as "MCP response exceeded N bytes", and
  translate httpx2's own limit message the same way. The legacy SSE
  client has no event-size argument in any mcp release, so it keeps the
  1 MiB SDK limit; its failure now says so, and `hermes mcp test` points
  at the transport setting instead of "check the server is running".

The new test serves real catalogs from a local MCP server subprocess:
just over 1 MiB on Streamable HTTP connects (red on base), and events
over each cap fail naming the exact byte limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 17:40:33 -07:00
teknium1
a8144c63ab fix(mcp): mask every secret-shaped argument and show arguments on the text approval
Review fixes:

- Mask a credential-named field whatever its value type (a numeric
  password, a list of credentials), and mask API-key header names
  (x-api-key and the rest of SECRET_HEADER_NAME_LIST). The JSON text
  form of those headers never matched the header redaction pattern.
- The gateway plain-text /approve prompt cut every command at 200
  characters, so a platform without buttons (or a card send that failed)
  showed the trust-gate header and none of the arguments. It now uses the
  base button card's preview budget, so a text approver sees what a card
  shows. Dangerous-command text prompts show more of a long command too.
2026-10-23 17:39:48 -07:00
teknium1
84f6e1cd32 fix(mcp): keep trust-gate arguments redacted and legible on every approval surface
Follow-up to the salvaged argument display:

- Redact with force=True. The CLI prints the prompt as-is, so with
  security.redact_secrets off an API key in the arguments reached the
  terminal.
- Mask string values under credential-named fields (is_secret_field_name):
  the text redactor alone left db_password, client_secret and private_key
  values readable.
- Drop the inner ```json fence. Every surface already renders the prompt
  in a code block, and a nested fence closes Discord and Slack blocks early.
- Cap the JSON at 1,200 characters so the whole card fits Discord's
  2,000-character message cap with the truncation marker intact.
- Escape bidi/format and C1 control characters so the card cannot show
  something other than what the server receives.
- Omit the block when the call has no arguments, and keep it after the
  spend-limit notice and cost lines (the text fallback shows only the
  first 200 characters).
2026-10-23 17:39:48 -07:00
fangliquanflq
2b6f15b4a1 fix(mcp): show redacted, size-capped arguments on untrusted MCP write approvals
The trust-gate approval card named only the server and tool, so the
approver could not see what the call would mutate. Pass the call
arguments into the gate and render them as redacted, size-capped JSON.

Salvaged from #96710 onto current main (the gate now lives in
tools/mcp_tool_handlers.py). The consent-scope half of #96710 is
superseded by #143780 and is not included.
2026-10-23 17:39:48 -07:00
Teknium
1ae21357f4 fix(mcp): YOLO and approvals.mode off skip the untrusted-server trust prompt
security.md documents approvals.mode off as "disables all approval checks,
equivalent to --yolo", but the MCP trust gate never consulted the bypass, so
a session on /yolo, --yolo, HERMES_YOLO_MODE or approvals.mode off was still
asked before every write call on a trust: untrusted server (Meshy users on
yolo kept getting prompted).

The gate now treats tools.approval.is_approval_bypass_active() (the
canonical three-source check: frozen --yolo, the calling session's /yolo,
approvals.mode off incl. a hosted-room policy) like a remembered grant. The
spend limit is untouched: it is a budget, not an approval, so a call that
would cross a declared spend_limit still asks, and is refused where nobody
can answer (cron, -q).
2026-10-23 16:54:27 -07:00
Teknium
5e260854c2 test(mcp): trust-gate approval scopes match what each prompt offers
Session/Always on the untrusted-server gate stop the next prompt for that
tool only (driven through the real gateway approval queue); unkeyed consent
offers Once / Deny on the gateway card and the CLI panel and records
nothing. Both red on origin/main.
2026-10-23 16:16:43 -07:00
Teknium
95505c60e9 docs(tools): lead every tool description with its key capability
The deferred tool_search catalog shows each tool's first sentence clipped to
60 chars, so lines like 'image_generate: Generate high-quality images from
text prompts, or edit /…' hid that it edits with reference images on the
user's configured model. An agent skipped it and called FAL directly with a
hardcoded model.

- catalog line cap 60 -> 80 (CATALOG_SUMMARY_MAX_CHARS); every built-in
  tool's first sentence now fits and leads with what it does
- image_generate/video_generate say they use the configured model;
  image_generate says to use it rather than direct API calls/scripts
- web_search/web_extract/browser_exec name when to use each other
- drop a duplicated cronjob sentence and filler in skill_view/video_generate
- regenerate tests/fixtures/prompt_surface
2026-10-23 16:04:50 -07:00
Teknium
e6af359887 fix(image_gen): inline local source paths for FAL edits on the local backend
On the local terminal backend _confine_source_images is a no-op, so a raw
host path in image_url / reference_image_urls reached FAL (direct and the
managed Nous gateway) verbatim and failed with file_download_error, even
though the schema advertises absolute local paths.

The FAL edit request now resolves sources through the guarded
resolve_local_source_to_data_url (credential-read guard, image sniff) and
downscales inlined images to stay under the managed gateway's ~4.5 MB
body limit (probed: 4.0 MB base64 accepted, 4.5 MB -> HTTP 413).
Plugin providers keep their own host reads.

Salvages the intent of #53921 through the guarded resolver.

Co-authored-by: liuhao1024 <11816344+liuhao1024@users.noreply.github.com>
2026-10-23 15:54:23 -07:00