Commit Graph

2983 Commits

Author SHA1 Message Date
Teknium
b490ef0c5b Merge pull request #140186 from NousResearch/fix/pkg7-bots-multiplex
fix(gateway): multiplexed WhatsApp TIME-WAIT, Feishu comment scope, Discord voice, webhook cron profile (package 7, MSG-16, MSG-13, MSG-14, CRON-2)
2026-10-16 21:11:47 -07:00
Teknium
c05c476f14 refactor(telegram): move the reply-anchor normaliser into telegram_ids
The salvaged #139642 normaliser grew adapter.py past its code-health
cap. It is a pure id helper, so it lives beside normalize_telegram_chat_id
as parse_telegram_message_id; behaviour is unchanged.

Refs #139611
Refs #134889 (MSG-17)
Refs #140138
2026-10-16 20:25:09 -07:00
PRATHAMESH75
29cda7a5ef fix(telegram): send unanchored when a reply anchor is not a message id (#139611)
Route wakes (kanban-wake, loop-tick) are admitted with a synthetic JSON
identity (session_automation.admit_route_wake), and
_reply_anchor_for_event passes it to the send as the reply anchor. The
Telegram adapter ran raw int() on that anchor in
_metadata_reply_to_message_id, _reply_to_message_id_for_send and
_chunk_reply_routing, so every reply into the session failed with
"invalid literal for int() with base 10: '["kanban-wake",...]'" and
the poisoned anchor was retried.

All three sites now go through _telegram_message_id(): a non-numeric
anchor is not a Telegram message id, so the reply is sent unanchored,
or on the DM topic's own metadata anchor when there is one. The
normaliser follows luyifan's approach in #72937, which no longer applies
after the adapter refactor.

Co-authored-by: luyifan <al3060388206@gmail.com>
(cherry picked from commit 5b9f0d6cea2896c82e882297a0cd5e92571fdbb8)
2026-10-16 20:24:24 -07:00
Teknium
fb5e7b6143 docs(platforms): adding-a-platform guides point at the plugin declarations
The env bridge, allowlist names and prompt hint now live on the PlatformEntry (gateway_env.py,
AUTHZ, platform_hint), not in _ENV_STEPS, _PLATFORM_ALLOWLIST_ENV or PLATFORM_HINTS.
2026-10-16 19:42:34 -07:00
Teknium
b95c4861b2 fix(platforms): bundled authorization env names hold when the live entry lacks them
Independent review found the allowlist, the open-policy startup refusal, the pairing-noise
rule and `hermes pairing revoke` reading only the live PlatformEntry: a user plugin overriding a
bundled platform without the fields, safe mode or a disabled plugin then gated on nothing
(looser than main, whose core tables always applied).

Each bundled plugin now declares them once as `gateway_env.AUTHZ` (passed to register() with
**), and `gateway.platform_env.authz_field` answers from the entry, else from that file (read
without the plugin package). Probed main vs head: 208/208 authz decisions identical in normal,
safe-mode, plugin-disabled and user-override modes; revoke drops the user in all four.

The terminal secret blocklist and config_env_table_keys() read the same files, which removes the
three hand-listed plugin secrets in local_env_policy.
2026-10-16 19:42:34 -07:00
Teknium
b035c13e77 fix(platforms): plugin-declared rows reach callers that run before or outside discovery
CI found three paths that read the registry where core used to read its own table:
- the system prompt's platform hint was built before any discovery (direct builders):
  discover on a miss, like the send and config lookups already do;
- the dashboard's auth-posture check resolved the allowlist env inside the profile scope,
  whose registry overlay may not hold the entry: resolve it in the request scope, the way
  _env_value_rules already does;
- a parked profile's config read suppresses plugin discovery by design (#123386), so its
  bundled-platform env rows vanished and the duplicate-credential guard stopped seeing a
  shared bot token. Bundled rows are now read straight from plugins/platforms/<p>/gateway_env.py
  (core-only imports, never the plugin package or register()) whenever the registry has no
  entry: suppressed discovery, safe mode, a disabled plugin. That is main's behaviour.

Buzz's test loader imports adapter.py as a bare module, so its sibling imports go through the
existing loader-agnostic helper (generalized from nostr_auth).
2026-10-16 19:42:34 -07:00
Teknium
2f4b42191e fix(platforms): import new plugin siblings relatively (no second adapter copy)
The plugin loader runs a bundled platform package as hermes_plugins.platforms__<name>.
An absolute `from plugins.platforms.<name>.<sibling> import ...` inside register() imports
the canonical package too, whose __init__ loads a second copy of the adapter. The prompt-hint
and send-target siblings added on this branch did that for buzz, feishu and slack (three new
double-loaded adapters vs main). Relative imports, as the dashboard_card / gateway_env siblings
already use; after every plugin registers, the double-loaded set is back to main's five.
2026-10-16 19:42:34 -07:00
Teknium
3c3f85a0d0 refactor(gateway): plugin platforms declare their env->config rows on PlatformEntry
Move the per-platform `_Cred` rows of `_ENV_STEPS`, their helper steps and the
`_ENV_ENABLE_CREDENTIALS` rows for every plugin-backed platform (telegram, discord,
slack, whatsapp, whatsapp_cloud, signal, mattermost, matrix, email, sms, dingtalk,
feishu, wecom, wecom_callback, weixin, bluebubbles, qqbot, yuanbao) out of
gateway/config_env.py into each plugin's `gateway_env.py`, attached via two new
PlatformEntry fields: `env_overrides` (ordered steps) and `env_enable_credentials`.

`gateway/platform_env.py` holds the declarative `EnvCred` row and shared parsers.
`_apply_env_overrides` runs the rows of entries with activation evidence (same gate
as the plugin enable pass, computed once). Core-only rows (api_server, webhook,
msgraph_webhook, relay) stay in config_env. profile_channels reads the rows from
registry entries; the import-time terminal secret blocklist lists the three secrets
only those rows read, pinned by a new invariant test.

Resulting GatewayConfig and explicit-disable warnings are identical (differential
oracle, 100 fixtures); only env-created insertion order of api_server/webhook/
msgraph_webhook relative to plugin platforms changes.
2026-10-16 19:42:34 -07:00
Teknium
28e4da48fe refactor(dashboard): channel cards and env-value checks read the plugin's PlatformEntry
The Channels page catalog (_PLATFORM_OVERRIDES) and the PUT env-value validators
(_ENV_VALUE_RULES) duplicated per-platform data the bundled platform plugins can
declare. Each plugin now declares its card on its PlatformEntry (new dashboard
block: dashboard_label, dashboard_description, docs_url, dashboard_env_vars,
dashboard_required_env, env_value_rules); core keeps static rows only for the
core-only platforms (api_server, webhook, msgraph_webhook, relay).

Telegram/Slack validators move into their plugins. The PUT route resolves the
rules right after _require_platform (catalog build already materialized every
entry, so nothing extra is imported) and before entering _profile_scope, where
the registry's profile overlay may not hold the entry.

Adapters over their size cap (discord, feishu, matrix, slack, telegram) keep the
card in a sibling dashboard_card.py, imported relatively so no second canonical
copy of the adapter module loads; surplus blank lines offset the two added lines.

Behaviour identity: differential oracle over the real route handlers (GET
/api/messaging/platforms root + profile, PUT valid/invalid per rule root +
profile) is byte-identical to base.
2026-10-16 19:42:34 -07:00
Teknium
e24f12c69f refactor(send): read send_message target syntax and standalone routing from the plugin registry
Delete the per-platform tables in tools/send_message_targets.py (_PLATFORM_PARSERS, 14 rows) and
tools/send_message_tool.py (_PLUGIN_STANDALONE_MEDIA, _TEXT_SENDERS, plus the discord-always and
whatsapp-mentions ladders). Each bundled plugin now declares them on its PlatformEntry:

- target_ref_syntax_fn: the old parser, body unchanged. A new field rather than parse_target_ref_fn
  because that field is an authority (strict under pass_unresolved_references, no "not explicit"
  sentinel, not re-applied to channel-directory hits) and reusing it would change react/cron
  behaviour for ntfy/buzz/photon.
- standalone_send: StandaloneSendPolicy (label, media, all_sends, captionable,
  empty_list_between_chunks, forward_force_document, mentions, text_direct).

Shared builders and the NOT_EXPLICIT sentinel live in gateway/platforms/send_targets.py so plugins
import no core-private helpers. Lookups discover plugins first when the name is not registered yet
(fresh CLI/cron process). Differential oracle (33 platforms x 48 refs, 10 send cases each): base and
head output identical.
2026-10-16 19:42:34 -07:00
Teknium
3d21ec1294 refactor(platforms): plugin PlatformEntry carries its prompt hint and display defaults
PLATFORM_HINTS (agent/prompt_builder.py) and _PLATFORM_DEFAULTS (gateway/display_config.py)
duplicated per-platform data for every bundled messaging plugin. Both consumers already fell
back to the registry (PlatformEntry.platform_hint / display_tier), so the plugin rows move onto
each plugin's register() call and the core tables keep only core surfaces (cron, cli, tui,
desktop, api_server hints; webhook, api_server display rows).

