Skip to content

ui-server: an unacknowledged failure notification mutes every later failure of the same cron job #3354

Closed

Description

@schlessera

Context

On a hosted install, the nightly sync cron job failed every night from 2026-10-08 to 2026-11-01 (remote: Invalid username or token), and maintain failed every day from 2026-10-21 onward. Both runs are recorded as error spans in Activity. Neither produced a single push notification after its first failure, so the brain silently stopped syncing for over three weeks; the user only noticed because data seemed to be missing.

The cause is the tag dedupe in createIntent (packages/ui-server/src/activity/notify.ts:107-113): a new intent is dropped whenever any unacknowledged intent with the same tag exists. The tag for a cron failure is failure:<jobName>. The first failure:sync intent (2026-10-08) was sent but never acknowledged, so every later sync failure was dropped at that check. The same happened to failure:maintain (first intent 2026-10-21, never acknowledged). Session failures use a per-session tag, so they keep notifying, which hides the problem.

Acknowledgement only happens through the Activity routes (packages/ui-server/src/routes/activity.ts:123 and :136). A push notification that was delivered and tapped, or delivered and ignored, leaves the intent unacknowledged.

The header comment (notify.ts:13-20) promises "per-job debounce collapses repeats". In practice it is a permanent mute until the user explicitly acknowledges in Activity.

Scope

  • Make a recurring job's failure notify again after a bounded quiet period, even when the previous intent was never acknowledged. For example, debounce per tag by time (a new intent when the last one for the tag is older than N hours), or by run count, keeping the hourly global cap.
  • Decide whether a delivered and opened notification counts as acknowledgement.
  • Make the repeat say how long it has been failing (for example "sync has failed 7 times since 8 Oct").

Out of scope

  • The causes of the sync and maintain failures themselves.
  • Completion notifications and their opt-in.
  • The global per-hour creation cap.

Acceptance criteria

  • A cron job that fails on day 1 and again on day 2, with the day-1 intent never acknowledged, creates a new deliverable intent on day 2. The test fails on current main.
  • Repeats inside the debounce window still coalesce into one intent.
  • A watched failure is still created suppressed, as today.
  • The repeat's body or title carries the failure count or the first-failure date, with no job output, error text or secrets (payloads stay minimal for lock screens).

Verification

bun run test packages/ui-server/tests for the notify suite, with a mutation receipt: restore the unconditional tag dedupe and watch the day-2 case fail.

Contract impact

None expected; the notification_intents shape is unchanged. If the body text gains a count, that is display text only.

Activity

  1. added
    type: fix
    area: ui-server
    priority: p1
    agent-ready
    on Nov 2, 2026
  2. added this to the 0.45.0 milestone on Nov 2, 2026
  3. self-assigned this
    on Nov 2, 2026
  4. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Claiming this (claim token wi-3354-7e60). Branch: fix/3354-unacked-failure-mutes-cron from origin/main at 3984040. Collision check: a path report on packages/ui-server/src/routes/activity.ts with #3343; this fix is expected to stay in activity/notify.ts and its tests.

  5. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Implementation is in #3365 (draft, head 5233905). It has failing-first and mutation receipts, and local preflight passes. Decision: opening a delivered push does not count as acknowledgement. The 12-hour quiet window removes the permanent mute without it. Confirmation is held because main is red (#3361). The next step is bun scripts/integrate.ts confirm 3365 --issues schlessera/brain-kit#3354 once main is green. The claim (wi-3354-7e60) stays with this worker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-readyarea: ui-serverpriority: p1type: fix

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions