fix(hermes-zulip-plugin): default to master branch, add gateway restart

- Switched default branch from feat/zulip-streaming to master
- Added Step 5: gateway restart with smoke check after plugin install
- Plugin changes require restart to take effect for a valid test
- Outstanding feature branch merges should be addressed post-install
This commit is contained in:
root
2026-07-08 17:51:19 +00:00
parent 09efbdf4e5
commit 1dc4155d9a
+44 -14
View File
@@ -3,9 +3,10 @@ kind: function
name: hermes-zulip-plugin name: hermes-zulip-plugin
description: > description: >
Installs or updates the Zulip platform plugin for any Hermes agent from the Installs or updates the Zulip platform plugin for any Hermes agent from the
canonical zulip-platform-plugins repo. Ensures the agent runs the latest canonical zulip-platform-plugins repo (master branch). Ensures the agent runs
adapter with all Zulip chat fixes (_strip_html, streaming, event recovery). the latest adapter with all Zulip chat fixes (_strip_html, streaming, event
Runs a post-install verification and sends a relay success signal. recovery). Verifies the installation, restarts the gateway, and sends a relay
success signal.
agent: abiba agent: abiba
version: 1.0.0 version: 1.0.0
status: active status: active
@@ -18,17 +19,17 @@ Single-shot function that pulls the latest zulip-platform plugin from the
canonical git repo, installs it to the correct Hermes bundled plugin path, canonical git repo, installs it to the correct Hermes bundled plugin path,
verifies the installation, and signals completion. verifies the installation, and signals completion.
Distinct from `hermes-zulip-restore`: this contract only touches the plugin Distinct from `hermes-zulip-restore`: this contract is focused on the plugin
layer. It does NOT verify env credentials, restart the gateway, or validate layer and a targeted gateway restart. It does NOT verify env credentials or
the live Zulip connection. Use `hermes-zulip-restore` for full connectivity run a live Zulip connection test. Use `hermes-zulip-restore` for full
recovery. connectivity recovery including end-to-end DM validation.
## Parameters ## Parameters
| Param | Type | Required | Default | Description | | Param | Type | Required | Default | Description |
|-------|------|----------|---------|-------------| |-------|------|----------|---------|-------------|
| `target` | string | yes | — | Agent name: `mumuni`, `tanko`, or `koby` | | `target` | string | yes | — | Agent name: `mumuni`, `tanko`, or `koby` |
| `branch` | string | no | `feat/zulip-streaming` | Git branch to pull (overridable for pinning) | | `branch` | string | no | `master` | Git branch to pull (overridable for pinning) |
## Maintains ## Maintains
@@ -61,7 +62,7 @@ recovery.
| Field | Value | Trust | | Field | Value | Trust |
|-------|-------|-------| |-------|-------|-------|
| Git repo | `https://git.sysloggh.net/SyslogSolution/zulip-platform-plugins.git` | ✅ Verified | | Git repo | `https://git.sysloggh.net/SyslogSolution/zulip-platform-plugins.git` | ✅ Verified |
| Default branch | `feat/zulip-streaming` | ✅ Verified | | Default branch | `master` (contains all merged fixes including `feat/zulip-streaming`) | ✅ Verified |
| Bundled adapter path | `<HERMES_HOME>/hermes-agent/plugins/platforms/zulip/` | ✅ Verified | | Bundled adapter path | `<HERMES_HOME>/hermes-agent/plugins/platforms/zulip/` | ✅ Verified |
| Adapter files | `__init__.py`, `adapter.py`, `plugin.yaml` | ✅ Verified | | Adapter files | `__init__.py`, `adapter.py`, `plugin.yaml` | ✅ Verified |
| Strip-html commit | `55ca15d` (minimum) | ✅ Verified | | Strip-html commit | `55ca15d` (minimum) | ✅ Verified |
@@ -148,7 +149,34 @@ grep -q "_strip_html" {{hermes_home}}/hermes-agent/plugins/platforms/zulip/adapt
grep "^version:" {{hermes_home}}/hermes-agent/plugins/platforms/zulip/plugin.yaml || true grep "^version:" {{hermes_home}}/hermes-agent/plugins/platforms/zulip/plugin.yaml || true
``` ```
### Step 5: Send Relay Success Signal ### Step 5: Restart Gateway
Plugin changes require a gateway restart to take effect:
```bash
cd {{hermes_home}}/hermes-agent
# Use venv if available
python3 -m hermes_cli.main gateway restart 2>&1 || \
venv/bin/python -m hermes_cli.main gateway restart 2>&1
```
Wait for restart to complete (up to 45s), then confirm:
```bash
grep "Gateway running" {{hermes_home}}/logs/gateway.log | tail -1
```
Expected: `Gateway running with N platform(s)` where N > 1 (includes zulip).
Quick smoke check — confirm zulip platform loaded:
```bash
grep -E "zulip.*loaded|zulip.*registered" {{hermes_home}}/logs/gateway.log | tail -3
```
If gateway fails to restart, check logs for the crash cause before proceeding.
### Step 6: Send Relay Success Signal
On the Abiba host (local), dispatch a relay message to the target agent: On the Abiba host (local), dispatch a relay message to the target agent:
@@ -164,7 +192,7 @@ ra-h-os-createRelayNode:
description: "hermes-zulip-plugin completed for {{target}} — plugin layer healthy" description: "hermes-zulip-plugin completed for {{target}} — plugin layer healthy"
``` ```
### Step 6: Report ### Step 7: Report
Compile results into a single status block: Compile results into a single status block:
@@ -175,6 +203,7 @@ Compile results into a single status block:
| Commit SHA | `{{INSTALLED_SHA}}` | | Commit SHA | `{{INSTALLED_SHA}}` |
| Files installed | `__init__.py`, `adapter.py`, `plugin.yaml` | | Files installed | `__init__.py`, `adapter.py`, `plugin.yaml` |
| `_strip_html` | `{{present|missing}}` | | `_strip_html` | `{{present|missing}}` |
| Gateway restarted | `{{yes|no}}` |
| Signal sent | `{{yes|no}}` | | Signal sent | `{{yes|no}}` |
## Known Failure Modes ## Known Failure Modes
@@ -192,7 +221,7 @@ Compile results into a single status block:
| Concern | hermes-zulip-restore | hermes-zulip-plugin | | Concern | hermes-zulip-restore | hermes-zulip-plugin |
|---------|---------------------|---------------------| |---------|---------------------|---------------------|
| Env credential check | ✅ Full ZULIP_* verification | ❌ Out of scope | | Env credential check | ✅ Full ZULIP_* verification | ❌ Out of scope |
| Gateway restart | ✅ Restarts the gateway process | ❌ Out of scope | | Gateway restart | ✅ Full restart + state validation | ✅ Targeted restart + smoke check |
| Live connection test | ✅ Validates `zulip.state = connected` | ❌ Out of scope | | Live connection test | ✅ Validates `zulip.state = connected` | ❌ Out of scope |
| Plugin deploy | ✅ Includes deploy as one step | ✅ Primary purpose | | Plugin deploy | ✅ Includes deploy as one step | ✅ Primary purpose |
| Version tracking | ❌ Implicit | ✅ Explicit SHA capture | | Version tracking | ❌ Implicit | ✅ Explicit SHA capture |
@@ -203,5 +232,6 @@ with `hermes-zulip-restore` (skip its Step 2 to avoid redundant deploy).
--- ---
**Last updated**: 2026-07-08 — Created to separate plugin lifecycle from **Last updated**: 2026-07-08 — Switched default branch to `master`; added
restore workflow. gateway restart step. If outstanding unmerged feature branches exist, address
them in a follow-up merge after this contract completes.