8000 feat(notifications): tell targets when a routine's run fails or leaves graph changes to review by adeelahmad · Pull Request #560 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content 8000

feat(notifications): tell targets when a routine's run fails or leaves graph changes to review - #560

Merged
adeelahmad merged 8 commits into
mainfrom
claude/project-thread-yy6rqb
Oct 18, 2026
Merged

adeelahmad merged 8 commits into
mainfrom
claude/project-thread-yy6rqb

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: a routine's run that failed (say the nightly graph-organising run, when the model server was down) or that proposed merges for review stayed silent until someone opened the Routines page.

After: a namespace's notification target can pick two new events, routine.failed and routine.proposed, and gets a message through Matterbridge, a signed webhook, Slack or Discord:

  • "1 of 2 actions of routine “Nightly” failed in pods: workflow: LLMError: 500 …" (also when all fail, or a run stopped without finishing), linking the routine;
  • "Routine “Nightly” left 3 graph changes to review in pods.", linking /routines/changes?run=N.

Each namespace the routine runs over (every one, for a routine over all) gets its own message; proposed changes are counted in the namespaces they touch, as they stand when the notifier looks, so a run whose proposals were all decided already isn't sent. Errors can carry outside text, so links in the chat text are defanged like approvals'.

How: a fourth source in the notifier's scan (routine_run by finished_at, only runs that are error/partly or have proposed changes), with the same claim-once, paging and retry machinery as runs, additions and approvals. A new source starts from now, so existing installs don't replay old runs. Default events for new targets are unchanged.

Motivation and Context

Parked backlog item "Routine run alerts", started by Adeel's "Start all" on 2026-10-18.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests. (test_routine_runs_that_fail_or_leave_changes_to_review_are_told)
  • My change requires documentation updates, and I have updated docs/ accordingly. (notifications.md events table, processing.md Routines)
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md.

Done questions (AGENTS.md)

  • Goal: routine failures and proposals reach Matterbridge and webhooks; merged on green CI.
  • Agents: the events are in the notifications API (events on targets), and webhooks deliver them to agents as signed JSON.
  • Zero setup: no new prerequisite; tick the events on an existing target.
  • Fewest clicks: two checkboxes in the existing target dialog.
  • Configurable: per target in the web app; no new setting.
  • Light: one extra indexed-time query per notifier round.
  • Private and secure: same targets, network guard and sealing; routine errors reach a namespace's owners' targets the way job errors already do, links defanged. No new surface for the threat model.
  • Cost: no model calls.
  • User decides: off until a target picks the events; default events unchanged.
  • Upgrades: no stored-data change; the new source starts from now, nothing replayed.
  • Honest: README built list and docs/requirements.md row added, backed by the test.
  • Tests, docs and generated files updated (make openapi).
  • Open standards: Standard Webhooks signing; no new dependencies.
  • Result reported with evidence. Refine later: an event for runs held over budget, and one message per gateway when the same gateway is a target in several namespaces.
  • Reuse: built on notify.py's sources, claims and deliveries.

Local checks: full backend suite 1674 passed (in-memory SurrealDB); ci/local-ci.sh Next.js, pre-commit and PR title jobs pass (server and upgrade jobs need Docker, not available in this container).


Generated by Claude Code

…s graph changes to review

Two new events, routine.failed and routine.proposed, sent through
Matterbridge, signed webhooks, Slack and Discord to each namespace a
routine runs over. Default events for new targets stay as they were.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AnPBc76gCvHKeWvSLd1L7h
@adeelahmad
adeelahmad merged commit 90b149f into main Oct 18, 2026
11 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-yy6rqb branch October 18, 2026 11:56
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.

2 participants

0