The reader gate only bound plain `name = <config path>` assignments and never scanned pm/, so
direct local-file reads still passed it: `env_path, config_path = ...` then
`config_path.exists()` in tools/send_message_tool.py, and pm/plugins_state.read_home_selection
reading config.yaml with read_text().
The gate now binds tuple-unpacked elements, `self.<attr>` targets and for-loop targets; flags
unbound `Path.<method>(p)`, shutil copies and pm's byte readers (read_bytes_or_none,
file_digest); and scans pm/.
Routed through the backend: send_message_tool's missing-config check and
read_home_selection (same FileNotFoundError / OSError / YAMLError -> ValueError contract).
Marked as file tooling: pm's byte-level compare-and-swap publication/eviction rewrite and the
LKG backup copy, which operate on the local file itself.
Known limit: bindings flow into nested scopes, not across sibling methods, so a `self.x` bound in
`__init__` is not tracked in another method (pm/publication.PluginSelection.publish).
Add hermes_cli/config_backend.py (config-config design §4.1, D10/D11): a
ConfigBackend protocol, the FileBackend (today's behaviour), selection by
HERMES_CONFIG_BACKEND only (default file; 'remote' and unknown values fail
closed with ConfigBackendUnavailable), and path-level helpers
(read_config_doc, read_config_doc_readonly, config_version, config_exists,
write_config_key, write_config_document, supports_file_tooling).
Migrate every direct reader/stat/exists/bypass writer of a user config.yaml
to the helpers (config.py loaders + caches, config_effective, env_loader,
gateway, TUI, CLI watchers, cron, tools, profiles, logging, time). File
tooling (config edit, backups, xAI migration rewrite, raw dashboard editor)
checks supports_file_tooling() first; migrations skip write-back without it.
Add scripts/check_config_yaml_readers.py (CI lint next to the writers gate)
that rejects a direct read of a config path outside the backend.
Ctrl+C, Esc, the Desktop/TUI Stop button, a message that interrupts and
an ACP cancel end the current turn. They also called
async_delegation.interrupt_for_session, so every background subagent the
session had dispatched died with the turn: one Ctrl+C took down a running
/review and both of its sub-reviewers. A background subagent is
independent of the chat that spawned it (Teknium ruling), so a turn stop
now hard-cancels only the turn:
- gateway SessionAuthority.interrupt (Desktop, Ink, classic CLI view,
ACP-through-gateway, messaging interrupts, api_server run cancel)
- tui_gateway session.interrupt (legacy Desktop/TUI stop)
- acp_adapter cancel
The explicit /stop command still ends them (CLI and Ink process.stop,
gateway /stop busy and idle paths), and so does closing or resetting the
session. Reverses the turn-stop half of b71359066c and 659e55ac71d;
tests/gateway/test_canonical_stop_hard_cancel.py now pins the delegation
surviving a canonical Stop.
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).
The deliver description still told the model a CLI or TUI session has
no channel back, so it would keep telling users a default-deliver job
will not reach them. A local chat's cron result is now written into its
history as a note, seen on reopen and by the next turn.
Refs #143547
Its only consumer is the idle reaper in terminal_tool_lifecycle, so it
belongs beside it. Like the rest of that module it reads the env cache
state (_calls_in_flight, _env_lock, _last_activity) from terminal_tool at
call time, so that state stays where tests patch it and no import cycle is
added; terminal_tool re-exports the helper and _execute_remote imports it
from the sibling. No behaviour change.
Refs #143547
_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>
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).
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.
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.
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.
Review P3: pinned_tool_defs resolved names only against what the process had registered. Before the gateway warm-up imports model_tools (warm-up off, failed or still running) a legacy pin resolved to no tools and the miss was cached. Importing model_tools first registers the builtins for the agentless breakdown and the compress preview alike.
Refs #143547
- The connect watch lasts as long as a connect link (10 minutes), so a slow authorization settles connected instead of failed.
- The Connectors page re-reads the sign-in offer timing after a list read first shows a connected app, so the offer comes up without the window regaining focus.
- A guest without the trial gets the statusbar Sign in, and the Connectors guest line gets a Sign in button.
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.
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.
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.
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.
* 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>
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).
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.
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.
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.
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.
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.
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).
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.
Review finding (stale wording): the drift remediation and the missing-parameter error
still steered the model to the unadvertised top-level memory(action=...) shape. Both now
name operations[] (a single change is a one-item list); the legacy shape still executes.
The [BLOCKED: ...] load-time placeholder keeps its memory(action=remove, ...) hint: two
origin/main tests pin that exact text, and that call still works.
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.
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).
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.
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).
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.
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.
Greptile "Disabled `clarify` returns on resume": disabled_toolsets mixes the
caller's configured disables with the automatic session gates, so stripping
every one-shot gate name to carry a pinned clarify also undid a user's explicit
`clarify` disable. The agent now keeps the configured list
(_configured_disabled_toolsets, set at load and on an explicit reload), and only
the one-shot gate's own addition is ignored when judging a carried tool.
Greptile "Resume changes saved tool bytes": restore_agent_tool_prefix ran the
one-shot schema variant after merging the same-code pin, so `hermes -z --resume`
of an interactive session rewrote its pinned delegate_task, and the carried-tool
filter dropped its pinned clarify (the one-shot gate counted as config), then
re-pinned the smaller array: a cache miss now and a reordered tools[] on the
next interactive resume.
The variant now shapes FRESH definitions only (load, MCP refresh before the
merge); the post-merge step is back to required drops. The one-shot clarify
gate is a surface fact like a client-surface toolset, so a pinned clarify is
carried (its handler answers "not available" with no callback).
Maintainer-approved prompt-footprint trims (measured on the Nous endpoint, anthropic/claude-opus-5.5):
All sessions
- The [SKILL_PRUNED] "Skill Safety Rule" (126 tok) left the system prompt: markers only exist after a
compaction, so the compaction handoff now carries the rule whenever a marker survives in the
compacted transcript (context_compressor_tail.with_skill_safety_rule, applied in
_assemble_compressed for LLM and fallback summaries alike). The "## Pruned Skills" block drops
its own parenthetical, which the rule now covers. `hermes sessions repair-prompts` keyed its
"full build" detector on the rule's heading; it now keys on SKILLS_GUIDANCE (present in prompts
built before and after this change).
- The CLI/TUI cron "LOCAL-ONLY" caveat (154 tok) moved from the platform hints into
cronjob_manage's deliver description (a deferred tool: paid only when loaded).
- The Hermes help pointer no longer restates identity ("You run on Hermes Agent (by Nous
Research)") after SOUL.md's "You are Hermes Agent, built by Nous Research."; it now opens "For
help with Hermes Agent itself — ...", which still tells a custom persona what it runs on (22 tok).
One-shot sessions only (-q/--oneshot/-z, and gateway-owned `oneshot` policy sessions)
- No "## Mid-turn user steering" note (253 tok): nobody can steer a one-shot.
- No clarify tool (590 tok): ONESHOT_DISABLED_TOOLSETS is folded into session_disabled_toolsets
(oneshot=...), so the agent tool build, MCP refresh, the tool_search bridge, delegate children and
the gateway's session inventory / tool listings all drop it together. skill_manage stays.
- delegate_task without live control (425 tok): action/subagent_id/message and the
background-delivery paragraph are removed (children are joined inside the call), applied via
toolsets.agent_tool_surface at load and MCP refresh. The one-shot fact is frozen on the agent at
its first tool build so refreshes stay byte-stable.
Interactive tool schemas are byte-identical to main.
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.
- 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.
The schema said "use the qualified form 'plugin:skill'" while the skills
index lists plugin skills under a heading named plugin; models read the
word literally and prefixed it. Placeholders stop the bad call at its
source (+1 tool token); the prefix tolerance stays for older transcripts.
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.
Two portable plugins whose names slug alike (foo.bar, foo-bar) claim one
qualified skill name. A saved hashed name now resolves only through what that
exact plugin registered; a native plugin can no longer replace a portable
plugin's skill (portable duplicates stay refused, native over native stays
last-wins); and the plugins.disabled check matches the owning plugin's key or
name instead of the skill prefix, so disabling foo-bar never blocks foo.bar.
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.
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.
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>
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.