Repository navigation
Conversation
…酱, Feishu, DingTalk, WeCom, Telegram, webhook)
Contributor
|
Thanks. This is in scope: a notifications hooks package, not a relay. The channel code is clean, and the turn detection holds on every wire shape. A few things need fixing before it can merge. What was run, at 3182649
Blockers
Should fix
Nits
|
…eld failure push - A conversation is the session plus a hash of its first user message's text. One that first shows up while another conversation in the same session is waiting on a tool is nested (a Claude Code subagent): it never pushes and never resets the main turn. Requests with no user message (Responses continuing by previous_response_id) stay in the newest top-level one. - package.json options ship with an empty ntfy topic, so nothing is sent until the user fills one in; README generates a random topic. - Only origin "local" counts by default; drop "magpie-key". README says what gateway-key and remote mean; tests use the real values. - A failure push waits failureHoldSeconds (60) and is dropped when the conversation goes on (agent retry of 429/5xx, Esc then a new message). - Drop ctx.report from onResponse (it has no effect there). - Nits: capitalise unknown agent ids, remove unused words, 2 h 5 min.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A new gateway hooks package,
@magpie-community/gateway-notify: a push to your phone or team chat when an agent's turn is over — so a long Claude Code / Codex task can run while you're away from the screen.When it sends
onRequest), and closes when the reply asks for no more tools (onResponse), read in each API's shape: Anthropic Messages, Responses, Chat completions, Gemini.minMinutes(default 3); a failed request (ctx.success === false) closes the turn with a ❌ push (errors, on by default).cooldownSeconds.local,magpie-key) unlessallOrigins; optionalagentsallow-list.Channels: ntfy, Bark, Server酱 (SCT and sctp keys), Feishu and DingTalk robots (with signing secrets), WeCom robot, Telegram bot, generic webhook. One HTTPS POST each, 10 s limit, sent in the background; nothing is awaited on the request's path and nothing throws.
Privacy: by default the push carries agent, project folder name, model and duration only; the reply's text is opt-in (
includeText, capped bymaxTextLength).Tests:
bun test packages/notify— 19 tests, every channel faked withfetch(no network, no account).bun scripts/check.mjspasses (it skips hooks packages). Also checked a live publish to ntfy.sh.Also adds the registry entry (en/zh summary) and a row in the README's gateway hooks table.
Not yet run inside a live magpie install — feedback on the turn detection against real agent traffic is very welcome.