New PlatformEntry field display_overrides: per-key defaults layered over display_tier (telegram,
discord, slack, wecom had tier + tweaks). Hint text is copied byte-for-byte (the shared
_MEDIA_NATIVE fragment is inlined); a base-vs-head oracle of platform_hint() and
resolve_display_setting()/resolve_tool_progress() for every platform, with and without user
display overrides, is byte-identical. Oversize adapters keep the hint in adapter_hint.py.
2026-10-16 19:42:34 -07:00
Teknium
2ab1a408d0 refactor(gateway): bot-bypass and own-policy startup gates read the PlatformEntry
_ALLOW_BOTS_ENV (authz_mixin) and _OWN_POLICY_OPEN_ENV (run) duplicated data the
platform plugins own. PlatformEntry gains allow_bots_env and own_policy_env; the
discord/feishu/telegram/slack and wecom/weixin/yuanbao/qqbot/whatsapp plugins
declare them and both tables are deleted.

Both consumers run an idempotent discover_plugins() first so a hand-built config
or bare runner still sees the entries. The bot bypass fails closed with no entry.
The open-policy startup check fails closed for a bundled platform whose plugin is
disabled or failed to load (conventional <NAME>_* names, manifest-declared
allow-all): config can still enable such a platform, and a later plugin enable
re-wires its adapter without re-running the startup check.

