Skip to content

feat(notify): outbound webhook on done/failed/waiting (#167) - #658

Merged
currentbits merged 5 commits into
mainfrom
coder/fork-outbound-webhook-notifications-done-49e119
Aug 22, 2026
Merged

currentbits merged 5 commits into
mainfrom
coder/fork-outbound-webhook-notifications-done-49e119

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Closes #167.

One generic outbound webhook hung off the existing notify event points. No notifier plugin slot, no per-service adapters.

What changed

  • electron/notify.js — split shouldNotify into isNotifyTransition (focus-agnostic) plus the old focus-gated wrapper. The webhook uses the transition test directly, so it fires even while the window is focused. That is the point: it is the phone-push twin of the desktop notification. Mute and snooze still silence it.
  • One POST, shaped per host. ntfy hosts get a plain-text body with Title/Tags headers; everything else gets JSON carrying text (Slack), content (Discord) and message, so one payload covers all three plus any generic endpoint. Fire-and-forget, 5s AbortSignal.timeout, redirect: "error", never throws into the run path.
  • electron/main.js — dispatch hangs off the existing thread:updated handler, so --serve-web sessions get it too. Desktop notifications and the webhook are independent toggles.
  • electron/store.js — settings.webhook = { url, onDone, onFailed, onWaiting }. http(s)-only normalization so a corrupt store cannot POST somewhere unexpected; event toggles default true, so a pasted URL works immediately.
  • electron/secrets.js — the URL is sealed in the keychain like MCP tokens. A Slack or Discord incoming-webhook URL is a credential.
  • Settings UI — URL field (https://ntfy.sh/my-topic placeholder) plus three event checkboxes.

Verification

Run on the worker's worktree:

  • npx tsc --noEmit — clean
  • 77/77 electron tests across notify, webhook-settings, secrets, auto-settle-settings, budget-spend
  • 39/39 renderer settingsModal

Size

Over the 400-line PR cap at 1084 changed lines, opened deliberately: ~490 of those are new tests, and the store/secrets/notify/UI pieces do nothing useful split apart.

Known gap

No "Send test" button, so the only way to confirm a URL works is to finish a run. Worth a follow-up.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

All six conflicts were the same shape: #169 (Linear API key) added its
settings slice in exactly the spots the webhook slice lands. Kept both
sides everywhere — settings default object, normalizeSettings,
getSettings, setSettings, conceal/revealSettings, the AppSettings
interface, the Settings pane keywords and the effect dep array.

Verified on the merged tree: tsc --noEmit clean, test:electron
1911/1911, test:renderer 1490/1490, vite build ok.

Co-Authored-By: Claude Opus 5 <[email protected]>
@currentbits
currentbits merged commit 01582f2 into main Aug 22, 2026
5 of 6 checks passed
@currentbits
currentbits deleted the coder/fork-outbound-webhook-notifications-done-49e119 branch October 3, 2026 16:07
currentbits pushed a commit that referenced this pull request Oct 19, 2026
Local main and origin/main had diverged: worker branches were merged
into the local checkout while the same work squash-merged onto origin
through PRs. 61 files, +3499/-1449, and #167 (outbound webhooks) had
landed twice in two different revisions.

Resolutions, 31 hunks across 10 files:

- electron/notify.js — kept local's factored `postWebhook` + `testWebhook`
  ("Send test"). origin/main's squashed #658 inlined the same POST into
  dispatchWebhook and has no postWebhook anywhere, so it is the lesser
  revision. Behaviour is equivalent plus a result value the UI can show.
- electron/main.js — took origin's boot chain (#641 moved retention to the
  periodic sweeper) and re-chained scheduleImagePrune after the orphan
  sweep. origin/main never had the image prune; dropping it would have
  silently disabled userData image GC.
- electron/secrets.js, electron/store.js — took origin for linearApiKey
  (#169 ticket ingestion); local's webhook sealing auto-merged alongside.
  Both secrets now seal and open.
- src/shared/ipc.ts, src/components/SettingsModal.tsx — kept both sides:
  linearApiKey from origin, WebhookTestResult and the Send test button
  from local.
- The four settings tests — took origin's expected shape (adds
  linearApiKey: null) and kept local's added webhook cases.

Verified on the merge result: typecheck clean, `npx vite build` clean,
core 38, memory 204, electron 1928, renderer 1492 — 3662 tests, 0 fail.

Co-Authored-By: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Outbound webhook notifications (done/failed/waiting) for Slack, Discord, ntfy

1 participant