Automatically Restart Gateway after Model Change - #266
Conversation
fix(gateway): implement detached daemon restart on model change
|
Thanks for looking into this, @toms119! Really appreciate you digging into the gateway code and thinking about the user experience around model switching. Good news — the If you were seeing a crash after changing models, that might be a separate issue worth investigating — could you share the error output if it happens again? We'd love to track down the root cause. It's possible it was a transient API error with the new model endpoint rather than the model switch itself. The reason we're cautious about the restart approach is that killing and relaunching the gateway process would drop all active connections (Telegram, Discord, etc.) for all users, which could be disruptive in a multi-user setup. The current "hot swap" behavior avoids that entirely. Thanks again for the contribution — always great to have more eyes on the codebase! 🙏 |
|
Thank you Teknium for reviewing and your explanation, I'm loving hermes agent. |
The installer verified the downloaded codebase-memory-mcp tarball against a checksums.txt fetched from the same GitHub release as the tarball. That proves the download wasn't corrupted in transit; it proves nothing about the publisher. Anyone able to alter the release alters both files together and verification still passes. Replaced with per-arch sha256 values pinned in the script. A hash committed here is an independent reference: it fails closed if the tag is ever re-pointed or the asset re-uploaded. This matters more than usual because cbm-code-discovery-gate executes the binary on every PreToolUse once the hook is registered — a swapped artifact would run constantly, not once. It is also the pattern this repo's own gitleaks workflow already uses (pinned by version AND tarball sha256), so this is consistency rather than novelty. An arch with no pinned hash is now a hard stop rather than a fall-through to an unverified install. Provenance: both linux tarballs were downloaded and sha256sum'd locally, and the computed digests matched the release's checksums.txt. The pinned values are the computed ones, not transcribed. Mirrors crm-pipeline NousResearch#266.
The installer verified the downloaded codebase-memory-mcp tarball against a checksums.txt fetched from the same GitHub release as the tarball. That proves the download wasn't corrupted in transit; it proves nothing about the publisher. Anyone able to alter the release alters both files together and verification still passes. Replaced with per-arch sha256 values pinned in the script. A hash committed here is an independent reference: it fails closed if the tag is ever re-pointed or the asset re-uploaded. This matters more than usual because cbm-code-discovery-gate executes the binary on every PreToolUse once the hook is registered — a swapped artifact would run constantly, not once. It is also the pattern this repo's own gitleaks workflow already uses (pinned by version AND tarball sha256), so this is consistency rather than novelty. An arch with no pinned hash is now a hard stop rather than a fall-through to an unverified install. Provenance: both linux tarballs were downloaded and sha256sum'd locally, and the computed digests matched the release's checksums.txt. The pinned values are the computed ones, not transcribed. Mirrors crm-pipeline NousResearch#266.
This patch fixes a fatal crash occurring when the model is updated via Telegram. It uses a detached subprocess to allow the gateway to restart itself in the background without severing the active connection.