_own_policy_envs lives in run_startup.py to keep run.py under its line cap;
small offsets in the discord/slack/feishu/telegram plugin files for the same reason.
2026-10-16 19:42:34 -07:00
Teknium
0663bdf98c refactor(platforms): read connected checks, allowlist env, cron home vars and status labels from the plugin registry
Delete the hand-written per-platform rows that duplicated data every bundled
platform plugin already declares on its PlatformEntry:

- gateway/config.py `_PLATFORM_CONNECTED_CHECKERS`: the weixin, whatsapp_cloud,
  signal, bluebubbles, qqbot and yuanbao rows move to a new narrow
  `PlatformEntry.config_connected_fn` (verdict from the merged PlatformConfig
  alone, no env fallback, owns the token shortcut so Weixin can refuse a bare
  token). Core-only rows (api_server, webhook, msgraph_webhook, relay) stay.
- gateway/pairing.py `_PLATFORM_ALLOWLIST_ENV` and the derived authz maps
  `_ALLOWED_USERS_ENV` / `_ALLOW_ALL_ENV`: read `allowed_users_env` /
  `allow_all_env` (discovering plugins first). The unauthorized-DM
  "allowlist set -> ignore" default keeps its historical platform set as a
  names-only frozenset so irc/teams/... DM behaviour does not change.
- cron `_HOME_TARGET_ENV_VARS`: env var from `cron_deliver_env_var`; the
  origin-fallback / deliver=all order is kept as a names-only priority tuple.
  `_KNOWN_DELIVERY_PLATFORMS` keeps only webhook and wecom_callback (no cron var).
- hermes status `_PLATFORM_LABELS`: plugin labels already overrode every row;
  discover first and use them alone.
- dashboard `_platform_authz_env_names` drops its read of the pairing table.

Differential oracle (connected matrix, pairing/dashboard env lookup,
_is_user_authorized + unauthorized-DM matrix, cron known/home/resolve/all,
hermes status platform section, hermes dump) is identical on base and head.
2026-10-16 19:42:34 -07:00
Teknium
4b17231b53 fix(feishu): an unscoped comment from a secondary adapter fails closed
handle_drive_comment_event bound the launch profile scope to ANY unscoped
callback. Every secondary path arrives scoped today, but a secondary that lost
its context would quietly run its comment turn on the launch profile's
credentials, where main raised UnscopedSecretError. The adapter now passes
secondary (it has a multiplex owner profile), and only the launch adapter may
borrow the launch scope; a secondary's unscoped event is dropped with a warning.

