GeezerVison is showing github.com — Backstop reminders: skip only an unreadable old message, guard the over-ten split, warn once per refused batch by scuttletoby · Pull Request #745 · scuttletoby/t3code
Conversation
What and why
The four minor points from the #733 review (#733 (comment)), each fixed at the root.
- An old reminder that cannot be decoded is skipped on its own.
- Before: the reminder read the first-format messages through upstream's
getMessagesById, which decodes all requested rows together. One bad payload failed the whole read, so the parent got no reminders on any try.
- Now:
DelegatedResultsStore.messageTexts reads only $.text of each requested row (json_extract, per row). A row with no text string is left out. Its tasks fall back to the receipt rule (the exact owed set, or one task), so they may be reminded once more, as main would. The parent's other reminders still go.
- Only a failed read of the table returns
unreadable, and that is retried as before.
- A payload that is not JSON cannot be stored: the message table's search triggers refuse it (the test found this).
- Over ten tasks.
- The full digest cannot be checked there. It covers every task of the old set, and the text names only ten. Checking it would mean searching subsets of the parent's tasks, read ones included.
- What I added:
legacyReminderKeys now accepts only this parent's own first-format id (prefix plus 16 hex digits), for both cases. Before, the over-ten case ignored the message id.
- A code comment explains why trusting the ten adds no risk: a writer of this parent's reminder ids can already mark any task told with its one-task id.
- The text split is tested on the real message table. Upstream's
ProjectionStore.apply(message.updated) writes the old-format message with upstream's own encoding. The fork's store reads it back exactly, and it splits into its tasks.
- A refused batch warns once.
WaitDelivery now sets earlier: true on a rejected it answered from an existing refused receipt (nothing was sent this time).
- A refusal from the send itself (
settle) stays unmarked.
- The reminder and the orphan scan warn only on an unmarked refusal. The orphan scan had the same repeat on each pass, and it uses the same flag.
- This needs no stored state, so a restart does not warn again either. A new batch has new ids and warns again.
Tests
- On the old code (origin/main's
delegatedResults.ts, DelegatedResultReminder.ts, DelegatedResultsStore.ts, DelegatedOrphanScan.ts and WaitDelivery.ts, run with the new tests): all 5 new tests fail.
DelegatedResultReminder.test.ts: "a first-format reminder that cannot be decoded is left out alone (real message table)". On main this returns unreadable, because upstream's decode fails on the bad row.
DelegatedResultReminder.test.ts: "warns of a refused batch once…".
DelegatedOrphanScan.test.ts: "warns of a refused message once…".
DelegatedResultsStore.test.ts: "reads a first-format reminder's text back from the real message table".
delegatedResults.test.ts: the over-ten test (another parent's id, and a per-task id).
- Remove-one-line checks (each line removed alone, tests run, line restored): all 6 went red.
- the text-string filter in
messageTexts;
- the own-first-format-id check in
legacyReminderKeys;
- the warn guard in the reminder;
- the warn guard in the orphan scan;
earlier: true on a refused receipt (2 tests);
- removing
earlier in settle (2 tests, because a new refusal is then never logged).
- The state question:
- Runs again: a refused batch checked twice gives one warning. Once the sent reminder is in the real table, a second check sends nothing.
- After a restart: a fresh service also gives no new warning.
- Stopped half-way: nothing new is stored. The refusal is read from its receipt, so there is nothing half-written.
- Old state: an old-format message written by upstream's projection, and an old payload upstream can no longer decode (
{"obsolete":"transcript"}).
- Empty or missing state: no ids gives an empty map; a missing id, another thread's message, or a text that is not a string is left out. A failed table read is still
unreadable and is retried (existing test).
- New batch: a task that sorts first ends, so the refused tasks go in a batch with new ids, refused too. That warns once more, and not again on the next check.
pnpm --filter ./apps/server exec vp test run src/fork/delegatedResults src/waits src/mcp/toolkits/waits src/fork/remoteCompletionDelivery.test.ts: 311 pass, 2 skipped, 3 fail. The 3 are systemd unit-wait tests (WaitJudges.test.ts ×2, WaitService.checks.test.ts ×1). They fail the same way on origin/main on this macOS machine, which has no systemd, so they are not from this change.
vp run check:changed: format, lint, knip, graphql, typecheck and tests pass.
node .github/scripts/fork-seam-check.cjs --config-ref origin/main origin/main HEAD: passes. All changed files are fork-owned (apps/server/src/fork/, apps/server/src/waits/, docs/fork/), so no seam PR is needed.
Left as is
- Over ten tasks, the listed ids still have no digest check, for the reason in point 2. The new id check limits them to this parent's own first-format message.
General vs project
All general: delivery and logging rules for any T3 user with server.waitFor on. No project facts or settings were added. docs/fork/README.md now says that a refusal is logged once, and that an old message whose text cannot be read is skipped on its own.
Closes #741
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…er-ten split, warn once per refused batch
- An old reminder's text is read per row from the message table, so one
payload that cannot be decoded is left out alone (its tasks fall back to
the receipt rule) instead of holding every reminder of the parent.
- Over ten tasks, the split only reads this parent's own first-format id;
why the digest cannot be checked there is said in the code.
- A refusal answered from its existing receipt is marked `earlier`, so the
reminder and the orphan scan warn when a batch is refused, not on every
later check.
- Tests on the real message table for the text split and the bad row.
Closes #741
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review of #745 (head 8f1e2b5): SAFE
Verdict: SAFE to merge. No blocking or major findings. All four #741 points are fixed at the root, and I found no path that drops a reminder main would send or sends one more than once beyond the documented "once more" fallback.
What I checked
- Read Backstop reminders: minors from the #733 review #741, the Backstop reminders: split old ids per task, refused batch skips nothing, one check at a time #733 review it links, Backstop reminders: split old ids per task, refused batch skips nothing, one check at a time #733, and the whole diff of Backstop reminders: skip only an unreadable old message, guard the over-ten split, warn once per refused batch #745.
- Tests on the head:
src/fork/delegatedResults + src/waits/WaitDelivery: 108/108 pass.
- Remove-one-line checks (each alone, then restored): all 6 went red.
- text-string filter in
messageTexts (DelegatedResultsStore.ts:138): 2 fail.
- own-first-format-id check (
delegatedResults.ts:218): 1 fails.
- warn guard in the reminder (
DelegatedResultReminder.ts:166): 1 fails.
- warn guard in the orphan scan (
DelegatedOrphanScan.ts:182): 1 fails.
earlier: true on a refused receipt (WaitDelivery.ts:137): 2 fail.
- the strip of
earlier in settle (WaitDelivery.ts:157): 2 fail.
- Upstream lines: none.
fork-seam-check.cjs --config-ref origin/main origin/main HEAD passes; all changed files are under apps/server/src/fork/, apps/server/src/waits/ (a fork-owned folder in forkFiles) and docs/fork/.
- CI on 8f1e2b5: all required jobs green,
fork-ci-result passes.
The state question
- Unreadable old message:
messageTexts reads the same table and rows as upstream's getMessagesById (same thread_id filter, no deleted filter in either), but reads only $.text per row. A row without a text string is left out, and its tasks fall back to the receipt rule. So they are reminded at most once more, under new per-task ids, and then never again. No reminder is dropped.
- A payload that is not JSON (which would make
json_extract fail the whole read) cannot exist: upstream's search triggers run json_extract on every insert and update, and migration 069's backfill ran it over every existing row.
- A failed table read still gives
unreadable and is retried, as before.
- Over ten / id check: the new check at
delegatedResults.ts:218 accepts only delegated-reminder:<this parent>:<16 hex>. In production, legacyTexts already holds only those ids (from legacyReminderMessageIds, read for this thread only), so this guards direct callers. The comment's claim is true: toldReminderKeys accepts any id under this parent's prefix, so anyone who can write such an id can already mark a task as told.
- "Warned" mark across a restart: nothing is stored.
earlier comes from whether the refused receipt existed before this try, so a restart and an old DB (refused receipts from before this PR) both stay quiet.
- A new batch has new ids, so its refusal comes from the send (
settle), is unmarked, and warns. The test covers this.
- The same ids refused again after a change: that sends nothing (the receipt answers), so there is no new refusal to hide.
WaitService ignores the new optional field, so wait deliveries are unchanged.
- No old reminders / empty state: no ids gives an empty map without a query.
Blocking
None.
Major
None.
Minor (not blocking)
delegatedResults.ts:239-240: the comment is in the wrong branch. "Over ten, no digest check…" sits in the count <= MAX_LISTED branch, after its digest return. Move it into the else if (over-ten) branch it describes.
WaitDelivery.ts:138-142: a receipt held by another thread is still unmarked. It is also answered from an existing receipt, so by this PR's rule it would warn on every check. Reminder ids carry the parent's thread id, so this cannot happen for them. Noted only.
- Logged only once: if the server stops between the refusal and its log line, that refusal is never logged, because every later check reads it as
earlier. Only the log is affected, not delivery. Noted only.
🤖 Generated with Claude Code
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 21, 2026
scuttletoby
added a commit
that referenced
this pull request
Nov 21, 2026
…er-ten split, warn once per refused batch (#745)
- An old reminder's text is read per row from the message table, so one
payload that cannot be decoded is left out alone (its tasks fall back to
the receipt rule) instead of holding every reminder of the parent.
- Over ten tasks, the split only reads this parent's own first-format id;
why the digest cannot be checked there is said in the code.
- A refusal answered from its existing receipt is marked `earlier`, so the
reminder and the orphan scan warn when a batch is refused, not on every
later check.
- Tests on the real message table for the text split and the bad row.
Closes #741
Co-authored-by: Claude Opus 5.5 <[email protected]>
scuttletoby
added a commit
that referenced
this pull request
Nov 21, 2026
…er-ten split, warn once per refused batch (#745)
- An old reminder's text is read per row from the message table, so one
payload that cannot be decoded is left out alone (its tasks fall back to
the receipt rule) instead of holding every reminder of the parent.
- Over ten tasks, the split only reads this parent's own first-format id;
why the digest cannot be checked there is said in the code.
- A refusal answered from its existing receipt is marked `earlier`, so the
reminder and the orphan scan warn when a batch is refused, not on every
later check.
- Tests on the real message table for the text split and the bad row.
Closes #741
Co-authored-by: Claude Opus 5.5 <[email protected]>
scuttletoby
added a commit
that referenced
this pull request
Nov 21, 2026
…er-ten split, warn once per refused batch (#745)
- An old reminder's text is read per row from the message table, so one
payload that cannot be decoded is left out alone (its tasks fall back to
the receipt rule) instead of holding every reminder of the parent.
- Over ten tasks, the split only reads this parent's own first-format id;
why the digest cannot be checked there is said in the code.
- A refusal answered from its existing receipt is marked `earlier`, so the
reminder and the orphan scan warn when a batch is refused, not on every
later check.
- Tests on the real message table for the text split and the bad row.
Closes #741
Co-authored-by: Claude Opus 5.5 <[email protected]>
scuttletoby
added a commit
that referenced
this pull request
Nov 28, 2026
…er-ten split, warn once per refused batch (#745)
- An old reminder's text is read per row from the message table, so one
payload that cannot be decoded is left out alone (its tasks fall back to
the receipt rule) instead of holding every reminder of the parent.
- Over ten tasks, the split only reads this parent's own first-format id;
why the digest cannot be checked there is said in the code.
- A refusal answered from its existing receipt is marked `earlier`, so the
reminder and the orphan scan warn when a batch is refused, not on every
later check.
- Tests on the real message table for the text split and the bad row.
Closes #741
Co-authored-by: Claude Opus 5.5 <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|