diff --git a/AGENTS.md b/AGENTS.md index 176cd4e..debf0d4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -162,3 +162,20 @@ Registration tests reject direct lifecycle wiring and assert the exact kit summary. Keep that coverage in place for registration changes. Dev tooling is uv-native; dependencies live in `pyproject.toml`. + +## hermes-plugin-kit version + +Hermes doesn't install this plugin's dependencies. The runtime image bakes one `hermes-plugin-kit` for every plugin, at the rev in offendingcommit/infra `clusters/minilab/hermes-agent/files/plugin-dependency-policy.json` (`shared_dependencies.hermes-plugin-kit.install_requirement`). Live plugin updates ship this repo's code onto that kit and never install the rev in `pyproject.toml`. So a pin ahead of the fleet's kit passes every local test and breaks in production. + +On 2026-11-20, persona-voice and sirens pinned a kit that added `MediaDeliveryResult.deferred` while the fleet still baked an older kit. Every voice memo and image send crashed after delivering, and the model retried, so each one arrived twice. + +- **Declare a range, pin the fleet rev.** `dependencies` lists `"hermes-plugin-kit>=0.9.0,<1"` (the policy's `same-major` rule). `[tool.uv.sources]` pins the git `rev` to the fleet policy's rev exactly. Never use a PEP 508 direct reference (`@ git+…`); it can't carry a range. +- **Check before touching the pin or using a kit API.** Read the fleet rev from the policy file on infra's `main`: + + ```bash + gh api repos/offendingcommit/infra/contents/clusters/minilab/hermes-agent/files/plugin-dependency-policy.json --jq .content | base64 -d | jq -r '.shared_dependencies["hermes-plugin-kit"].install_requirement' + ``` + + This repo's rev must equal that rev or be an ancestor of it: `git -C merge-base --is-ancestor `. +- **New kit API ships fleet first.** Merge the kit change, then move the fleet with infra's `hermes-plugin-snapshot-promotion.yml` (`shared_dependency=hermes-plugin-kit=<40-char sha>`). Bump this repo's `rev` only after that promotion merges, then run `uv lock` and the tests. +- **Read new kit fields defensively** when they could meet an older kit (`getattr(result, "field", default)`). A crash after a side effect makes the model repeat the side effect. diff --git a/pyproject.toml b/pyproject.toml index 7980888..3ae3404 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ description = "Discord reading tools plus channel-scoped react, server emoji, an requires-python = ">=3.13" dependencies = [ "discord.py>=2.4", # DiscordLiveFetcher / DiscordLiveActions — live I/O - "hermes-plugin-kit", # Decorated tools/hooks + lifecycle registration + "hermes-plugin-kit>=0.9.0,<1", # Decorated tools/hooks + lifecycle registration ] [dependency-groups] @@ -21,4 +21,4 @@ dev = [ package = false [tool.uv.sources] -hermes-plugin-kit = { git = "https://github.com/offendingcommit/hermes-plugin-kit.git", rev = "ca9e1c9ad95c6414bd26c7579ca22e25b40ec9d1" } +hermes-plugin-kit = { git = "https://github.com/offendingcommit/hermes-plugin-kit.git", rev = "23ac709ee4c4886cb738efb0b25c7163180d2b24" } diff --git a/uv.lock b/uv.lock index 869a0a8..8593b12 100644 --- a/uv.lock +++ b/uv.lock @@ -1,5 +1,5 @@ version = 1 -revision = 3 +revision = 5 requires-python = ">=3.13" [[package]] @@ -199,7 +199,7 @@ dev = [ [package.metadata] requires-dist = [ { name = "discord-py", specifier = ">=2.4" }, - { name = "hermes-plugin-kit", git = "https://github.com/offendingcommit/hermes-plugin-kit.git?rev=ca9e1c9ad95c6414bd26c7579ca22e25b40ec9d1" }, + { name = "hermes-plugin-kit", git = "https://github.com/offendingcommit/hermes-plugin-kit.git?rev=23ac709ee4c4886cb738efb0b25c7163180d2b24" }, ] [package.metadata.requires-dev] @@ -281,7 +281,7 @@ wheels = [ [[package]] name = "hermes-plugin-kit" version = "0.9.0" -source = { git = "https://github.com/offendingcommit/hermes-plugin-kit.git?rev=ca9e1c9ad95c6414bd26c7579ca22e25b40ec9d1#ca9e1c9ad95c6414bd26c7579ca22e25b40ec9d1" } +source = { git = "https://github.com/offendingcommit/hermes-plugin-kit.git?rev=23ac709ee4c4886cb738efb0b25c7163180d2b24#23ac709ee4c4886cb738efb0b25c7163180d2b24" } dependencies = [ { name = "pyyaml" }, ]