Tests: test_an_unscoped_comment_from_a_secondary_adapter_fails_closed and
test_the_adapter_tells_the_comment_handler_whether_it_is_a_secondary (red
before, green after).

Review finding by @unsupportedpastels on #140186
Refs #134889 (MSG-13)
2026-10-16 19:24:58 -07:00
Teknium
7d9f04469b docs(whatsapp): state port_is_free's REUSEADDR contract
With SO_REUSEADDR a TIME-WAIT-only port reads as free on Linux. That matches the
Node bridge, which sets the same option, and the bridge allocator and ownership
check in this module are the only callers (git grep). The docstring now says so
and warns against gating a non-REUSEADDR binder on it.

Review finding on #140186 (independent review)
Refs #134889 (MSG-16)
2026-10-16 19:21:37 -07:00
KoNit-K
c7ae28da71 fix(feishu): scope default comment agent turns
(cherry picked from commit 71ae9558798c8f6c4900485dd9d7c7084447511c)
2026-10-16 19:21:04 -07:00
Teknium
1848982075 fix(whatsapp): POSIX-only reuse in the probe, real TIME-WAIT test
On top of the salvaged SO_REUSEADDR probe: set the option only on POSIX
(libuv does the same; on Windows it lets a bind share a live listener's
port, which would read another profile's bridge as free), and pin the
restart case with a real kernel TIME-WAIT entry instead of a socket mock,
plus a live listener on the same port still failing closed.

Pre-existing before #106742 (bridge_ownership.py is unchanged since
d385b01469, an ancestor of d04056d609); only multiplexed secondaries
reach this check. Needs a live retest with a paired WhatsApp secondary
and `systemctl --user restart hermes-gateway`.

