hermes: match --events issue_comment, not pull_request_comment
A timeline comment on a PR never reached the route. Gitea reuses the same strings in two namespaces and they collide: subscription name wire name (X-GitHub-Event) what it is pull_request_comment issue_comment comment on a PR issue_comment issue_comment comment on an issue pull_request_review_comment pull_request_comment review on a PR The hook's `events` array takes the subscription name; Hermes matches --events against X-GitHub-Event, the wire name, produced by HookEventType.Event() in modules/webhook/type.go. So --events pull_request_comment was selecting review submissions and could never match a comment -- the exact inversion of what it reads like. That also explains both observed failures. The review submission matched (wire name pull_request_comment) and reached the filter, which correctly dropped it on action=reviewed since a PullRequestPayload carries no comment object. The timeline comment arrived as issue_comment, matched nothing, and was dropped by the events filter before the script ever ran. gitea.nix and hermes-agent.nix now deliberately name the same event differently, so both carry the table and say the other is not a typo. issue_comment on the wire also covers comments on plain issues. The hook does not subscribe those, and the filter's is_pull check drops them regardless, so widening the hook later cannot leak issue comments into the agent. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S94o42aQ8VkBmEWvDem5xa
This commit is contained in:
+11
-3
@@ -21,9 +21,17 @@ let
|
||||
# nothing she does lands without darman clicking merge.
|
||||
lunaRepos = [ "darman/homelab" ];
|
||||
|
||||
# Only the event Hermes's gitea-pr-comments route actually handles. Gitea
|
||||
# sends pull_request_comment distinctly from issue_comment, so this covers
|
||||
# comments on PRs and nothing else — no issue comments, no pushes.
|
||||
# Only the event Hermes's gitea-pr-comments route actually handles.
|
||||
#
|
||||
# This is a SUBSCRIPTION name, and gitea reuses these strings in a second,
|
||||
# colliding namespace on the wire — see the long comment on --events in
|
||||
# hosts/mars/hermes-agent.nix. "pull_request_comment" HERE means a timeline
|
||||
# comment on a pull request; the same string in X-GitHub-Event means a
|
||||
# review submission. The two files therefore name the same event
|
||||
# differently on purpose, and neither is a typo:
|
||||
#
|
||||
# here (subscription): pull_request_comment
|
||||
# there (--events): issue_comment
|
||||
#
|
||||
# Hermes would drop the rest anyway (its route filters on X-GitHub-Event
|
||||
# before any LLM call), so this is defence in depth rather than the only
|
||||
|
||||
Reference in New Issue
Block a user