refactor: QQ Bot leaves core for the official qqbot plugin (installed by default, auto-migrated) #159640
<!-- hermes-ci-review-bot -->
૮ >ﻌ< ა ci review
<sub>ran on ce8de9a — fix(qqbot-move): rebase onto the left_core_migration package</sub>
ℹ️ Info
CI caches · View report · View job
29 / 29 cache hits (0 misses)
4681.17 MiB restored
0 B not restored.
<details>
<summary>per-job cache results</summary>
<h3>hits</h3>
<table><thead><tr><th>Job</th><th>Step</th><th>Logs</th><th>Restored</th><th>Δ vs main</th></tr></thead><tbody>
<tr><td>OS-specific tests / Windows-only tests (arm64, 2/2)</td><td>Set up native ARM64 build dependencies / Cache ARM64 OpenSSL development files</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385268#step:3:1">view step</a></td><td>26.23 MiB</td><td>+0 B</td></tr>
<tr><td>OS-specific tests / Windows-only tests (arm64, 2/2)</td><td>Set up locked Python and test dependencies / Restore verified PM tools without saving</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385268#step:4:1">view step</a></td><td>222.60 MiB</td><td>+0 B</td></tr>
<tr><td>OS-specific tests / Windows-only tests (arm64, 2/2)</td><td>Set up locked Python and test dependencies / Restore uv dependency downloads and builds</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385268#step:4:1">view step</a></td><td>857.76 MiB</td><td>+0 B</td></tr>
<tr><td>Python lints / Python lints</td><td>Run ./.github/actions/setup-pm / Restore verified PM tools without saving</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385322#step:4:1">view step</a></td><td>83.14 MiB</td><td>+0 B</td></tr>
<tr><td>Docs Site / docs-site-checks</td><td>Set up the locked site toolchain / Restore verified PM tools without saving</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385080#step:4:1">view step</a></td><td>155.38 MiB</td><td>+0 B</td></tr>
<tr><td>Docs Site / docs-site-checks</td><td>Install website dependencies / Restore node dependency downloads</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385080#step:5:1">view step</a></td><td>71.71 MiB</td><td>+0 B</td></tr>
<tr><td>Repository guards / Repository guards</td><td>Run ./.github/actions/setup-pm / Restore verified PM tools without saving</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385167#step:36:1">view step</a></td><td>155.38 MiB</td><td>+0 B</td></tr>
<tr><td>Repository guards / Repository guards</td><td>Run ./.github/actions/setup-pm / Restore uv dependency downloads and builds</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385167#step:36:1">view step</a></td><td>75.59 MiB</td><td>+0 B</td></tr>
<tr><td>Repository guards / Repository guards</td><td>Run ./.github/actions/setup-pm / Restore node dependency downloads</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385167#step:36:1">view step</a></td><td>180.90 MiB</td><td>+0 B</td></tr>
<tr><td>Python tests / Run tests (1/3)</td><td>Set up locked Python and test dependencies / Restore verified PM tools without saving</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385231#step:5:1">view step</a></td><td>155.74 MiB</td><td>+0 B</td></tr>
<tr><td>Python tests / Run tests (1/3)</td><td>Set up locked Python and test dependencies / Restore uv dependency downloads and builds</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385231#step:5:1">view step</a></td><td>75.59 MiB</td><td>+0 B</td></tr>
<tr><td>Python tests / Run tests (1/3)</td><td>Run tests</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385231#step:8:1">view step</a></td><td>0.10 MiB</td><td>-122 B</td></tr>
<tr><td>Python tests / Run tests (3/3)</td><td>Set up locked Python and test dependencies / Restore verified PM tools without saving</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385242#step:5:1">view step</a></td><td>155.74 MiB</td><td>+0 B</td></tr>
<tr><td>Python tests / Run tests (3/3)</td><td>Set up locked Python and test dependencies / Restore uv dependency downloads and builds</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385242#step:5:1">view step</a></td><td>75.59 MiB</td><td>+0 B</td></tr>
<tr><td>Python tests / Run tests (3/3)</td><td>Run tests</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385242#step:8:1">view step</a></td><td>0.10 MiB</td><td>+15 B</td></tr>
<tr><td>Python tests / Run tests (2/3)</td><td>Set up locked Python and test dependencies / Restore verified PM tools without saving</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385243#step:5:1">view step</a></td><td>155.74 MiB</td><td>+0 B</td></tr>
<tr><td>Python tests / Run tests (2/3)</td><td>Set up locked Python and test dependencies / Restore uv dependency downloads and builds</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385243#step:5:1">view step</a></td><td>75.59 MiB</td><td>+0 B</td></tr>
<tr><td>Python tests / Run tests (2/3)</td><td>Restore per-file duration cache</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385243#step:7:1">view step</a></td><td>0.10 MiB</td><td>+0 B</td></tr>
<tr><td>Remote terminal backends / SSH + Docker backends (real sshd, real daemon)</td><td>Set up locked Python and test dependencies / Restore verified PM tools without saving</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385295#step:6:1">view step</a></td><td>83.14 MiB</td><td>+0 B</td></tr>
<tr><td>Remote terminal backends / SSH + Docker backends (real sshd, real daemon)</td><td>Set up locked Python and test dependencies / Restore uv dependency downloads and builds</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385295#step:6:1">view step</a></td><td>75.59 MiB</td><td>+0 B</td></tr>
<tr><td>OS-specific tests / Windows-only tests (arm64, 1/2)</td><td>Set up native ARM64 build dependencies / Cache ARM64 OpenSSL development files</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385266#step:3:1">view step</a></td><td>26.23 MiB</td><td>+0 B</td></tr>
<tr><td>OS-specific tests / Windows-only tests (arm64, 1/2)</td><td>Set up locked Python and test dependencies / Restore verified PM tools without saving</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385266#step:4:1">view step</a></td><td>222.60 MiB</td><td>+0 B</td></tr>
<tr><td>OS-specific tests / Windows-only tests (arm64, 1/2)</td><td>Set up locked Python and test dependencies / Restore uv dependency downloads and builds</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385266#step:4:1">view step</a></td><td>857.76 MiB</td><td>+0 B</td></tr>
<tr><td>OS-specific tests / Windows-only tests</td><td>Set up locked Python and test dependencies / Restore verified PM tools without saving</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385277#step:5:1">view step</a></td><td>236.12 MiB</td><td>+0 B</td></tr>
<tr><td>OS-specific tests / Windows-only tests</td><td>Set up locked Python and test dependencies / Restore uv dependency downloads and builds</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385277#step:5:1">view step</a></td><td>103.78 MiB</td><td>+0 B</td></tr>
<tr><td>OS-specific tests / macOS-only tests (1/2)</td><td>Set up locked Python and test dependencies / Restore verified PM tools without saving</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385269#step:5:1">view step</a></td><td>107.87 MiB</td><td>+0 B</td></tr>
<tr><td>OS-specific tests / macOS-only tests (1/2)</td><td>Set up locked Python and test dependencies / Restore uv dependency downloads and builds</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385269#step:5:1">view step</a></td><td>168.62 MiB</td><td>+0 B</td></tr>
<tr><td>OS-specific tests / macOS-only tests (2/2)</td><td>Set up locked Python and test dependencies / Restore verified PM tools without saving</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385332#step:5:1">view step</a></td><td>107.87 MiB</td><td>+0 B</td></tr>
<tr><td>OS-specific tests / macOS-only tests (2/2)</td><td>Set up locked Python and test dependencies / Restore uv dependency downloads and builds</td><td><a href="https://github.com/NousResearch/hermes-agent/actions/runs/46201447452/job/141154385332#step:5:1">view step</a></td><td>168.62 MiB</td><td>+0 B</td></tr>
</tbody></table>
<h3>misses</h3>
none
<p>Compressed archive bytes. Not-restored bytes use the main-size reference; missing sizes remain unknown.</p>
</details>
---
debug info
<details>
<summary>CI timings</summary>
CI timings · View report · View job
Wall time 6m15s vs 7m29s (-16.5%). 7 job(s) slower, 5 faster, 2 unchanged.
</details>
<!-- greptile_summary -->
<h2><ruby><rp>Confidence Score: 1/5 · Hold the merge until PM selects the same plugin trees as discovery and the gateway shares one platform merge.</rp></ruby><a href="https://app.greptile.com/api/retrigger?id=117941014&sig=53432d1598e4155991e6c9c65df3279584890806de4a4899227cafdf82fdc774"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img alt="Retrigger" src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2" align="right"></picture></a><a href="https://app.greptile.com/-/switch-tenant?tenant=nous-research&next=%2FNousResearch%2Fhermes-agent%2Fpull%2F159640&utm_source=greptile_review&utm_medium=github&utm_campaign=view_in_greptile"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptileDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2"><img alt="View in Greptile" src="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2" align="right"></picture></a>Confidence Score: 1/5</h2>
[High impact] The PR changes how messaging platforms are installed\, selected\, and reached across Hermes\.
Hold the merge until PM selects the same plugin trees as discovery and the gateway shares one platform merge.
<h2>Findings</h2>
1. <img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"> An unused plugin blocks updates <a href="https://github.com/NousResearch/hermes-agent/pull/159640#discussion_r4726078571">▶</a>
2. <img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"> PM picks the wrong plugin <a href="https://github.com/NousResearch/hermes-agent/pull/159640#discussion_r4726078574">▶</a>
3. <img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"> Reload drops inherited settings <a href="https://github.com/NousResearch/hermes-agent/pull/159640#discussion_r4712067098">▶</a>
4. <img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"> Cron rejects a working route <a href="https://github.com/NousResearch/hermes-agent/pull/159640#discussion_r4717147419">▶</a>
5. <img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top"> Two gateway config pipelines <a href="https://github.com/NousResearch/hermes-agent/pull/159640#discussion_r4726078577">▶</a>
6. <img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top"> Bot address rules differ <a href="https://github.com/NousResearch/hermes-agent/pull/159640#discussion_r4717002088">▶</a>
<details><summary>Fix with agent prompt</summary>
`### Issue 1
pm/plugins_state.py:110-111
If a disabled plugin has an unreadable manifest, `enabled_selection()` raises before it checks which plugins are enabled. Discovery skips the unreadable plugin, but `hermes update` can stop, even with `skip_invalid_secondary=True`. Keep the read check for selected plugins without requiring every unselected folder to be readable.
### Issue 2
pm/plugins_state.py:116-124
If `plugins.enabled` lists `disk-cleanup` and a differently named user folder declares `name: disk-cleanup`, discovery rejects that folder and keeps the bundled copy. PM picks the user folder first, so its dependencies can change or block the build even though Hermes won’t load it. Have PM and discovery use the same rules to pick the tree, without importing plugin code.
### Issue 3
hermes_cli/config.py:undefined-2667
Plugin discovery adds env names from every profile to `LOADED_PLUGIN_ENV` and never removes them. If a plugin declares a setting supplied by the shell or service, `/reload` can delete it just because it isn't in the launch home's `.env`. That can happen even after the plugin is removed. Track which values the reloaded home actually supplied, not which names any plugin declared.
### Issue 4
cron/scheduler_preflight.py:332-338
If a secondary profile’s Telegram adapter can’t start and never claims the bot, the ticker still lets that profile send through an exact route to the primary’s QQ bot. But `shared_route_serves()` sees the Telegram credentials and treats the bot as owned. Cron drops the report and tells the user to install `qqbot`, even with preflight off.
Use the adapters the ticker or queue drain already chose. If a worker can’t see those adapters, let the drain decide instead of guessing from config.
### Issue 5
gateway/config_loader.py:617-635
`_yaml_platform_blocks()` repeats the live gateway’s merge but skips the step that reads global settings. A platform’s `unauthorized_dm_behavior` can therefore fall back to `pair` in the saved-block reader even when the live gateway uses the global setting. The repository guide calls for extending the existing path rather than duplicating it. Before merging, share one merge that takes platform names and leave plugin hooks and environment writes in the live loader.
### Issue 6
cron/scheduler_delivery.py:448-460
`_moved_platform_ref()` skips `target_ref_syntax_fn` and `validate_target_ref_fn`, then guesses `chat[:thread]` when the parser fails. `resolve_send_target()` can reject the same address or keep it whole. Installing an idle copy of the plugin in the job’s profile can therefore change how a saved address is read, even though the same primary bot sends it. Let `resolve_send_target()` use the primary bot’s already-loaded registration so both paths follow the same rules without importing another profile’s plugins.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
</details>
<details><summary><h3>Summary</h3></summary>
QQ Bot moves from a bundled adapter to the official qqbot plugin. The PR preserves old config names, saved routes, and tool picks while adding automatic migration for existing homes. Keep the published plugin and catalog pin ahead of the core removal, as the rollout plan specifies.
</details>
<details open><summary><h3>Diagram</h3></summary>
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Profile plugin files and choices] --> B[Runtime discovery]
A --> C[PM user-tree scan]
B --> D[Bundled and user winner rules]
C --> E[Dependency build]
D --> F[Plugin Hermes loads]
</details>
<!-- greptile_confidence_score:1 -->
<sub>Reviews (23) · Last reviewed commit: "fix(cron,gateway): cron reads saved plat..." · Reviewed by Greptile</sub>
<a href=""><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> QQ routes vanish during boot
If multiplexing is explicitly enabled and only a secondary profile uses QQ, the gateway reads saved routes before that profile registers the plugin. Without Platform.QQBOT, it skips those routes as invalid, misses interrupted turns, and can drop the routes on the next full save. The gateway guide requires the receiving bot’s identity to survive a restart. Keep stored platform IDs readable without treating them as live adapters, and test the upgrade with a saved secondary QQ session.
Context Used: gateway/AGENTS.md (source)
Knowledge Base Used:
<details><summary>Prompt To Fix With AI</summary>
``This is a comment left during a code review.
Path: gateway/config.py
Line: 258
Comment:
**QQ routes vanish during boot**
If multiplexing is explicitly enabled and only a secondary profile uses QQ, the gateway reads saved routes before that profile registers the plugin. Without `Platform.QQBOT`, it skips those routes as invalid, misses interrupted turns, and can drop the routes on the next full save. The gateway guide requires the receiving bot’s identity to survive a restart. Keep stored platform IDs readable without treating them as live adapters, and test the upgrade with a saved secondary QQ session.
**Context Used:** gateway/AGENTS.md ([source](https://github.com/nousresearch/hermes-agent/blob/main/gateway/AGENTS.md))
**Knowledge Base Used:**
- [Gateway session lifecycle and recovery](https://app.greptile.com/-/switch-tenant?tenant=nous-research&next=%2Fcustom-context%2Fknowledge-base%2Fnousresearch%2Fhermes-agent%2F-%2Fdocs%2Fgateway-session-lifecycle.md)
- [Restore messaging and cron sessions in the picker](https://app.greptile.com/-/switch-tenant?tenant=nous-research&next=%2Fcustom-context%2Fknowledge-base%2Fnousresearch%2Fhermes-agent%2F-%2Freverts%2Frollback_141573-20261020-stored-session-picker-4dc14f5.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
</details>
<a href=""><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> Saved tool picks lose tools
A saved selection like platform_toolsets.telegram: [hermes-qqbot, file] loses the tools from hermes-qqbot even after the plugin installs. Mixed lists expand only presets in TOOLSETS, and validate_toolset() rejects the name when it reaches the final picker. Keep the old name as an alias for the same core tools. Then selecting that preset on another platform doesn’t need to install a messaging plugin.
<details><summary>Prompt To Fix With AI</summary>
``This is a comment left during a code review.
Path: toolsets.py
Line: 216-217
Comment:
**Saved tool picks lose tools**
A saved selection like `platform_toolsets.telegram: [hermes-qqbot, file]` loses the tools from `hermes-qqbot` even after the plugin installs. Mixed lists expand only presets in `TOOLSETS`, and `validate_toolset()` rejects the name when it reaches the final picker. Keep the old name as an alias for the same core tools. Then selecting that preset on another platform doesn’t need to install a messaging plugin.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
</details>
<a href=""><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> Reload keeps deleted QQ settings
If a single-profile gateway installs QQ during startup, it has already scanned the plugin manifests. Removing the old keys from _EXTRA_ENV_KEYS means /reload no longer clears them. Delete a QQ home-channel setting from .env and cron can still send to the old destination. Keep the legacy keys in reload’s cleanup list using the migration data.
<details><summary>Prompt To Fix With AI</summary>
``This is a comment left during a code review.
Path: hermes_cli/config.py
Line: 206-207
Comment:
**Reload keeps deleted QQ settings**
If a single-profile gateway installs QQ during startup, it has already scanned the plugin manifests. Removing the old keys from `_EXTRA_ENV_KEYS` means `/reload` no longer clears them. Delete a QQ home-channel setting from `.env` and cron can still send to the old destination. Keep the legacy keys in reload’s cleanup list using the migration data.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
</details>
<a href=""><img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top"></a> Partial setup triggers installation
Without enabled: true, the old gateway needed both QQ credentials in YAML or both in the environment. The new check accepts an app ID from YAML and a secret from the environment, so an unfinished setup can trigger a plugin install. Require a complete pair from one source and update the mixed-input test.
<details><summary>Prompt To Fix With AI</summary>
``This is a comment left during a code review.
Path: hermes_cli/left_core_migration.py
Line: 205-208
Comment:
**Partial setup triggers installation**
Without `enabled: true`, the old gateway needed both QQ credentials in YAML or both in the environment. The new check accepts an app ID from YAML and a secret from the environment, so an unfinished setup can trigger a plugin install. Require a complete pair from one source and update the mixed-input test.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
</details>
<a href=""><img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top"></a> Migration reads platform config twice
platform_in_use() merges the config, then calls platform_configured_on() to merge it again. Use one parsed block for the whole check so each new platform doesn’t repeat that work. Have Yuanbao use _labs_notice() too, so the disable advice only needs to be maintained in one place.
<details><summary>Prompt To Fix With AI</summary>
``This is a comment left during a code review.
Path: hermes_cli/left_core_migration.py
Line: 175-183
Comment:
**Migration reads platform config twice**
`platform_in_use()` merges the config, then calls `platform_configured_on()` to merge it again. Use one parsed block for the whole check so each new platform doesn’t repeat that work. Have Yuanbao use `_labs_notice()` too, so the disable advice only needs to be maintained in one place.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
</details>
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
<a href=""><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> QQ webhook routes disappear
If QQ Bot is installed only in the secondary profile that receives the webhook, the shared listener checks deliver: qqbot against the launch profile’s registry. It drops the saved route and won’t check it again until the file changes. Requests return 404 even after the bot connects. Keep saved routes separate from live adapter checks, and look up the destination in the route’s own profile.
Context Used: gateway/AGENTS.md (source)
Knowledge Base Used: Gateway platform delivery and streaming
<details><summary>Prompt To Fix With AI</summary>
``This is a comment left during a code review.
Path: gateway/webhook_targets.py
Line: 9
Comment:
**QQ webhook routes disappear**
If QQ Bot is installed only in the secondary profile that receives the webhook, the shared listener checks `deliver: qqbot` against the launch profile’s registry. It drops the saved route and won’t check it again until the file changes. Requests return 404 even after the bot connects. Keep saved routes separate from live adapter checks, and look up the destination in the route’s own profile.
**Context Used:** gateway/AGENTS.md ([source](https://github.com/nousresearch/hermes-agent/blob/main/gateway/AGENTS.md))
**Knowledge Base Used:** [Gateway platform delivery and streaming](https://app.greptile.com/-/switch-tenant?tenant=nous-research&next=%2Fcustom-context%2Fknowledge-base%2Fnousresearch%2Fhermes-agent%2F-%2Fdocs%2Fgateway-platform-delivery.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
</details>
<a href=""><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> Old QQ config stops working
The old gateway accepted platforms.qqbot-platform as platforms.qqbot. The migration reads only qqbot, and removing the bundled adapter also removes that alias. A bot enabled under the old key with credentials in YAML goes offline, and installing the plugin manually doesn’t restore the settings. Map the old key to qqbot in the shared config loader so migration and startup read the same settings, including an explicit disable.
Context Used: hermes_cli/AGENTS.md (source)
<details><summary>Prompt To Fix With AI</summary>
``This is a comment left during a code review.
Path: hermes_cli/left_core_migration.py
Line: 205-207
Comment:
**Old QQ config stops working**
The old gateway accepted `platforms.qqbot-platform` as `platforms.qqbot`. The migration reads only `qqbot`, and removing the bundled adapter also removes that alias. A bot enabled under the old key with credentials in YAML goes offline, and installing the plugin manually doesn’t restore the settings. Map the old key to `qqbot` in the shared config loader so migration and startup read the same settings, including an explicit disable.
**Context Used:** hermes_cli/AGENTS.md ([source](https://github.com/nousresearch/hermes-agent/blob/main/hermes_cli/AGENTS.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
</details>
<a href=""><img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top"></a> QQ loses its tool picker
hermes tools still builds its menu from _PLATFORM_ENABLE_ENV_VARS. Removing QQ Bot from that list means users can’t edit its tools in the menu, and “Configure all platforms” skips it even after the plugin installs. Use the same profile-specific platform list and labels as gateway setup.
<details><summary>Prompt To Fix With AI</summary>
``This is a comment left during a code review.
Path: hermes_cli/tools_config.py
Line: 375-377
Comment:
**QQ loses its tool picker**
`hermes tools` still builds its menu from `_PLATFORM_ENABLE_ENV_VARS`. Removing QQ Bot from that list means users can’t edit its tools in the menu, and “Configure all platforms” skips it even after the plugin installs. Use the same profile-specific platform list and labels as gateway setup.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
</details>
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
The Channels card now shows the QQ client secret as plain text while it's typed, after an in-process install or when the plugin lives only in a secondary profile.
hermes_cli/web_routers/messaging.py::_messaging_env_info takes each card field's metadata from OPTIONAL_ENV_VARS, else _MESSAGING_ENV_FALLBACKS. These two entries were what made QQ_CLIENT_SECRET a password field. After this PR, OPTIONAL_ENV_VARS gets the QQ names back only from hermes_cli.config._inject_platform_plugin_env_vars(), which runs once at import and reads the launch home's plugins. The left-core install at agent/gateway start happens after that import, and a secondary profile's plugin is never read.
I drove the real GET /api/messaging/platforms handler (get_messaging_platforms) with the labs plugin at 8ab64db6 copied into a fake home:
QQ_CLIENT_SECRET has is_password: true, prompt "QQ Client Secret"hermes_cli.config imports (a restarted process): truefalse, prompt QQ_CLIENT_SECRETprofiles/b, card read with profile=b: falseThe saved value stays redacted, but the form echoes the secret as it's typed. #159638 fixed the same exposure for DingTalk in 7325b77b.
Fix, the same shape as that commit: add the two rows to _MESSAGING_ENV_FALLBACKS. OPTIONAL_ENV_VARS still wins whenever the manifest was read, so the restarted card doesn't change. The new test fails on this head (assert False is True) and passes with the fix, and with the fix the real handler returns is_password: true in both failing cases above. The 20 files covering the messaging routes and the left-core rows: 420 passed, 0 failed, 21 skipped. scripts/check --only ruff,health: ok. Sol (gpt-6.2-sol) reviewed this patch and marked the finding resolved.
<details><summary>Patch (applies to f11752fd; also applies in either order with the test patch in finding 2)</summary>
diff --git a/hermes_cli/web_routers/messaging.py b/hermes_cli/web_routers/messaging.py
index dc4cd75..c1f9981 100644
--- a/hermes_cli/web_routers/messaging.py
+++ b/hermes_cli/web_routers/messaging.py
@@ -101,6 +101,8 @@ _MESSAGING_ENV_FALLBACKS: dict[str, dict[str, Any]] = {
("FEISHU_VERIFICATION_TOKEN", "Feishu / Lark verification token", "Verification token", {"password": True}),
("DINGTALK_CLIENT_ID", "DingTalk client ID (App key)", "Client ID", {}),
("DINGTALK_CLIENT_SECRET", "DingTalk client secret (App secret)", "Client secret", {"password": True}),
+ ("QQ_APP_ID", "QQ Bot App ID from QQ Open Platform (q.qq.com)", "QQ App ID", {"url": "https://q.qq.com"}),
+ ("QQ_CLIENT_SECRET", "QQ Bot Client Secret from QQ Open Platform", "QQ Client Secret", {"password": True}),
)
}
diff --git a/tests/hermes_cli/test_left_core_qqbot.py b/tests/hermes_cli/test_left_core_qqbot.py
index 2ce559c..a14825e 100644
--- a/tests/hermes_cli/test_left_core_qqbot.py
+++ b/tests/hermes_cli/test_left_core_qqbot.py
@@ -99,3 +99,15 @@ def test_qq_gates_stay_profile_gates_with_the_plugin_absent(name):
(``Platform.QQBOT`` named the prefix); the row keeps that while the plugin is absent."""
from tools.environments.local_env_policy import is_profile_gate_env
assert is_profile_gate_env(name) is True
+
+
+def test_the_channels_card_keeps_the_qq_secret_masked_without_the_plugin_manifest(monkeypatch):
+ """The dashboard reads field metadata from OPTIONAL_ENV_VARS, which lists the plugin's names only when the
+ launch home had the plugin when hermes_cli.config was imported. A card built after an in-process install, or
+ for a secondary profile's plugin, must still render QQ_CLIENT_SECRET as a password field, as core did."""
+ from hermes_cli import config
+ from hermes_cli.web_routers import messaging
+ for name in ("QQ_APP_ID", "QQ_CLIENT_SECRET"):
+ monkeypatch.delitem(config.OPTIONAL_ENV_VARS, name, raising=False)
+ assert messaging._messaging_env_info("QQ_CLIENT_SECRET")["is_password"] is True
+ assert messaging._messaging_env_info("QQ_APP_ID")["prompt"] == "QQ App ID"
</details>
Nit: the new tests don't pin the row's legacy disable name, the child-env strip set or the Yuanbao off-platform entry. Mutants of each pass the suite.
I ran 11 mutants of this row and the factory, plus 2 of the local_env_policy.py hunk, against 9 files (test_left_core_qqbot.py, test_left_core_migration.py, test_left_core_yuanbao.py, test_left_core_managed_platform.py, test_profile_gate_env_shape.py, test_local_env_blocklist.py, test_platform_env_overrides.py, test_profile_key_env_scrub.py, tests/gateway/test_left_core_platform_reload.py; 222 passed unmutated). 6 of the 13 were caught. These survivors change behaviour:
plugin_names=(): legacy_plugin_alias("qqbot-platform") returns "", so core's old plugins.disabled: [qqbot-platform] no longer disables the installed plugin.private_env without QQ_APP_ID: the name leaves _HERMES_PROVIDER_ENV_BLOCKLIST, which main had it in.local_env_policy without the added QQ_CLIENT_SECRET: it leaves _ADAPTER_SECRET_ENV and _ALWAYS_STRIP_KEYS._core_platforms_except("yuanbao", "homeassistant") without "qqbot": a home crossing both moves no longer keeps Yuanbao's tools off in QQ sessions.enable_env=(), and the bare-qqbot disable sentence in _labs_notice.The PR body lists "gate-env and strip-set parity" among the tests, but the file only has the gate half. Here's an optional patch with three tests in the style #159638 used. They pass on this head and catch plugin_names=(), both dropped names and the off-platform drop. secret_env=() still passes, because the hardcoded local_env_policy entry covers the same name. scripts/check --only ruff,health: ok.
<details><summary>Patch (tests only; inserts above the gate test so it applies in either order with finding 1's patch)</summary>
diff --git a/tests/hermes_cli/test_left_core_qqbot.py b/tests/hermes_cli/test_left_core_qqbot.py
index 2ce559c..9e0b35d 100644
--- a/tests/hermes_cli/test_left_core_qqbot.py
+++ b/tests/hermes_cli/test_left_core_qqbot.py
@@ -93,6 +93,30 @@ def test_a_fresh_or_shipped_default_home_installs_nothing(tmp_path):
assert said == []
+@pytest.mark.parametrize("name", ["platforms/qqbot", "qqbot-platform"])
+def test_core_s_old_disable_still_disables_the_installed_plugin(name):
+ """``plugins.disabled`` naming core's adapter kept QQ Bot off; it names the catalog plugin now and still wins."""
+ from hermes_cli.plugins_discovery import gate_manifest
+ from hermes_cli.plugins_manifest import PluginManifest
+ manifest = PluginManifest(name="qqbot", source="user", path="qqbot", key="qqbot")
+ assert lcm.legacy_plugin_alias(name) == "qqbot"
+ assert gate_manifest(manifest, {name}, {"qqbot"}).error == \
+ "listed in both plugins.enabled and plugins.disabled — disabled wins"
+
+
+def test_child_processes_keep_the_qq_strip_set_core_had():
+ """With the plugin absent, children lose the QQ names core's manifest made them lose."""
+ from tools.environments import local_env_policy as policy
+ assert {"QQ_CLIENT_SECRET", "QQ_STT_API_KEY"} <= policy._ADAPTER_SECRET_ENV & policy._ALWAYS_STRIP_KEYS
+ assert {"QQ_APP_ID", "QQ_CLIENT_SECRET", "QQ_ALLOWED_USERS", "QQBOT_HOME_CHANNEL"} <= \
+ policy._HERMES_PROVIDER_ENV_BLOCKLIST
+
+
+def test_yuanbao_tools_stay_off_in_qqbot_sessions():
+ """A home upgrading across both removals: core never carried the yb_* tools in hermes-qqbot."""
+ assert "qqbot" in next(f for f in lcm.LEFT_CORE if f.plugin == "yuanbao").off_platforms
+
+
@pytest.mark.parametrize("name", ["QQ_ALLOWED_USERS", "QQ_ALLOW_ALL_USERS", "QQBOT_ALLOWED_USERS"])
def test_qq_gates_stay_profile_gates_with_the_plugin_absent(name):
"""``QQ_*`` and ``QQBOT_*`` gates stayed out of another profile's children while core shipped QQ Bot
</details>
Nit: main did enable the adapter with half a credential set. It just never connected.
Main's gateway_env.py used EnvCred(Platform.QQBOT, (("QQ_APP_ID", "QQ_CLIENT_SECRET"),), ...), a single any-of group, so QQ_APP_ID alone enabled QQ and the adapter then failed with qq_missing_credentials. My base probe (main's load_gateway_config with plugins discovered) gives enabled: True, is_connected: False for this home. False is still the right answer, since the labs plugin's env_enablement needs both names. This only changes the comment:
("QQ_APP_ID=a\n", "", False), # half a set: core enabled the adapter, but it never connected
TL;DR: One should-fix: after the move, the dashboard's Channels card shows the QQ client secret as plain text while it's typed, both after the in-process install and for a plugin that lives only in a secondary profile. A tested patch is inline. There are two nits inline and two more below, and my notes on Greptile's eight items follow the table.
| # | Finding | Severity | Where | Status |
|---|---|---|---|---|
| 1 | The Channels card renders QQ_CLIENT_SECRET as a text field after an in-process install or for a secondary profile's plugin | Should-fix | hermes_cli/config_defaults.py:3000 (removed lines) | Open |
| 2 | The new tests don't pin the row's legacy disable name, the child-env strip set or the Yuanbao off-platform entry | Nit | hermes_cli/left_core_migration.py:694 | Open |
| 3 | A test comment says half a credential set never enabled the adapter; main enabled it, it just never connected | Nit | tests/hermes_cli/test_left_core_qqbot.py:55 | Open |
| 4 | With env credentials and a legacy gateway.json enabled: false, main ran QQ but qqbot_in_use says no | Nit | hermes_cli/left_core_migration.py:179 | Open |
| 5 | A string-saved row such as telegram: '["hermes-qqbot"]' doesn't count as use | Nit | hermes_cli/left_core_migration.py:127 | Open |
_merged_platform_block reads gateway.json as the base layer, but main's loader set _enabled_explicit only for YAML, so env credentials re-enabled QQ over a gateway.json disable. My probe: main enabled: True, is_connected: True, head False. The shared factory already answers this way for Yuanbao on main, and #159638 pins it in a test, so it's a rare legacy layer rather than something to fix in this PR.parse_platform_toolsets_value. #159638's 7325b77b already switches the shared _toolset_listed to it, so this row gets the fix once that change lands; nothing extra is needed here if both go in.On Greptile's items, checked with my own probes:
app_id in platforms.qqbot.extra with QQ_CLIENT_SECRET in .env, the reverse, and a top-level qqbot: {app_id} with the env secret. EnvCred's (("QQ_APP_ID", "QQ_CLIENT_SECRET"),) is one any-of group, and its optional step copies the env value into extra. Requiring a pair from one source would skip homes main ran, so the PR's mixed-input row is right.qqbot: [hermes-qqbot] and [hermes-qqbot, spotify] resolve to main's sets plus the raw name. Only another platform's mixed list loses them: telegram: [hermes-qqbot, file] gives 17 toolsets on main and only file on this head. I'd call it a nit.reload_env, which only removes names in OPTIONAL_ENV_VARS | _EXTRA_ENV_KEYS. It applies after an in-process install, and always for the legacy QQ_HOME_CHANNEL names, which the plugin manifest doesn't declare.SessionEntry.from_dict reaches Platform("qqbot"), which _missing_ answers with None until the plugin registers, so the row is logged as invalid and skipped. I didn't reproduce the multiplex boot order or the deletion on a full save. Sol raised the same thing independently and rated it a blocker. The decode step is the same on main for Yuanbao, so the path isn't new, but it is new for QQ users._get_enabled_platforms lists cli plus four env-keyed platforms, so QQ drops out of hermes tools even after the install, as other plugin platforms already do.platforms.qqbot-platform alias item (r4680117623). Sol raised the webhook one too, as a nit.CI on f11752f passed all 17 checks that ran, none failed or pending, including Python tests 1/3 to 3/3, Python lints, the Windows (x64 and arm64) and macOS lanes, Repository guards, the docs site and "All required checks pass (v2)". Locally, I ran a base-vs-head in_use matrix over 28 fake homes, comparing main's gateway (load_gateway_config with plugins discovered) against qqbot_in_use(process_env=True). 22 agree. The 6 that differ are finding 4, the two half-credential homes (head's False is right, see finding 3), the two designed homes that select hermes-qqbot for another platform, and a token-only platforms.qqbot block (head installs, main never enabled it; harmless). With the plugin absent, the child-env sets match main exactly (454 blocklist, 47 adapter-secret and 76 always-strip names), and the gate prefixes add HOMEASSISTANT and YUANBAO, as the body says. On the merge base, the PR's new tests give 15 failed (the row is missing) and 4 passed, matching the body. Sol (gpt-6.2-sol) ran two rounds: round 1 raised 11 items and round 2 resolved finding 1's patch. I didn't run the live gateway legs or reproduce the multiplex boot order.
Details are in the inline comments.
---
Written and posted by Hermes Agent, Bear's AI agent, without Bear reading it first. An approval from it is never on behalf of hermes-agent-core: where that team's review is requested or required, the approval comes from Bear himself.*
Fixed in be507f47a5b0. The decode step you named is real: SessionEntry.from_dict raises for platform: qqbot until the plugin registers, and _load_routing_rows_locked / the legacy sessions.json import skipped the row, so the next full save (replace_routing_entries deletes the scope, then inserts _entries) dropped it. Now a well-formed row that fails to parse is held in _unparsed_routes and merged under the live entries in _snapshot_routing_locked, so a save writes it back and a later start that has the plugin loads it. Test: tests/gateway/test_unparsed_route_survives_save.py (saved qqbot route + a full save on a restarted store); red on f11752fd, green now. Not reproduced: the multiplex boot ordering itself; the fix covers every path that saves before the plugin registers.
Fixed in be507f47a5b0. Confirmed the narrow case Bear measured: telegram: [hermes-qqbot, file] kept only file, because _explicit_toolsets expanded composites only when the name is in TOOLSETS. It now also expands a plugin platform's implicit hermes-<platform> bundle (toolsets._plugin_platform_bundle, the same resolver resolve_toolset already uses), so the core tools come back once the plugin registers. Not re-adding a static hermes-qqbot alias: core would then claim a bundle for a platform it no longer ships. Test: test_a_mixed_list_naming_hermes_qqbot_keeps_its_tools_once_the_plugin_registers; red on f11752fd.
Fixed in be507f47a5b0: the QQ_ / QQBOT_ names, including the legacy QQ_HOME_CHANNEL / QQ_HOME_CHANNEL_NAME aliases the manifest never declared, are back in _EXTRA_ENV_KEYS, so reload_env drops a removed line after an in-process install. The child-env strip sets are unchanged (checked against main). Test: test_reload_and_config_set_still_know_the_qq_env_names; red on f11752fd.
Not a bug; keeping the per-field read. Main's gateway enabled and connected QQ with split sources in both directions (app_id in platforms.qqbot.extra + QQ_CLIENT_SECRET in .env, the reverse, and a top-level qqbot: {app_id} + env secret): EnvCred(("QQ_APP_ID", "QQ_CLIENT_SECRET"),) gates on env, and is_connected reads extra.get("app_id") or env, per field. Requiring one source would skip homes main ran. BearHuddleston probed main independently and got the same answer.
Fixed in be507f47a5b0. platform_in_use now checks the block it already merged (_block_on(block)); platform_configured_on is a thin wrapper over the same helper, so the second read is gone for every platform row. Yuanbao's notice is now _labs_notice("yuanbao", "Yuanbao"); the hand-written _YUANBAO_NOTICE / _yuanbao_notice copy is removed (same text, same stale-disable sentence; the Yuanbao suite passes unchanged).
Fixed in be507f47a5b0: qqbot stays in BUILTIN_DELIVER_PLATFORMS, so a saved deliver: qqbot route is never dropped just because the launch profile's registry lacks the plugin (the secondary-profile case). Delivery still goes through _deliver_cross_platform, which resolves the adapter in the route's profile and errors if none is connected. Test: test_webhook_routes_keep_a_qqbot_target_before_the_plugin_registers; red on f11752fd.
Fixed in be507f47a5b0. Core resolved platforms.qqbot-platform through its bundled-alias scan (7427f539), which disappears with the folder. Now Platform._missing_ falls back to left_core_migration.legacy_platform_alias(), which maps a LEFT_CORE row's plugin_names to its platform, so the gateway loader reads that key as qqbot once the plugin registers. The migration's _merged_platform_block folds that key under qqbot, with the canonical key winning, so credentials and an explicit enabled: false there count the same way. Tests: three test_the_old_manifest_key_is_read_as_platforms_qqbot cases; red on f11752fd.
Not changed. hermes tools lists cli plus four env-keyed platforms only; every plugin platform (Teams, Google Chat, IRC, LINE, Home Assistant, Yuanbao) is already absent from that menu on main, and TestPlatformToolsetConsistency requires every menu row to be in PLATFORMS and in hermes-gateway. Keeping a QQ row would mean keeping a core bundle for a platform core no longer ships, which is the opposite of this move. QQ's toolsets stay editable through platform_toolsets.qqbot in config.yaml and the dashboard. Making the menu registry-driven for all plugin platforms is a separate change, not part of this lane.
Applied as-is in be507f47a5b0 (Co-authored-by you). Your test fails on f11752fd (assert False is True) and passes with the two _MESSAGING_ENV_FALLBACKS rows. Thanks for driving the real handler.
Applied in be507f47a5b0 (Co-authored-by you). All three tests pass on head; I checked that plugin_names=() and dropping QQ_APP_ID from private_env each turn one of them red. Bear's Greptile notes also landed in the same commit: one block read in platform_in_use, and Yuanbao on _labs_notice.
Applied in be507f47a5b0: the comment now reads "half a set: core enabled the adapter, but it never connected". The expected value stays False.
You're right — I misread how main's credential gate worked. The per-field fallback (extra.get(key) or env) matches main's is_connected, and requiring one complete source would indeed skip homes that main actually connected. Thanks for the clarification and the independent verification.
@BearHuddleston thanks. Everything is in be507f47a5b0 (Co-authored-by you); per-finding replies are inline.
gateway.json disable vs env creds): left as is, as you suggested. It is the shared factory's answer, the same as Yuanbao's on main, and #159638 pins it._toolset_listed change (7325b77b / 7aac7286) when both land; nothing QQ-specific.hermes-qqbot in a mixed list, reload keys, the qqbot-platform key alias, the webhook deliver target and the double read. Kept the split-credential read (your probe agrees) and the hermes tools menu (every plugin platform is absent from it on main).Got it — that makes sense. The behavior is consistent with how other plugin platforms (Teams, Google Chat, IRC, LINE, Home Assistant, Yuanbao) already work, and QQ Bot as a plugin should follow the same pattern. The alternative editing paths through platform_toolsets.qqbot and the dashboard maintain the functionality. Thanks for clarifying the architectural context.
<a href=""><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> Old copy overwrites newer route
If QQ isn't registered, the gateway holds its state.db route in _unparsed_routes. The sessions.json import only checks _entries, so an older copy can replace the held route and get written back to the database. That can lose a pending turn or bring back one that already finished. Keep saved route IDs readable without loading the adapter so both sources follow the same database-first rule.
Context Used: gateway/AGENTS.md (source)
Knowledge Base Used: Gateway session lifecycle and recovery
<details><summary>Prompt To Fix With AI</summary>
``This is a comment left during a code review.
Path: gateway/session_persistence.py
Line: 490
Comment:
**Old copy overwrites newer route**
If QQ isn't registered, the gateway holds its `state.db` route in `_unparsed_routes`. The `sessions.json` import only checks `_entries`, so an older copy can replace the held route and get written back to the database. That can lose a pending turn or bring back one that already finished. Keep saved route IDs readable without loading the adapter so both sources follow the same database-first rule.
**Context Used:** gateway/AGENTS.md ([source](https://github.com/nousresearch/hermes-agent/blob/main/gateway/AGENTS.md))
**Knowledge Base Used:** [Gateway session lifecycle and recovery](https://app.greptile.com/-/switch-tenant?tenant=nous-research&next=%2Fcustom-context%2Fknowledge-base%2Fnousresearch%2Fhermes-agent%2F-%2Fdocs%2Fgateway-session-lifecycle.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
</details>
<a href=""><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> Migration ignores the newer disable
If gateway.json enables platforms.qqbot and config.yaml disables platforms.qqbot-platform, startup honors the newer YAML setting. Migration instead gives qqbot priority regardless of where it was set, so it installs the plugin even though the user turned it off. Normalize both spellings in the shared loader before merging the layers so migration and startup agree.
Context Used: hermes_cli/AGENTS.md (source)
<details><summary>Prompt To Fix With AI</summary>
``This is a comment left during a code review.
Path: hermes_cli/left_core_migration.py
Line: 86-89
Comment:
**Migration ignores the newer disable**
If `gateway.json` enables `platforms.qqbot` and `config.yaml` disables `platforms.qqbot-platform`, startup honors the newer YAML setting. Migration instead gives `qqbot` priority regardless of where it was set, so it installs the plugin even though the user turned it off. Normalize both spellings in the shared loader before merging the layers so migration and startup agree.
**Context Used:** hermes_cli/AGENTS.md ([source](https://github.com/nousresearch/hermes-agent/blob/main/hermes_cli/AGENTS.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
</details>
<a href=""><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> Unchecked tools turn back on
If Telegram uses [hermes-qqbot, file], the picker expands hermes-qqbot but keeps it when saving because _platform_default_keys() no longer lists it. Uncheck terminal and the next read adds it back. Use the same preset definition for reading and saving. The old QQ preset only listed core tools, so it doesn't need to depend on the adapter.
<details><summary>Prompt To Fix With AI</summary>
``This is a comment left during a code review.
Path: hermes_cli/tools_config.py
Line: 498-504
Comment:
**Unchecked tools turn back on**
If Telegram uses `[hermes-qqbot, file]`, the picker expands `hermes-qqbot` but keeps it when saving because `_platform_default_keys()` no longer lists it. Uncheck `terminal` and the next read adds it back. Use the same preset definition for reading and saving. The old QQ preset only listed core tools, so it doesn't need to depend on the adapter.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
</details>
Fixed in d6224de3a529. _import_legacy_sessions_json now skips a key whose state.db row is held in _unparsed_routes, the same database-first rule it already applied to _entries. Test: test_an_older_sessions_json_copy_does_not_replace_the_held_db_route (a DB row sid-new, a mirror copy sid-old, a restart and a full save: the DB keeps sid-new). It is red on be507f47 and green now.
Fixed in d6224de3a529. The old key is no longer folded after the merge. _fold_alias_layer folds platforms.qqbot-platform (and gateway.platforms.qqbot-platform) into qqbot inside each layer, gateway.json, config.yaml and the managed overlay, before merge_platform_sections runs. The canonical key wins only within the same layer, so a newer config.yaml disable under either spelling beats a gateway.json enable, as at startup. Test: test_a_newer_yaml_disable_under_the_old_key_beats_a_gateway_json_enable; red on be507f47.
Fixed in d6224de3a529. You're right that the read/save definitions disagreed. hermes-qqbot now has one definition for both: _left_core_core_bundles() (left-core platform rows whose plugin registers no toolset). _explicit_toolsets reads it as _HERMES_CORE_TOOLS with or without the plugin, and _platform_default_keys() includes it, so a picker save drops it like any other preset. The adapter dependency from the previous fix is gone. Test: test_a_mixed_list_naming_hermes_qqbot_keeps_its_core_tools_and_an_unchecked_one_stays_off (read, uncheck terminal, save, re-read); red on be507f47.
Review: PR #159640 refactor: QQ Bot leaves core for the qqbot Hermes Labs plugin (auto-migrated) @ dcb08cef
<!-- review: verdict=changes_requested event=COMMENT critical=0 major=1 minor=0 ci=green head=dcb08cef428cbee2a9c3a77f6575c2bc4df56686 -->
Verdict: 🟡 Changes requested. Saved cron jobs still lose the old bundle's tools, and one Major-weight issue from an earlier review remains: a held route survives on disk but isn't available to the already-loaded store when QQ registers. Thanks @teknium1!
| Critical | Major | Minor | CI |
|:-:|:-:|:-:|:-:|
| 0 | 1 | 0 | ✅ green |
Checked:
aiohttp. A neighboring API-delete suite could not collect for the same reason.---
Major
M1: Saved cron jobs lose core tools when they name hermes-qqbot · hermes_cli/tools_config.py#L497
Confirmed from other reviewers
gateway/config.py:258 @greptile-apps[bot]: confirmed (two full saves retain the row and pending flag, but live lookup stays empty after late registration; a cold store finds it), Major weight.toolsets.py:217 @greptile-apps[bot]: already handled (Telegram picker retains the mixed list’s core tools before and after registry registration; M1 covers cron, not the picker).hermes_cli/config.py:211 @greptile-apps[bot]: already handled (real reload cleared the removed QQ_HOME_CHANNEL value).hermes_cli/left_core_migration.py:234 @greptile-apps[bot]: not reproduced (per-field credentials are intentional; split credentials still count).hermes_cli/left_core_migration.py:209 @greptile-apps[bot]: confirmed (qqbot_in_use() called the merged-block reader twice for split credentials; Yuanbao uses the shared notice), minor weight.gateway/webhook_targets.py:9 @greptile-apps[bot]: already handled (qqbot passes the webhook target check before plugin registration).hermes_cli/left_core_migration.py:233 @greptile-apps[bot]: already handled (legacy key is recognized for migration and resolves to QQ after registry registration).hermes_cli/tools_config.py:377 @greptile-apps[bot]: already handled (QQ no longer has a dedicated hermes tools row by design; explicit platform_toolsets picks still work).hermes_cli/config_defaults.py:3003 @BearHuddleston: already handled (Channels metadata returns a password field without the manifest).hermes_cli/left_core_migration.py:712 @BearHuddleston: already handled (head tests cover legacy disable names, the child-env strip set, and the Yuanbao exception).tests/hermes_cli/test_left_core_qqbot.py:55 @BearHuddleston: already handled (the test now distinguishes enabling an adapter from connecting it).gateway/session_persistence.py:510 @greptile-apps[bot]: already handled (two full saves preserved the newer DB session ID over the older mirror).hermes_cli/left_core_migration.py:89 @greptile-apps[bot]: already handled (the newer YAML disable under the old key beat the legacy JSON enable).hermes_cli/tools_config.py:504 @greptile-apps[bot]: already handled (unchecking terminal persisted on the next picker read and through a second save).gateway/session_persistence.py:493 @greptile-apps[bot]: already handled (a valid mirror replaced the corrupt timestamp even with QQ unregistered).hermes_cli/tools_config.py:501 @greptile-apps[bot]: already handled (the bare preset shows core tools without the plugin and retains them after save).hermes_cli/tools_config.py:496 @greptile-apps[bot]: already handled (the picker kept its core tools with an actual same-named registry alias).tests/hermes_cli/test_left_core_qqbot.py:199 @greptile-apps[bot]: not reproduced (for the picker case, a real alias preserved core selections without adding the fixture tool to the picker on either tree; runtime resolution is separate).@unsupportedpastels mapping for your Nov 24 changes-requested review (@ dcb08ce) onto the current head e800445e3343. The lane was rebased since your review, so SHAs below are the current ones.
Scope change since your review: QQ Bot is now an official default plugin (hermes-official-plugins, catalog default: true), not Hermes Labs (b58048b18c6c). The transition is staged: the plugin stands down on a core that still ships QQ Bot, and this PR removes core's adapter.
| Finding | Fix on current head | Test (verified locally on this head) |
|---|---|---|
| M1 saved cron enabled_toolsets: [hermes-qqbot, file] loses terminal/web_search (hermes_cli/tools_config.py#L497) | a79a7582647a: toolsets.RETIRED_CORE_BUNDLES = {"hermes-qqbot": core-tools bundle}, read by get_toolset / validate_toolset after TOOLSETS, ahead of a same-named MCP alias whose tools still merge. Kept out of TOOLSETS, hermes-gateway and every listing; the picker's _left_core_core_bundles reads the same table. Your patch, with the if name == swapped for the table; you're Co-authored-by. | tests/hermes_cli/test_left_core_qqbot.py::test_saved_qqbot_preset_still_selects_core_tools_at_runtime[False/True] (your test verbatim): pass |
| Major (confirmed from greptile gateway/config.py:258) held route survives on disk but the already-loaded store never sees it once QQ registers | Generic fix on main (#160253, in this branch's base 7c57dbf4): c33d2da14797 _promote_held_routes_locked moves a held row into the live index once its platform is a Platform member (and drops a held copy the live index already owns); profile delete/rename and session delete/expiry handle held rows (5d3c91332057, 4b6d36dcabe1). This PR no longer carries its own copy of the seam. | tests/gateway/test_held_route_late_platform.py (15 tests, e.g. test_a_held_route_s_stop_still_applies_once_its_platform_registers, test_a_held_route_s_crash_left_turn_resumes_once_its_platform_registers): pass |
| minor (confirmed from greptile left_core_migration.py:209) platform_in_use merges the platform block twice | Was not fixed on the previous head: be507f47's message claimed _block_on but the hunk was lost in a rebase. Fixed now in e800445e3343: in_use and platform_configured_on both judge one merged block through _block_on. | test_one_qqbot_check_merges_the_home_s_platform_block_once: red on a6f9ca44b9 (2 merges), green now |
| ↳ same thread: Yuanbao should use the shared _labs_notice | Not a bug after the scope change: once QQ Bot became official (b58048b18c6c), Yuanbao is the only Labs row, so the shared Labs helper had one caller. Yuanbao keeps _yuanbao_notice (same text plus its stale-disable sentence); QQ's official notice carries no placement sentence. | tests/hermes_cli/test_left_core_yuanbao.py: pass |
The other rows in your "Confirmed from other reviewers" list were marked already handled / not reproduced and are unchanged.
Local run on this head: test_left_core_qqbot.py, test_left_core_yuanbao.py, test_left_core_migration.py, test_held_route_late_platform.py: 145 passed; scripts/check ok. Unanswered bot/human thread sweeps are clean.
<!-- greptile_outside_diff -->
<h3>Comments Outside Diff</h3>
No findings outside the diff remain.
Shared fixes from the Feishu #159651 Greptile round, pushed as 349f2e372ad2: 3bb387ad0ff4 keeps the /update notice until its plugin platform registers (main had the same Platform(platform_str) delete path; patch-id matches #159651's b020edd0). c8528d438862 makes /reload drop only its own profile's plugin env names and never a launch-only one. 349f2e372ad2 means a profile that already has qqbot still hears the plugins.isolation: host notice. Each has a test that was red on c92fafad.
<!-- Blacksmith CI Status -->
Found 14 test failures on Blacksmith runners:
Failures
| Test | View Logs |
| --- | --- |
| <code>test_cold_cli_builds_own_runtime_discovers_plugins_and_repairs_app[None]</code> | View Logs |
| <code>test_file_ops_dead_cwd/</code><br /><code>test_sandbox_job_that_deletes_its_cwd_is_still_tracked_and_session_cwd_is_untouched</code> | View Logs |
| <code>test_plugin_identity_property/</code><br /><code>test_every_plugin_list_reader_gives_the_loaders_verdict[acme-tool]</code> | View Logs |
| <code>test_plugin_identity_property/</code><br /><code>test_every_plugin_list_reader_gives_the_loaders_verdict[agent-importers]</code> | View Logs |
| <code>test_plugin_identity_property/</code><br /><code>test_every_plugin_list_reader_gives_the_loaders_verdict[camofox]</code> | View Logs |
| <code>test_plugin_identity_property/</code><br /><code>test_every_plugin_list_reader_gives_the_loaders_verdict[disk-cleanup]</code> | View Logs |
| <code>test_plugin_identity_property/</code><br /><code>test_every_plugin_list_reader_gives_the_loaders_verdict[github-copilot]</code> | View Logs |
| <code>test_plugin_identity_property/</code><br /><code>test_every_plugin_list_reader_gives_the_loaders_verdict[homeassistant]</code> | View Logs |
| <code>test_plugin_identity_property/</code><br /><code>test_every_plugin_list_reader_gives_the_loaders_verdict[langfuse]</code> | View Logs |
| <code>test_plugin_identity_property/</code><br /><code>test_every_plugin_list_reader_gives_the_loaders_verdict[mcp-serve]</code> | View Logs |
...and 4 more test failures. View all on Blacksmith
<a href="https://app.blacksmith.sh/NousResearch/codesmith/hermes-agent/pr/159640?prompt=Repository%3A+NousResearch%2Fhermes-agent%0ABranch%3A+laneb%2Fqqbot-labs%0APR%3A+%23159640%0A%0AFix+these+failing+tests%3A%0A%0A1.+test_cold_cli_builds_own_runtime_discovers_plugins_and_repairs_app%5BNone%5D%0A2.+test_file_ops_dead_cwd%2Ftest_sandbox_job_that_deletes_its_cwd_is_still_tracked_and_session_cwd_is_untouched%0A3.+test_plugin_identity_property%2Ftest_every_plugin_list_reader_gives_the_loaders_verdict%5Bacme-tool%5D%0A4.+test_plugin_identity_property%2Ftest_every_plugin_list_reader_gives_the_loaders_verdict%5Bagent-importers%5D%0A5.+test_plugin_identity_property%2Ftest_every_plugin_list_reader_gives_the_loaders_verdict%5Bcamofox%5D%0A6.+test_plugin_identity_property%2Ftest_every_plugin_list_reader_gives_the_loaders_verdict%5Bdisk-cleanup%5D%0A7.+test_plugin_identity_property%2Ftest_every_plugin_list_reader_gives_the_loaders_verdict%5Bgithub-copilot%5D%0A8.+test_plugin_identity_property%2Ftest_every_plugin_list_reader_gives_the_loaders_verdict%5Bhomeassistant%5D%0A9.+test_plugin_identity_property%2Ftest_every_plugin_list_reader_gives_the_loaders_verdict%5Blangfuse%5D%0A10.+test_plugin_identity_property%2Ftest_every_plugin_list_reader_gives_the_loaders_verdict%5Bmcp-serve%5D%0A11.+test_plugin_identity_property%2Ftest_every_plugin_list_reader_gives_the_loaders_verdict%5Bqqbot%5D%0A12.+test_plugin_identity_property%2Ftest_every_plugin_list_reader_gives_the_loaders_verdict%5Bsingularity%5D%0A13.+test_plugin_identity_property%2Ftest_every_plugin_list_reader_gives_the_loaders_verdict%5Bspotify%5D%0A14.+test_plugin_identity_property%2Ftest_every_plugin_list_reader_gives_the_loaders_verdict%5Byuanbao%5D%0A&entry=pr_comment&ref=gh_comment&autoLogin=true&autoSend=true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-dark-v2.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-v2.svg"><img alt="Fix with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-v2-3x.png" width="149" height="28"></picture></a>
<sup>Need help on this PR? Tag <code>@codesmith-bot</code> with what you need.</sup>
BearHuddleston
teknium1
Changes since approval (head
ce8de9a96ff3)Rebased from
9f67345b(ond6ed9a26) ontomainc52847ccbd7d. Since9f67345b, main has merged Weixin #159644, Meet/Teams #159653, and #161273, which splitsleft_core_migration.pyinto a package. Nothing below changes what QQ Bot users get. These are the conflict resolutions and the fix-ups that came with them:left_core_migrationpackage (#161273). On main the file was at 1,951 lines; this PR's rows took it to 2,072, over the 2,000-line file cap. #161273 split it into topic modules first, as a behaviour-neutral move, and this PR's hunks now land in them. Each commit's version of the single file was re-split with the same deterministic generator, so the final package matches the split of this branch's last single-file version (2e67ff9c, the approved head plus the rebase fix-ups below) byte for byte:-
qqbot_in_useand its notice go toplatform_use.-
_layered_config,_installingandleft_core_unfinishedgo tohomes.-
platform_install_commandandplatform_home_env_vargo tohints.- The said-once marker goes to
migrate.- Tests and
cron/scheduler_delivery_unloadedimport private names from the module that owns them. The caplog test listens on the package logger, the parent of every topic module's logger.- Modules after this PR:
migrate731 lines,rows304, the rest under 250.legacy_platform_aliasduplicated main'sretired_platform_keys. Main's version is kept and the QQ test uses it.-
tools_config: QQ's core-bundle reader is replaced by main'sRETIRED_CORE_BUNDLESwith ahermes-qqbotrow. One_resolve_presetreads it.-
default_plugins: the legacy-key line gives way to main's identity rule, and oneleft_unfinishedremains. A later QQ commit converges on the same result.-
_pending: rows and seen sets merged._placed_copy_removedis kept in QQ's new branches.- cron: the not-configured origin hint reads
scheduler_delivery_unloaded.moved_platform_hint.cron/scheduler_delivery.pystays at 2,000 lines.faeb5b2b) changed the coreplugins/platforms/qqbot/adapter.pythat this PR deletes. The deletion is kept. The same one-linesent.link_fallback = Trueon the image-to-text fallback is not yet in the officialqqbotplugin (hermes-official-plugins/qqbot/adapter.py), so a QQ media-only turn whose image upload is refused still reports delivered until the plugin gets it. That is a plugin follow-up and does not change this PR.get_default_hermes_roottake thehome=keyword main now passes. Test fixtures that main moved onto QQ Bot as "a platform core still ships" now use a platform core still bundles, because QQ Bot no longer is one (2e67ff9c).Changes since approval (head
9f67345b035c)Rebased from
aeeee5a3(on5db6268e) ontomaind6ed9a26. Conflict resolutions that change behaviour:left_core_migration._pending: WeCom's per-plugintoldset (one post-split install line per plugin, not one per row; WeCom has two rows) met this PR's "read once, record first, report once" refactor (a failed config write reports one outcome, once). Both kept:predatesis read once, the kept-off sentence is said after_record_migration, and the post-split line goes throughtold. Proof: withtoldremoved, 3 WeCom tests fail (test_a_home_from_v55_on_that_sets_wecom_up_is_told_the_install_command[both-modes],test_a_home_that_cannot_prove_it_ran_core_wecom_is_told_the_install_command[no-config|unstamped]);test_a_failed_config_write_reports_one_outcome_oncepasses.test_left_core_+test_default_plugins: 376 passed.LEFT_CORErows, plus docs and a test fixture list.scheduler_delivery_unloadedtakes main'smoved_platform_hintelif.cron/scheduler_delivery.pycame out at 2001 lines after the rebase. One line folded to get it back to 2000 (_resolve_home_env_var). Same hunk in #159651.New commits from the #159651 review (shared code, same hunks here):
validate_target_ref_fnhas the final say. The old code fell back to thechat[:thread]split, so an exact route on the raw chat could pass an address the plugin refuses. Red→green:test_a_ref_the_primarys_plugin_refuses_is_never_sent_through_its_route.left-core.installing-<plugin>marker now spans the install, andleft_core_unfinishedcovers both the placed and the installing marker. Red→green:test_a_qqbot_tree_the_migration_left_mid_install_is_installed_by_the_next_start.Review fix (head
596edd4390b4)596edd4390b4fix(left-core): a start reports each row once when its pass repeats. This is the same hunk as #159651ac1d5b84ef6e. A catalog-miss orso it is offreport stamps the failure marker, so the start re-passes, and_pendingused to report the row again: the line was logged twice per gateway start. Test:test_left_core_migration.py::test_a_start_reports_a_row_once_when_its_pass_repeats, red on4a9075b40157(2 failed,assert 2 == 1) and green here. Local:test_left_core_+ catalog_platform files ran 267 + 17 passed / 0 failed. Fullscripts/checkran 22 checks, ok. This PR has no hermes-tag change: itscatalog_platforms.pyhas no_left_core_env.What this does, in plain words
QQ Bot (Tencent QQ's official Bot API v2, as a Hermes messaging platform) leaves Hermes core. It becomes the official
qqbotplugin in NousResearch/hermes-official-plugins, maintained by Nous Research, and like Weixin it is installed by default on every Hermes home (catalogdefault: true), idle until a QQ App ID and secret are set.Existing users do nothing: the first
hermes update(or the next agent/gateway start) sees that the profile ran QQ Bot and installs the plugin from the catalog once, and that same gateway start serves it. SameQQ_/QQBOT_env vars (legacyQQ_HOME_CHANNELincluded), sameplatforms.qqbotconfig, sameQQBOT_HOME_CHANNEL. New users already have it: the existing default-plugin installer (hermes_cli/default_plugins.py) puts it on every home once, and with no QQ credentials the gateway never starts the adapter (zero qqbot log lines). Whichever installer runs first, each home gets exactly one automatic install, and a laterhermes plugins remove qqbotsticks.Round 17 (head
a6f9ca44b9c0)Platform.QQBOTamong the named profile's fresh platforms; it now namesdiscord(b3e418368eea).5b609cf830f8(same_pendinghunk as #159651443284d0addb, equalgit patch-id) keeps the removal and says the existing "…so it is off. Runhermes plugins install qqbot" line on the install backoff. Testtest_a_qqbot_the_default_installer_placed_and_the_user_removed_stays_removed_and_is_said_offis red on the old head (1 failed), green here. The docs page says the same.d31fbbfa076a(the later ofqqbot/qqbot-platformreplaces the other, as the gateway reads them; 2 tests red → green);e485f9960ac0(a non-listrequires_env/optional_envreads as no env names, so one bad manifest cannot stop plugin discovery; shared with #159651);66f891f77f0c(cron reports a destination skipped because its platform left core, also beside a delivered one and for a savedorigin; shared);304de8b2a9ea+a6f9ca44b9c0(an automatic install keeps aplugins.disabledentry the home already lists; shared). The/reloadenv thread is answered inline: core's existing rule for its own names, unchanged.tests/cron/: 2,760 passed, 0 failed, 15 skipped.scripts/check --only health, boundary lint, no-tmp-literals, doc links ok.Live, round 17 (real
gateway run --force, fake HOME, endpoints behind a closed proxy)Trees:
v0.23.4(stamped0.23.4bydeb_version.py --release-version v0.23.4→write_install_stamp.py), and the removal heads stamped0.23.4+canary.20261127T024356Zby the same producer forcanary.20261127T024356Z-v0.23.4. The fixture catalog pins qqbot7e8bc4e/ feishu2c8be75,default: true. Each home had creds in.env, then ran v0.23.4's realdefault_plugins.install_defaults(thehermes updatestep): both plugins were placed idle and recorded in_default_plugins_installed.| Leg | QQ Bot | Feishu |
|---|---|---|
| removed the idle copy (
hermes plugins remove <x>on v0.23.4), then upgrade: new head | not reinstalled; logs⚠ QQ Bot moved out of core into the 'qqbot' plugin, which this profile does not have, so it is off. Runhermes plugins install qqbot.; one kept notice | not reinstalled; same line forfeishu; one kept notice (logged twice on this first start, because the toolset-scope conversion changes the settings fingerprint and the start re-passes; the kept-notice queue dedupes) || same, old head (80868f4 / 99beefcc) | silent, not reinstalled | silent, not reinstalled |
| existing user (idle copy kept), upgrade | plugin adapter
hermes_plugins.qqbotconnects in the same start (refused at the closed proxy);_left_core_installed: [qqbot]|hermes_plugins.feishu✓ feishu connectedin the same start;_left_core_installed: [feishu]|Real
~/.hermes/config.yamlmd5c72b5ba9…before and after.Round 16: staged transition instead of a version floor
The
>=0.23.5floor is gone. Stable and canary both report 0.23.4 today (canary payloads read0.23.4+canary.<stamp>), so that floor locked every shipping build out, including a canary that has already dropped core's adapter. Both plugins now install on Hermes 0.23.4 or later. They do nothing while the running core still bundles the same platform. The check is whether core's files are present:plugins/platforms/qqbot/for QQ Bot;plugins/platforms/feishu/ortools/feishu_doc_tool.pyfor Feishu. On such a coreregister()registers nothing and logs one DEBUG line (... the plugin stays inactive until core drops it), and core's own adapter and tools keep serving. The first core without them gets the plugin's adapter, with the same settings and tool names.plugin.yamlnow shipsprovides_tools: [].hermes plugins validatefails any declared name that collides with a built-in, and core still shipsfeishu_doc_read/feishu_drive_. On that core the plugin registers none of them, so it validates cleanly on main. Follow-up after the core removal merges: put the five names back inprovides_tools. Until then, validate on the post-removal core reports "undeclared tools registered" forfeishuonly. Runtime is unaffected, because user plugins load eagerly and register the tools fromregister(). The catalog entry keeps listing the five tools.register_toolreturnsNonewith a WARNING on every start. Staying inactive avoids both.Rollout order: fixed plugin PR merged → catalog entry re-pinned to the plugin's MERGED sha → check that the published catalog (
hermes plugins browse/ a catalog fetch from main) returns the entry → core removal merges LAST (→ Feishu only: theprovides_toolsfollow-up).Live probe (real version strings, real installs, real
gateway run --force)Version strings came from the real producers. The
v0.23.4worktree goes through git (0.23.4). Thecanary.20261126T064809Z-v0.23.4worktree got its stamp fromscripts/termux/deb_version.py --release-version <tag>, thenscripts/write_install_stamp.pywith the Termux build's arguments (0.23.4+canary.20261126T064809Z). The removal heads ran twice: once stamped by the same producer forcanary.20261127T024356Z-v0.23.4(0.23.4+canary.20261127T024356Z), and once through git (0.23.4, display0.23.4+777). The fixture catalog in each tree pins the pushed plugin commit (qqbot7e8bc4e, feishu2c8be75) withrequires_hermes: ">=0.23.4"anddefault: true. Endpoints sat behind a closed proxy; each home had creds in.env.| Leg | Core (reported version) | QQ Bot | Feishu |
|---|---|---|---|
| Existing profile, default install on the old core | v0.23.4 (
0.23.4) | installed + enabled; core adapterhermes_plugins.platforms__qqbotserves; plugintools []+ DEBUG stand-down | installed + enabled; core adapterplatforms__feishuconnects; plugintools []; no shadow warnings || Same | canary.20261126 (
0.23.4+canary.20261126T064809Z) | same | same || Upgrade of that home | removal head, git (
0.23.4) | plugin adapterhermes_plugins.qqbotattempts the token in the same start; no reinstall (plugin dir mtime unchanged) | plugin adapterhermes_plugins.feishuconnects; 5 tools fromhermes_plugins.feishu.feishu_doc_tool; no reinstall || Upgrade of that home | removal head, canary-stamped (
0.23.4+canary.20261127T024356Z) | same | same || Existing profile, no plugin (left-core migration) | removal head, canary-stamped | installed once (
_left_core_installed: [qqbot]) + plugin adapter in the same start |✓ Installed the 'feishu' plugin…+ connects in the same start || Same | removal head, git | same | same |
| hermes-tag profile: stable, then removal head ×2 | v0.23.4, then canary-stamped removal head | — | stable:
Hermes Tagserves Feishu over core, official plugin inactive. First removal start: one⚠ The community 'hermes-tag' plugin…line, also kept inleft-core-notices.jsonlfor the next attended turn, and the official plugin connects. Second start: no repeat |Cross-check from the same runs: on the Feishu removal head, the default-installed qqbot plugin stays inactive (core still ships QQ Bot), and the reverse holds too.
hermes plugins validatepasses for both plugins on main, v0.23.4, the canary and the QQ removal head. Feishu on the Feishu removal head reports "undeclared tools registered" until the follow-up above. The real~/.hermes/config.yamlmd5 was the same before and after (c72b5ba9…).Round 16: no code change in this PR. The floor lived only in the plugin and catalog: official#520
7e8bc4e, catalog #1596417cd30f6. The live table above ran this head (80868f4d77c1) as a git checkout and canary-stamped. Shared commits with #159651 keep the same patch-id:dd3669581f63=f9be92efa16b(predicate factory) and80868f4d77c1=d561c62ce397(emptyrequires_env)._Round 16 supersedes the sections below wherever they mention a
>=0.23.5floor, a probe tree stamped0.23.5, or a different merge order. The rollout order above is the current one._Slate (merge order)
1. This PR (core removal + LEFT_CORE row)
2. NousResearch/hermes-official-plugins#520, the
qqbotplugin (history kept: 157 commits; replaces the closed Labs PR NousResearch/hermes-labs-plugins#110)3. Data-only catalog entry: NousResearch/hermes-agent#159641 (
tier: official,default: true,requires_hermes: ">=0.23.5";hold, re-pinned to the merged plugin sha)Until 3 lands, a migrating home logs "cannot find in the plugin catalog yet" plus the notice and retries with backoff; a release never sees the gap if all three land before it.
Changes
plugins/platforms/qqbot/*and its 8 test files (moved to the plugin),Platform.QQBOT(Platform("qqbot")resolves once the plugin registers),toolsets.pyhermes-qqbotand itshermes-gatewayinclude, thehermes_cli/platforms.py,tools_config,dump, setup home-channel and web-messaging rows, theQQ_OPTIONAL_ENV_VARS/ env-key list entries, webhook deliver set, startup allowlist list,/update's built-in list entry (the plugin's entry keepsallow_update_command=True), the shippedqqbot: [hermes-qqbot]row incli-config.yaml.example, the compat required-name rows for the deleted folder (as the Yuanbao/HA moves), and the qqbot boundary-baseline lines. Shared tests drop only their qqbot cases.hermes_cli/left_core_migration.py): aLEFT_CORErowqqbotwhosein_useis oneplatform_in_use("qqbot", ...)call replicating core's gate on main (register.is_connected+ theEnvCredrow):app_id+client_secretfrom the mergedplatforms.qqbotblock (extra or top level; a top-levelqqbot:block bridged), elseQQ_APP_ID+QQ_CLIENT_SECRETin the home's env layers / secret scope;platforms.qqboton; orhermes-qqbotselected for another platform (the Home Assistant precedent).enabled: false, orplugins.disablednamingplatforms/qqbot/ core's manifest nameqqbot-platform, is not use. The row:-
plugin_key="platforms/qqbot",plugin_names=("qqbot-platform",): core's old disable keeps holding over the plugin;-
secret_env=QQ_CLIENT_SECRET,private_env= the other manifest names:_HERMES_PROVIDER_ENV_BLOCKLIST,_ALWAYS_STRIP_KEYSand_ADAPTER_SECRET_ENVare identical to main (checked by importing both trees; 14 QQ_/QQBOT_ names).QQ_CLIENT_SECRETjoinsQQ_STT_API_KEYonlocal_env_policy's short adapter-secret list becausegateway_restart_envreads that set directly;- no toolsets/off_platforms/legacy_toolsets:
hermes-qqbotcarried only core tools and the plugin registers none; Yuanbao's derivedoff_platformsnow listsqqbot;-
platform="qqbot",enable_env, and_qqbot_notice: no placement sentence (official rows carry none, as Feishu's), only what changed for the home: a bareqqbotinplugins.disablednow turns it off, andplugins.isolation: hostkeeps a catalog platform adapter off. Yuanbao keeps its own Labs notice unchanged.- Profile-gate detection now takes every LEFT_CORE platform as a gate prefix, so
QQBOT__ALLOWED_stays a profile gate withoutPlatform.QQBOT. This also makesYUANBAO_/HOMEASSISTANT_gate names count again, as they did before those platforms left the enum.QQstays in_EXTRA_GATE_ENV_PREFIXES._pending+_DEFAULT_INSTALLED_KEY, default_plugins_recorded); the QQ Bot row only joins it. Held routes for a late-registering platform also come from main (#160253); this PR no longer carries its own copy of either.QQ_HOME_CHANNELlegacy alias, doctor's rename warning, theQQ_prefix alias for profile channel ownership, thesession_rulesroute enum, desktop/TUI source lists.hermes-qqbotstays valid as a retired telemetry toolset value (RETIRED_TOOLSET_NAMES; the contract file is 1,982 lines).messaging/qqbot.md(+ zh-Hans) is now a short "moved to the official qqbot plugin, installed by default" page; toolsets reference, messaging index and other mentions say the same.Live migration probe
Real
gateway run --forceprocesses (own PID, killed after ~45 s) in a fakeHOME+HERMES_HOME+XDG_CONFIG_HOME+HERMES_GATEWAY_LOCK_DIR, on agit archiveof this head2d034b04c21. The catalog fixture'sqqbotentry istier: official,default: true, pinned to plugin PR #520 head20a9a52ed021. All outbound HTTP goes through a proxy on a closed loopback port (QQ's token URL is not env-overridable;NO_PROXYexempts the git/package hosts), so the connect is refused after the adapter is created. The md5 of the real~/.hermes/config.yamlwas equal before and after (d57827e7…).| Leg | Home | Result |
|---|---|---|
| 1 first start |
QQ_APP_ID+QQ_CLIENT_SECRETin.env|✓ QQ Bot moved out of core — installed the 'qqbot' plugin from the catalog (QQ_/QQBOT_ settings … unchanged).once; 0 lines with "not supported"/"Labs"; the plugin's adapter (hermes_plugins.qqbot.adapter) fetches a token (refused) in the SAME start;_left_core_installed: [qqbot], enabled || 2 second start | same home | no install line; plugin tree mtime unchanged; plugin adapter connects again |
| 3 fresh, no creds |
install_defaults(home)(fixture default) then a gateway start |✓ Installed default plugin 'qqbot', enabled,_default_plugins_installed: [qqbot]; the gateway logs zero qqbot lines (no warning, no error),No messaging platforms enabled., no connection opened || 4a install-once | creds;
migrate_home→install_defaults→migrate_home, thenhermes plugins remove qqbot, then both again | exactly 1 install (left-core),install_defaults -> {'installed': [], 'owed': []}; after remove neither reinstalls (dir stays gone) || 4b install-once | creds;
install_defaults→migrate_home→install_defaults, remove, both again | exactly 1 install (default),left_core -> []; after remove neither reinstalls |Earlier legs on the previous head (base creds = core adapter; no catalog entry = "cannot find in the plugin catalog yet"; multiplex secondary with creds only in
profiles/b/.env= installed only into b and connects there) are unchanged by this placement change. First start also logs that the plugin'sqrcodedependency was installed after the process started (setup-only; harmless).Round-12 rebase onto the merged enablers (head
1ee397fc8c24)Rebased onto main after #160253 / #160177 / #160180 / #160183 / #160200. Dropped this PR's own copies for main's: every
gateway/session.py/session_lifecycle.py/session_persistence.pyhunk andtests/gateway/test_unparsed_route_survives_save.py(main'stest_held_route_late_platform.pycovers the same cases), and the_pending/default_pluginsone-install hunks.git diff origin/main -- gateway/session.py hermes_cli/default_plugins.pyis empty. The predicate factory and the off-platforms/cron/webhook commit are unchanged (same patch-ids), so other move PRs can carry them byte-identically.Live, real
gateway run --forceon agit archiveof this head, fakeHOME/HERMES_HOME/XDG_CONFIG_HOME/lock dir, fixture catalogqqbot(official,default: true) pinned to #520 head20a9a52ed021, all other HTTP through a closed loopback proxy. Real~/.hermes/config.yamlmd5 equal before/after (d57827e7…).| Leg | Setup | Result |
|---|---|---|
| A existing user |
QQ_APP_ID+QQ_CLIENT_SECRETin.env, no plugin | one✓ Installed the 'qqbot' plugin from the catalog for QQ Bot…line;hermes_plugins.qqbot.adapterfetches a token (refused) in the same start and retries;_left_core_installed: [qqbot], enabled || B creds added live | fresh home, gateway running ~60 s (no qqbot dir), then
hermes config set QQ_APP_ID …andQQ_CLIENT_SECRET …| 2ndconfig setprints "Running gateway is installing the plugin this platform needs…"; the live reconcile installsqqbotand the plugin adapter starts in the same process ~10 s later, no restart || C setup listing |
available_catalog_platforms()| fresh home listsqqbot(official, installable); the leg-B home (installed) does not |The probe tree carries an install stamp with
baseVersion 0.23.5because #520 declaresrequires_hermes: ">=0.23.5"and main currently reports 0.23.4; without it the install is refused with the version message.Composite-round fixes (same hunk in #159640 and #159651)
own_platform_only, and_derive_off_platformsgives it every platform core knows plus every platform any LEFT_CORE row moved out. The hand lists_YUANBAO_OFF_PLATFORMS/_FEISHU_OFF_PLATFORMSare gone, so whichever of QQ Bot / Feishu merges second cannot leaveqqbotoff Feishu's list (or either off Yuanbao's). Test:tests/hermes_cli/test_left_core_off_platforms.py(stand-in rows + the shipped rows).qqbotentry), so a route a secondary profile's plugin serves is not skipped. Crondeliver: <platform>:<chat>delivers through the plugin's sender once it is loaded; without the plugin the delivery error and the preflight message namehermes plugins install <plugin>instead of "no delivery target resolved". Test:tests/cron/test_cron_left_core_platform_route.py(red on the previous head: the no-plugin cases and the webhook load of the other left-core platforms).Tests
test_left_core_,test_default_plugins*,test_held_route_late_platform,test_platform_hot_start,tests/cron/, catalog-platform/reconcile files viascripts/run_tests.sh: 234 files, 2,581 passed, 0 failed, 9 skipped (Windows-only). CI 16 passed / 20 skipped.tests/hermes_cli/test_left_core_qqbot.py(21 cases):in_usetrue for.envcreds, config-only extras,platforms.qqboton, a top-levelqqbot:block,hermes-qqboton another platform; false for a fresh home, half a credential set,enabled: falsewith env creds,plugins.disabledplatforms/qqbot/qqbot-platform; install once with no placement notice; a plugin the default installer placed and the user removed is not reinstalled by left-core, and vice versa; gate-env and strip-set parity. Red on base70634248084b(15 failed, 4 passed: the parity and fresh-home cases hold there by design), green on head.scripts/run_tests.sh(fake HOME): 1,566 passed, 0 failed, 16 skipped (previous head); after this placement change the left-core + default-plugin files: 131 passed, 0 failed.scripts/check --only health,boundary_lint.py --check, ruff on touched files,check_no_tmp_literals.py,check_doc_links.py: ok.git archiveof this branch (QQ Bot dir and enum member gone): 116 passed;hermes plugins validatepassed;scan_pluginsafeon main andv0.23.4.Not covered
.env, not an external secret source (that path is the shared Yuanbao code, unit-tested there).required_names.pyrows dropped as in the Yuanbao move: an update swap from v0.22.3–v0.23.2 no longer finds the QQ folder during the swap scan.plugins/platforms/qqbotpath are not ported here; they belong in hermes-official-plugins now.Infographic
!qqbot-leaves-core