Refs #139425
Refs #134889 (MSG-16)
Refs #140138
2026-10-16 19:21:03 -07:00
KoNit-K
155588754a fix(whatsapp): reuse bridge ports after restart
(cherry picked from commit cb1eee70fa9abbefe9f4ba300d1a96025266c9c2)
2026-10-16 19:21:03 -07:00
Teknium
f41ac07695 fix(slack): early auth reject checks the session thread's routed profile
_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.
2026-10-16 14:22:13 -07:00
Teknium
0815b4ed4a fix(slack): concurrent slash commands of one session reach the gateway in arrival order
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>
2026-10-16 14:22:13 -07:00
Teknium
a7010c4913 refactor(slack): slash payload decoding lives in adapter_slash_payload
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.
2026-10-16 14:22:13 -07:00
Teknium
e817ac8c8e fix(slack): /pause is handed over before any Slack lookup
/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>
2026-10-16 14:22:13 -07:00
John Paul Soliva
d2ac28c77d fix(slack): a slash command that stops or unblocks the running turn waits for no Slack lookup
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.
2026-10-16 14:22:13 -07:00
John Paul Soliva
bda86e96f6 fix(slack): a rejected slash-command sender costs no Slack lookup
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.
2026-10-16 14:22:13 -07:00
John Paul Soliva
c1c2bab742 fix(slack): load channel skill bindings on slash-command turns
`/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.
2026-10-16 14:22:13 -07:00
John Paul Soliva
1424ffa429 fix(slack): carry channel prompt and source names on slash-command turns
_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.
2026-10-16 14:22:13 -07:00
Maciej Lisiewski
428f2e0202 fix(deps): bump @grpc/grpc-js 1.14.4 → 1.14.6 in photon sidecar (high, GHSA-482/481)
Latest 1.14.x release older than 3 days; clears the 1.14.5 floor.
2026-10-16 17:26:41 +02:00
Maciej Lisiewski
4bcf60191a fix(deps): bump undici 7.29.0 → 7.30.0 in photon sidecar (high, GHSA undici alerts)
7.30.1 is < 3 days old, so pin the override at 7.30.0 — the latest
release older than 3 days that clears the 7.29.1 floor.
2026-10-16 17:26:35 +02:00
Teknium
42762d6a64 refactor(signal): plugin wiring lives in register.py, like QQ Bot and Yuanbao
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.
2026-10-16 07:09:45 -07:00
Teknium
0496f7e420 fix(signal): register under the canonical module name (one SignalAdapter class)
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.
2026-10-16 07:09:45 -07:00
Teknium
38b5383270 chore(platforms): clear the code-health ratchet on the moved adapters
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.
2026-10-16 07:09:45 -07:00
Teknium
bdda3763cd fix(signal, weixin): setup menu reads .env-only credentials like the old core rows
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).
2026-10-16 07:09:45 -07:00
Teknium
a84712b4cd refactor(gateway): finish the move of the last core messaging adapters
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/.
2026-10-16 07:09:45 -07:00
Teknium
337ac57c6e refactor(yuanbao): plugin manifest, register() and import paths
(cherry picked from commit a576e12ba5dfb9d3e116137ad39963723628e3b4)
2026-10-16 07:09:45 -07:00
Teknium
346396c483 refactor(yuanbao): move adapter files into plugins/platforms/yuanbao
(cherry picked from commit 204bed25e4f78a107296f9d9d6c64af80da2177c)
2026-10-16 07:09:45 -07:00
Teknium
7ada20f7ad fix(qqbot): setup status reads .env like the old core wizard row
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)
2026-10-16 07:09:45 -07:00
Teknium
9189f6c69b fix(qqbot): keep the plugin a pure move
- 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)
2026-10-16 07:09:45 -07:00
cxyhhhhh
0a2992af65 refactor(qqbot): move the built-in adapter into the bundled platform plugin
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)
2026-10-16 07:09:45 -07:00
Teknium
e36a291671 refactor(weixin): move adapter into bundled platform plugin
git mv gateway/platforms/weixin.py -> plugins/platforms/weixin/adapter.py with
plugin.yaml + register(): adapter_factory, check_fn (install_hint = old
_BUILTIN_ADAPTERS warning), is_connected, required_env, setup_fn (QR-login wizard
moved from hermes_cli/gateway_setup_wizard.py), standalone_sender_fn (native
text+media via send_weixin_direct, formerly tools/send_message_senders._send_weixin),
allowlist/cron env vars, emoji, allow_update_command. Tests import the plugin path.

(cherry picked from commit bdff38c4987cb6f6333b909d4949c68a3bd2a6a2)
2026-10-16 07:09:45 -07:00
Teknium
5276958511 refactor(signal): move Signal adapter into bundled platform plugin
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)
2026-10-16 07:09:45 -07:00
Teknium
aa97f31477 refactor(bluebubbles): move adapter into bundled platform plugin
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)
2026-10-16 07:09:45 -07:00
Teknium
f11062a837 refactor(whatsapp_cloud): move WhatsApp Cloud adapter into a bundled platform plugin
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)
2026-10-16 07:09:45 -07:00
helix4u
39de69b19c fix(irc): give each inbound line a unique message identity 2026-10-16 02:27:48 -07:00
unsupportedpastels
4e59ac2b88 test(discord): pin when a role removed from YAML stops re-authorizing
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
2026-10-15 23:59:47 -04:00
unsupportedpastels
68b3b6af2e fix(discord): re-authorize durable role grants through the ingress gate resolver
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 #139162
Fixes #139148

Co-authored-by: 686f6c61 <6115107+686f6c61@users.noreply.github.com>
2026-10-15 23:59:47 -04:00
Ben Barclay
acc3cada0d fix(solstice): offer Gemini 4 Argon
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.
2026-10-16 00:07:17 +02:00
Maciej Lisiewski
f732746bb4 Merge pull request #139222 from NousResearch/race-fixes-pt1
fix: 27 race / coarse-timestamp / lost-update bugs
2026-10-16 00:03:59 +02:00
Maciej Lisiewski
60f56a6b13 Merge pull request #139388 from NousResearch/fix-preexisting-test-failures
fix: 14 tests failing on main outside CI
2026-10-15 22:53:44 +02:00
Maximilian Kindshofer
825fdb7984 fix(mattermost): pass empty media lists so text posts pass native admission
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)
2026-10-15 16:33:59 -04:00
Maciej Lisiewski
d5442d0a47 fix(google_meet): say-queue appends survive the speaker's rewrite
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.
2026-10-15 22:12:28 +02:00