_early_reject_unauthorized dropped the decoded thread_id, so a thread-scoped
profile_routes entry checked the default profile's pairing store: a caller
approved only in the routed profile had slash commands (even /stop) and
messages in that thread dropped. Pass thread_id from both the slash and the
message path to _is_sender_authorized and the build_source fallback.
Names resolved for a slash turn are awaited before the handoff and Bolt runs
callbacks concurrently, so a /queue whose cold users.info answered late
reached the gateway FIFO after a later one. A slash now reserves its
session's slot before any lookup and hands over only after the slash ahead
returned from handle_message; a slash cancelled while waiting still chains
the one behind it. /stop, /approve, /deny, /pause take no slot.
Ported from #128722 (9b719083, eb546b6a) into adapter_slash_lane.py.
Co-authored-by: John Paul Soliva <soliva.johnpaul@icloud.com>
Move the two pure slash-payload helpers (gateway text, thread anchor) out of
the adapter facade so the slash-turn parity fix keeps adapter.py under its
health cap. No behaviour change.
/pause engages the emergency stop and starts no turn, like /stop and /approve,
so a cold users.info must not hold it back. Ported from 9b719083 in #128722
(its arrival-order handoff lane is left out).
Co-authored-by: John Paul Soliva <soliva.johnpaul@icloud.com>
The names the slash path resolves (users.info, conversations.info) were awaited
before the event reached the active-session dispatcher. With a shared channel
session, a second operator's /stop sat behind their uncached users.info while
the first operator's worker kept running.
/stop, /new, /reset (the interrupt-then-dispatch commands) and /approve, /deny
start no turn of their own, so they are handed over before any lookup. Commands
that do start a turn (/queue, /retry, /goal, ...) and free-form questions keep
the names and the channel prompt.
The message path rejects an unauthorized sender before any lookup (5bb933eedf); the slash path now resolves the channel and user name, so a sender the gateway was going to reject cost a conversations.info and a users.info first. Ask the same early gate before resolving. In a channel the runner only drops such a sender, so stop there. In a DM it answers per unauthorized_dm_behavior (pairing code or decline), so the event still reaches it, without names, exactly as before this branch.
Docs: N/A, slack.md already says an unauthorized DM gets the pairing prompt.
`/hermes <question>` can open a new session, and bound skills load only
when a session starts. The slash event carried no auto_skill, so a session
opened that way never loaded the channel's slack.channel_skill_bindings,
unlike one opened by an ordinary message. Resolve it the same way the
message path does.
_handle_slash_command built its MessageEvent without channel_prompt and its
source without chat_name/user_name, unlike the message path. A /hermes turn
ran without the configured channel_prompts and the bot identity line, and as
a human turn it re-pinned channel_pin to None and re-keyed the pinned
session-context prompt; the next ordinary message flipped both back, so every
slash turn cost two agent rebuilds and two prompt-cache misses. Synthetic
events copied from it (/retry, /queue, /steer fallback, /goal kickoff)
inherited the gap.
Resolve the names and the channel prompt with the same helpers the message
path uses.
The registration hooks had grown the moved adapter past 1,000 lines and put
two forward-only wrappers next to the message code. register.py now holds
the configured/validate checks and register(), and registers the setup and
standalone-sender functions directly. adapter.py is back to 983 lines; no
behaviour change (composite live probe matches main).
Addresses the Greptile finding on this PR.
The loader executes the package as hermes_plugins.platforms__signal, and
`from .adapter import register` gave the registry that synthetic copy of the
adapter, while the adapter's own absolute sibling imports loaded a second
plugins.platforms.signal.adapter. The rate-limit scheduler stayed one object,
but SignalAdapter existed twice, so isinstance checks and monkeypatches on the
canonical path missed the live adapter, and every start imported it twice.
Register by the absolute name, as Yuanbao already does; a test pins both.
Also fix the namespace named in Yuanbao's __init__ comment.
Found by the independent review of this branch.
The six adapters now live at new paths, so the ratchet reads their moved
functions as new code held to today's targets:
- Standalone senders (bluebubbles, qqbot, weixin, yuanbao) are real
catch-all boundaries that turn any failure into an error result; they now
log the traceback at debug (behaviour unchanged).
- The Signal and Weixin setup wizards' catch-alls get reviewed waivers: any
probe/QR failure is shown to the user, who decides.
- QQ Bot's media existence check runs off the event loop (ASYNC240).
- Yuanbao's registration block moves to plugins/platforms/yuanbao/register.py
so adapter.py stays at main's size cap; it imports the adapter by its
canonical name, keeping one YuanbaoAdapter class object.
The composite live pass showed `hermes gateway setup` listing Signal and Weixin as
"not configured" for a profile whose credentials live only in .env, while main shows
"configured". The old static wizard rows read get_env_value (.env-backed); the plugin
is_connected checks read only config + the scoped environment, which a plain CLI
process never fills from .env. QQ Bot already had this fallback.
Both now fall back to env_is_connected over the same credential pair. A test pins the
.env-only status for all six moved platforms (red for signal and weixin before this).
With signal, weixin, bluebubbles, qqbot, yuanbao and whatsapp_cloud now
bundled platform plugins, gateway/platforms/ keeps only the base class and
the HTTP ingress adapters (api_server, webhook, msgraph_webhook). (The
now-unused _gateway_platform_module helper and the setup wizard's
second-credential map were dropped while integrating the weixin and
yuanbao "drop core wiring" commits.)
- ffmpeg calls in the Signal and QQ adapters get stdin=DEVNULL: they now
sit under plugins/, which check_subprocess_stdin scans (gateway/ is not
scanned), and ffmpeg reads stdin for its interactive keys.
- Setup wizard: collapse the blank lines left by the removed static rows.
- Developer docs (EN + zh-Hans) describe gateway/platforms/ as core base +
HTTP ingress adapters and list the six platforms under plugins/platforms/.
is_connected now falls back to env_is_connected(QQ_APP_ID, QQ_CLIENT_SECRET)
(.env-backed, scope-aware), so 'hermes gateway setup' shows QQ Bot as
configured for a .env-only profile, matching base.
(cherry picked from commit 19968fb98a96a99e59212fea7cf3129c81c5b7df)
- plugin.yaml name qqbot-platform (bundled-plugin convention)
- drop env_enablement/apply_yaml_config hooks and platform_hint: core
config_env _ENV_STEPS and PLATFORM_HINTS still own them, the hooks were
new behaviour (markdown/env seeding) the move must not add
- drop validate_config/max_message_length: base never config-gated or
chunked QQ in send_message (REST sender truncates at 4000)
- install_hint carries the old _BUILTIN_ADAPTERS warning text
- drop the _send_qqbot compat alias
- replace env-seeding tests with a registration-shape test
(cherry picked from commit b34a6d21e42d934555a2e6243c9a126dc0d5de42)
QQ Bot is a messaging platform, so its adapter, setup, and standalone sender belong in plugins/platforms/qqbot behind one register() entry. The core keeps the shipped-platform name lists, so webhook, cron, and prompt hints still treat qqbot as built-in.
(cherry picked from commit a7eb428aad0cc69ea098747b435e1e0e1d7e3b67)
gateway/platforms/signal{,_format,_rate_limit}.py -> plugins/platforms/signal/
(adapter.py + satellites, history-preserving renames). register(ctx) declares
the PlatformEntry hooks core used to hard-wire: requirements probe, config
gate (with the old 'SIGNAL_HTTP_URL or SIGNAL_ACCOUNT not configured' warning),
is_connected, allowlist/home env vars, max_message_length=8000, emoji, pii_safe,
allow_update_command. The out-of-process JSON-RPC sender (attachments still
ride the 'attachments' param, shared rate-limit scheduler) moves to
standalone.py as standalone_sender_fn; the setup wizard moves to setup.py as
setup_fn, unchanged flow. Tests repointed at the plugin path.
Co-authored-by: Karl Johannisson <karl.johannisson@gmail.com>
(cherry picked from commit eb9f7e730a39d702aea2505855631e3137ab509b)
gateway/platforms/bluebubbles.py -> plugins/platforms/bluebubbles/adapter.py (git mv) plus
plugin.yaml/__init__.py and register(ctx): adapter_factory, check_fn (+ the old
_BUILTIN_ADAPTERS warning as install_hint), is_connected, required_env, setup_fn (the
former hermes_cli/setup_platforms._setup_bluebubbles), standalone_sender_fn (the former
tools/send_message_senders._send_bluebubbles), allowed_users/allow_all/cron env vars,
pii_safe, allow_update_command, emoji. Tests follow the new module path.
(cherry picked from commit 870d4a169e4f89cbb2689ccd1db555ad15cea216)
gateway/platforms/whatsapp_cloud.py -> plugins/platforms/whatsapp_cloud/adapter.py and
hermes_cli/setup_whatsapp_cloud.py -> plugins/platforms/whatsapp_cloud/setup_wizard.py (git mv).
register(ctx) wires adapter_factory, check_fn, is_connected, required_env, install_hint,
setup_fn (the same wizard `hermes whatsapp-cloud` runs), allowed_users/allow_all env,
cron_deliver_env_var, label/emoji. gateway/platforms/whatsapp_common.py stays in core
(shared with the Baileys plugin and CLI helpers). Tests and docs point at the plugin path.
Co-authored-by: sprmn24 <oncuevtv@gmail.com>
(cherry picked from commit a3b08efc0249c2dcd3472e4a25addc3f3a2b0d5c)
Re-authorization re-reads config through load_gateway_config(), whose
Discord hook copies YAML allowed_roles into DISCORD_ALLOWED_ROLES (first
writer wins) outside multiplex, and env keeps precedence in _gate_raw.
So a role removed from YAML is revoked at once only for a multiplexed
profile (the copy is skipped); on a single-profile install it stays
granted until restart, as for ingress and as on main.
The revocation test passed only because its fixture deleted that env
var. Replace it with a parametrized test through the real loader: two
re-authorizations around a YAML edit, multiplexed (revoked) and single
profile (still granted, env holds the copy). Correct the comments that
implied immediate revocation. No behaviour change.
Refs #134889 (MSG-7)
Refs #139162
Refs #139148
The durable re-authorization read DISCORD_ALLOWED_ROLES from the scoped
env or the raw top-level `discord:` block only, so a profile that sets
its role allowlist under `platforms.discord` (flat or `extra`) admitted a
role-authorized member at ingress and then dropped the message with
permission_denied.
Recovery now resolves the gate with the same `_gate_raw` ingress uses,
applied to the Discord PlatformConfig that `load_gateway_config()` builds
for the transport profile at check time: scoped env first, then `extra`
with the loader's precedence (`platforms.discord.extra` over the flat
key and the top-level block). Reading current config instead of the
connect-time `self.config` keeps a config revocation effective.
Refs #134889 (MSG-7)
Refs #139162Fixes#139148
Co-authored-by: 686f6c61 <6115107+686f6c61@users.noreply.github.com>
gemini-4-argon is served on the per-user-quota endpoint (a bogus slug 404s; argon answers 429 quota on an account without headroom). Listed after 3.1 Pro so the default model and wire are unchanged.
The Mattermost adapter built inbound events with `media_urls or None` /
`media_types or None`, so every post without an attachment carried None.
Native admission (`_validate_native` in gateway/session_envelope.py)
requires both fields to be lists, as MessageEvent declares them, and
refused every plain text post with `invalid_params`. Commands bypass
admission, so /reset still worked while normal messages failed.
Pass the lists `_download_attachments` already returns. Mattermost was the
only adapter with this pattern.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit c0f32ce5a5c0d633bf4e73a0581ad18b07ee4171)
The bot's speaker re-reads say_queue.jsonl after speaking and rewrites it
without the spoken head; a meet_say append from the agent process landing
between the re-read and the rewrite was truncated away, so a request
reported as enqueued was never spoken. Appenders and the speaker's
re-read+rewrite now share a cross-process lock beside the queue file.
_client ran pm.ensure_import("parallel-web") before cached_sdk_client
checked PARALLEL_API_KEY, so with no key and the SDK not installed (lazy
installs disabled) the search failed with "Parallel SDK not installed"
instead of the missing-key error. cached_sdk_client already resolves the
key first and then ensures the extra; drop the duplicate pre-check.
Fixes test_keyless_disabled_falls_through_to_key_error and
test_tier_paid_forces_keyed_without_key.
375 commits from main (0e427d788d). 24 files conflicted; the resolutions that carry a decision:
- /initiate-setup: main removed the command (25bf722063). Its gateway rewrite, CLI handler and the
Desktop kickoff go with main; this branch's command-layer admission of it is dropped too
(gateway/session_commands.py _PROMPT_COMMANDS, its slash.exec test row, the parity doc row), and
the Desktop slash dispatcher loses the `hidden` option that only the kickoff used.
- Code this branch moved out of its old file, carrying main's edits to the moved copy:
first-contact notes (gateway/run_turn.py -> run_turn_prepare.py: no message/setup_command),
the TUI agent factory (tui_gateway/server.py -> agent_factory.py: onboarding toolsets at build,
setup_beat/set_theme lifecycle cards, no cli platform extras on a coding selection), the serve
lifespan (web_server.py -> web_server_app.py standalone_lifespan: first-install probe before the
state.db reconcile, onboarding due answer after the setup bootstrap), and the compression child
publish (the shared _publish_compression_child_on_conn reads the parent's model_config).
- agent/auxiliary_client.py: both import changes (_route_key from main; this branch's move of
_without_structured_output_format).
- Desktop: main's onboarding run (decideOnboarding, OnboardingEnd, card-waiting Send) replaces the
kickoff; this branch's prepared-submission slash path, request_id on session.create and
PreparedImageRecovery stay. Pool-limits imports are dropped (this branch removed the pool).
createBackendSessionForSend takes main's (preview, overrides) signature.
- ci.yaml detect job: main's `ref: inputs.commit` plus this branch's sparse checkout.
- package.json / lock: main's vitest 4.1.11 plus this branch's ws 8.21.1.
- Generated: gateway-contract.openrpc.json regenerated; parity doc regenerated.
Adds gemini-4-argon to the Gemini, Vertex and OpenRouter/Nous catalogs and makes the
native Gemini client handle Google's long decode (up to 1M output tokens).
- Reasoning effort maps onto Gemini 4's thinkingLevel (low/medium/high). Argon always
thinks, rejects "minimal" and rejects thinkingBudget alongside a level (400s, live):
none -> low with thoughts hidden, minimal -> low, xhigh/max -> high.
- Effort above high buys a long-decode budget on the native endpoints only:
xhigh -> 262,144 output tokens, max/ultra -> 1,048,576 (the API caps it at the
window minus the input).
- generateContent (unary and streaming) follows finishReason CONTINUATION: the same
request is resent with the continuationToken, hops are joined into one turn, one
final finish chunk is emitted. Without this, a non-streaming Argon call that hit the
32,768-token per-request cap came back truncated and reported as finish=stop.
- Usage is summed over hops for cost (matches google-genai and billing), while the
first hop's prompt (initial_prompt_tokens) feeds compaction and the context meter,
so a long-decode turn does not trigger an early compaction.
- Vertex express keys can reach global-only models: a project-scoped
.../projects/<p>/locations/global base is now native (only .../endpoints/openapi
stays OpenAI-compatible).
- 20 min read timeout on the native client and a 600 s stale floor for gemini-4,
per Google's long-decode guidance.
- Pricing at the introductory $2 / $10 / $0.10 rates.
Previous merge base 3b63f7b0a4. Seven conflicts, all Desktop; each keeps
both sides' behaviour.
apps/desktop/src/app/chat/composer/hooks/use-composer-submit.ts
main: composer text answers ANY parked card through the new
store/parked-card-answers registry (answerParkedCard), so
answerSetupCard is no longer imported here.
branch: added `import type { BusyInputMode }` for the configured
busy-input mode.
merged: both imports kept; answerSetupCard dropped (main's registry
reaches it via clarify.ts answerClarifyText).
apps/desktop/src/app/chat/composer/hooks/use-composer-submit.test.tsx
main: "answers one question per submit while a busy turn waits"
now expects clarify.lock (no steer) and adds "brings the card
back when an earlier lock fails after the last answer cleared it".
branch: the old body of that test with onSteer(..., 'interrupt').
merged: main's body (main changed the contract: typed text is the
answer, not a steer); the branch's busyInputMode harness and
every other 'interrupt' assertion stay.
apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/input-requests.ts
main: connectionRequestNoticeBody() (display card with no targets
falls back to connectors.title) + ConnectionRequest type import.
branch: handlePromptSettledEvent() for approval/clarify.settled.
merged: both functions, adjacent.
apps/desktop/src/app/session/hooks/use-session-actions/index.ts
main: moved desktopSessionCreateParams verbatim into
session-create-request.ts and imports it from there.
branch: added the resume-owner import block.
merged: resume-owner imports + `{ createGatewaySession,
desktopSessionCreateParams }` from session-create-request
(the branch's copy of the function was byte-identical to the
base and is removed by main's hunk).
apps/desktop/src/components/assistant-ui/clarify/pending.tsx
main: seenLocks state so a newly locked answer (composer text)
replaces the staged pick while a seen one leaves card edits.
branch: per-requestId card reset (submit latch + staged picks) when
the canonical gateway reuses the row for the next card.
merged: both; the card reset also clears seenLocks so the next
card's locks are treated as new.
apps/desktop/src/i18n/ja.ts, apps/desktop/src/i18n/ru.ts
main: jaConnectors / ruConnectors split files.
branch: jaBoot / ruBoot split files.
merged: union of imports (key spreads auto-merged).
Lost-line check: every non-blank line main added since 3b63f7b0a4
(79 files) is present in the merged tree.
The per-user-quota endpoint exposes no model listing to user tokens, so the
picker shows the hardcoded fallback list. Replace the older flash aliases with
the current models; lite stays last as the quota reserve.
Conflicts (2 files, 1 hunk each); every main-side change is kept, ported to
where the branch moved the code:
hermes_cli/kanban_db.py (build_worker_context helpers _ctx_cap .. _ctx_comments)
main: f5a6651231c/d56e357556f coerce foreign/text timestamps on read; in
_ctx_role_history the "Recent work" stamp became
_ctx_stamp(_to_epoch(row['ended_at']) or 0, now) instead of int().
branch: moved the whole _ctx_* helper block into hermes_cli/kanban_db_context.py
(kanban_db.py imports it back), deleting it from kanban_db.py.
merged: kept the branch's deletion in kanban_db.py and applied main's change in
kanban_db_context.py::_ctx_role_history as
_ctx_stamp(_kb._to_epoch(row['ended_at']) or 0, now). Main's other
timestamp coercions in kanban_db.py (Task/Run/Comment/Attachment/Event
from_row, _TASK_EPOCH_COLUMNS, release_stale_claims,
_extend_live_stale_claim, task_age) auto-merged unchanged.
hermes_cli/web_server.py (_lifespan)
main: d7830c6f42 reworded one comment in the free-tier bootstrap block
("the ONE place its identity is created" -> "the one boot-time creator
of its identity"; guests are now also created on first connector use).
branch: moved _lifespan's body into hermes_cli/web_server_app.py::app_lifespan.
merged: kept the branch's relocation and applied main's comment rewording in
web_server_app.py.
Merge-induced health fix (no conflict marker; the combination tripped the ratchet):
apps/desktop/src/app/session/hooks/use-cwd-actions.ts::changeSessionCwd
main: 63ed3caa4ba/dbc538547fc grew the function (statusbar cwd change for the
focused chat / tile runtime ids) to CC 20.
branch: added the session_busy refusal mapping (sidebar.projects.moveBusy) in
its catch, +1 branch -> CC 21 > target 20 (scripts/check health blocking).
merged: both behaviours kept; the busy-error mapping moved verbatim into a
module-level cwdChangeError(err) helper. Health back to 0 blocking.
Check: every line main added between 1fd1827726 and 3b63f7b0a4 (317 files) is
present in the merged tree.
The bundled observability/langfuse plugin now ships as the official catalog plugin `langfuse`
(NousResearch/hermes-official-plugins, subdir langfuse) with the same hooks, HERMES_LANGFUSE_* /
LANGFUSE_* env vars and capture modes. Same pattern as the Home Assistant and Spotify moves: a
LEFT_CORE row installs and enables the plugin on `hermes update` / first start for every profile
home that had observability/langfuse (or its bare name) in plugins.enabled and not in
plugins.disabled. Keys alone are not use: the plugin was opt-in.
- left_core_migration: langfuse row + langfuse_in_use; HERMES_LANGFUSE_SECRET_KEY stays a stripped
child-process secret and the public key / base URL stay private env, exactly as core stripped them
while it shipped the plugin. New plugin_key field: `hermes plugins enable observability/langfuse`
(what every pre-move doc said) now names `hermes plugins install langfuse` for this home.
- Core drops the plugin, the `hermes tools` Langfuse category and its post-setup hook (the plugin
prompts for its keys at install), the OPTIONAL_ENV_VARS / _EXTRA_ENV_KEYS rows, the `langfuse`
extra + its PM anchor (uv.lock regenerated with CI's uv 0.12.13), and the
plugin's tests (they moved to the plugin repo).
- Docs (en + zh-Hans): built-in plugins and env-var reference point at the catalog plugin.
Replace the in-tree vendor copy with a community catalogue entry pinned
to the tested standalone source at 9a3642f. Keep contributor attribution.
The entry discloses host compatibility and recovery requirements.
Verified: all 12 repository checks pass; catalogue schema valid; pinned
plugin admission checks safe; standalone real-Hermes suite 1386 passed.
Forward compressor kwargs including bypass_cooldown; derive multimodal
user queries from text parts. Stamp both manifests and add discovery-path
regressions, proven red on the old adapter. Verified: 322 Hermes tests
passed; Ruff, compilation and vendor drift checks pass.
Upstream ba8b995: inspect_compressibility reports guaranteed_savings_pct
and ceiling_class; compress_context gains derive_query — a conservative
deterministic task descriptor for empty/generic queries, marked in the
receipt via query_source/derived_terms with a medium risk floor.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Upstream tameru-compaction-system 1.3.0:
- dependency closure: dropped blocks sharing a rare term with a kept
block AND carrying a qualifier (except/unless/only/until/if...) or
definition cue are restored — cutting them would invert the kept
block's meaning. Budget-bound in fixed mode; trust-risk and
frozen-drop blocks are never resurrected.
- qualifier-aware structured trim refusal: long JSON string values whose
cut tail carries a qualifier cue are kept whole.
- transcript.timing_gate (on by default): suppresses pruning while tool
calls are pending (mid-derivation) and on stuck loops (3 identical
assistant calls — diagnose, don't erase evidence).
- compress_context accepts an iterable query (plan-aware union scoring).
Synced via scripts/sync_to_harness.py; plugin.yaml stamped 1.3.0
(extractive alias stamped via --stamp-only, glue unchanged).
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Synced via scripts/sync_to_harness.py from upstream 1b54ec6. The adapter
formerly named hermes_extractive_engine is now tameru.transcript — the
code was always harness-agnostic (OpenAI-style role/content dicts);
hermes_extractive_engine remains as a compat shim so existing imports
keep working.
Syncs plugins/context_engine/tameru/compress_context.py with
0xWhiteMage/tameru-compaction-system@1b4f8bb. New deterministic
capabilities available to the engine:
- pin_recent positional pinning, min_savings_ratio savings floor,
degraded_view bounded scoring on size-limit breaches
- secrets screen before CCR archival (complements ccr=False here)
- recursion guard refuses to recompact Tameru output markers
- fixed-mode budgeting exempts pinned blocks from the ratio base
- list_ccr + paginated retrieve for CCR recall
- receipts report the deciding selection path
- strategy="auto": extract-first ladder, escalate to summarise on
fail-open
Upstream: https://github.com/0xWhiteMage/tameru-compaction-system