Repository navigation
fix: alert on every failure streak of a watch, not just the first - #60
Merged
davidmckayv merged 1 commit intoSep 26, 2026
Merged
Conversation
Contributor
|
Approved to merge, but it now conflicts with main in |
A failing watch notifies once when a check fails and once when it pauses after five failures. The notification ID is derived from watch-error:<task>:<retry|paused>, and notifications are only marked read, never deleted. So after the watch is resumed (or recovers) and starts failing again, both alerts dedupe against the old ones and the owner is never told the watch paused again. Track a failureStreak counter in the task state that increases when failures goes from 0 to 1, and include it in the alert key. Each streak alerts once for the retry and once for the pause, and replaying the same outcome still dedupes.
asasemahmed
force-pushed
the
fix/watch-alert-episodes
branch
from
September 25, 2026 20:03
bc92bb9 to
f93884b
Compare
davidmckayv
approved these changes
Sep 26, 2026
davidmckayv
left a comment
Contributor
There was a problem hiding this comment.
The rebase preserves the accepted failure-streak fix and its recovery regressions. All seven CI checks pass on the reviewed head.
markhiltonapps
pushed a commit
to markhiltonapps/openmuse
that referenced
this pull request
Sep 27, 2026
Brings in five fixes from CopilotKit/OpenMuse main: - keep browser evidence identity separate from session identity (CopilotKit#29) - suggest the openai/ prefix for gateway model IDs (CopilotKit#55) - alert on every failure streak of a watch, not just the first (CopilotKit#60) - show the browser as offline when its worker is unreachable (CopilotKit#64) - keep completed reviewed actions terminal on replay (CopilotKit#37) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MfTjvNDS5CdhPPisYxjwAv
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.
What changed
A failing watch sends two alerts: "retry scheduled" on the first failure, and "paused" after five failures. The notification ID is
hash("watch-error:<task>:<retry|paused>"), stored withinsertIfAbsent, and notifications are only marked read, never deleted.That key never changes for the life of the watch. So after the watch is resumed, or recovers, and later fails again, both alerts dedupe against the first streak's. The owner is never told that the watch paused a second time.
Now the task state keeps a
failureStreakcounter. It increases whenfailuresgoes from 0 to 1 (after a success or a resume, both of which already resetfailures), and it is part of the alert key:watch-error:<task>:<streak>:<retry|paused>. Each failure streak alerts once for the retry and once for the pause. Replaying the same outcome still dedupes, because the key comes from the saved state.Verification
tests/workflows.test.tsfails a watch until it pauses, resumes it withcontrolMonitor(resume), and fails it until it pauses again. It expects 4 distinct alerts, and 4 after one more replayed tick.main: 2 alerts.pnpm typecheckandpnpm build:serverpass. Biome reports no issues for the changed files.pnpm test: 171 passed, 1 failed. The failure isDocker subprocess uses literal argv…, which fails on Windows with or without this change.Integration limits
Tasks saved before this change have no
failureStreak, so their next failure alert uses the new key format and may notify once more than before.