Skip to content

Show a gap notice when a stalled connection drops watch notices - #1096

Merged
ualtinok merged 11 commits into
mainfrom
land/watch-gap-notice
Oct 29, 2026
Merged

ualtinok merged 11 commits into
mainfrom
land/watch-gap-notice

Conversation

@aft-alfonso

@aft-alfonso aft-alfonso Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Stacked on #1095 (needs its migrations 22-23; this adds migration 24). Retarget to main after #1095 merges.

When the 256-entry reliable-push retry buffer evicts a watch-match notice on a stalled connection, AFT records a durable gap. The next notice for that watch says, in the approved wording:

Some watch notices were lost: a stalled connection dropped 2 of them, and they cannot be recovered. At least 1 match is missing. Read the task output with bash_status({ task_id: "bash-gap", stderr_offset: 16 }).

("1 of them" for one notice; "Some matches may be missing." when matches can't be counted; OpenCode uses taskId/stderrOffset.) The gap is shown once, survives restart, follows the watch's exact-version acknowledgement, and never counts as a match for a one-shot watch. Health reports transport evictions separately from outstanding watch gaps and stays degraded until gaps are acknowledged. Recoverable snapshots and task completions are not counted as missing.


Summary by cubic

Shows a gap notice when a stalled connection drops watch-match notices, so the user learns that matches were lost and where to read the task output, and health stays degraded until the gap is acknowledged.

Migration

  • Adds schema migration 24 with bash_watch_delivery_acks and bash_watch_delivery_gaps tables.

Behavior

  • When the 256-entry reliable-push retry buffer evicts a watch-match notice, AFT records a durable gap; the next notice for that watch says how many notices and at least how many matches are missing, with a bash_status(...) pointer to the task output, or "Some matches may be missing" when matches cannot be counted.
  • The gap shows once, survives restart, follows the watch's exact-version acknowledgement, and never counts as a match for a one-shot watch.
  • Health reports transport evictions separately from outstanding watch gaps and stays degraded until gaps are acknowledged.
  • Recoverable snapshots and task completions are not counted as missing.

Written for commit b6d5393. Summary will update on new commits.

View guided diff Turn on auto-fix

ualtinok and others added 6 commits October 28, 2026 14:47
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Use the approved plain-language notice in Rust, OpenCode and Pi, including unknown counts and singular/plural missing-match sentences. Replace the prior wording goldens intentionally to pin that approved copy.

Keep speech-authority migrations 22 and 23 unchanged, place watch-gap tables and tombstones at migration 24, and test a populated schema-23 upgrade. Earlier migration tests still verify their speech data while advancing to the current schema.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Base automatically changed from land/bg-gh-authority to main October 28, 2026 19:28
ualtinok and others added 3 commits October 28, 2026 20:38
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
The gap census is keyed by SQLite's file name, which resolves symlinks.
On macOS the test's temp folder is /var/..., stored as /private/var/...,
so the helper found nothing. Canonicalize before the lookup.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
refused_shell_start_fails_fast_with_the_terminal_reason allowed 2 s for the
refusal; a loaded macOS runner took longer. 10 s still sits well inside the
15 s startup timeout, so the test still proves the refusal arrives as its
own terminal reply.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
@ualtinok
ualtinok force-pushed the land/watch-gap-notice branch from f09d77f to 86e83f9 Compare October 28, 2026 21:22
ualtinok and others added 2 commits October 28, 2026 22:50
The test spelled the database path itself and canonicalized it to match
SQLite's resolved name on macOS, but on Windows canonicalize adds the
\\?\ verbatim prefix SQLite never reports, so the lookup missed and the
test read an empty census. Share the production key function instead.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
@ualtinok
ualtinok added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit cde3849 Oct 29, 2026
93 checks passed
@ualtinok
ualtinok deleted the land/watch-gap-notice branch October 29, 2026 03:46
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.

1 participant