Skip to content

Report a briefless thread as absent and stop backfilling dormant ones - #2

Merged
trotterdylan merged 2 commits into
mainfrom
brief-absent-state
Sep 26, 2026
Merged

trotterdylan merged 2 commits into
mainfrom
brief-absent-state

Conversation

@trotterdylan

Copy link
Copy Markdown
Contributor

Follow-up to #1, answering "do we avoid generating briefs when a thread has been inactive?" — mostly yes, with one real gap.

Safe already: an inactive thread that has a brief is never re-summarized (no thread.idle fires, and the sweep's lastSummarizedAt < updatedAt is false), and an active thread mid-burst is held by the debounce.

The gap: a thread with no brief passed the sweep's gate unconditionally, so it was re-enqueued on every pass forever. That means an unbounded burst across every thread in the list the first time a key is configured, and an endless ten-minute retry for any thread whose summary keeps failing.

What changed

Bound the backfill. A briefless thread gets its first brief only if it was active inside a 24h window (BACKFILL_WINDOW_MS). Anything dormant longer stays briefless.

Make the UI honest about that. Briefs not being backfilled is the intended behaviour, so the UI has to handle it — previously getBrief returned summarizing for any briefless thread, meaning an old thread would show "Summarizing…" forever. Now:

  • summarizing only when work is genuinely debounced, queued, or in flight;
  • the new absent otherwise, rendered as "No brief for this thread yet" plus a Summarize now button;
  • a failed summary drops back to absent and announces, so the UI stops claiming a summary is coming.

Tests

65 passing (was 59). New cases: absent vs summarizing, no backfill past the window, backfill inside it, quiet-period threads left alone, and the popover offering to summarize instead of spinning.

One of them corrected a wrong assumption of mine — a fresh thread is not backfilled either, because the sweep's quiet-period gate skips it until it has been idle for quietSeconds. The backfill window and the quiet period are two separate bounds.

🤖 Generated with Claude Code

trotterdylan and others added 2 commits September 26, 2026 17:37
The sweep enqueued every briefless thread on every pass, with nothing to stop
it: the first time a key is configured that is an unbounded burst across every
thread in the list, and a thread whose summary keeps failing is retried every
ten minutes forever.

Bound it. A briefless thread is given its first brief only if it was active
inside a 24h window; anything dormant longer stays briefless. Briefs are not
backfilled, which is the intended behaviour, so the UI has to say so.

`getBrief` therefore distinguishes work that is genuinely pending — debounced,
queued, or in flight — from a thread that has no brief and is not getting one.
The first is `summarizing`, the second is the new `absent`, which the popover
renders as "No brief for this thread yet" plus a Summarize now button rather
than a spinner that would never resolve. A failed summary drops back to absent
and announces, so the UI stops claiming a summary is on its way.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The 24h backfill window was an arbitrary cutoff that still summarized every
briefless thread touched in the last day — a burst on first configure, just a
smaller one. The rule wanted is simpler: a thread earns its first brief through
activity.

So the sweep never creates a first brief for a thread whose last activity
predates this plugin load. Past that point its only job for a briefless thread
is activity whose `thread.idle` we should have seen and missed. A thread dormant
since before we started stays briefless at no cost, however old, and gets a
brief the moment it is worked on again.

Drops BACKFILL_WINDOW_MS; the cutoff is the load time we already know.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@trotterdylan
trotterdylan merged commit 92a0bbd into main Sep 26, 2026
4 of 6 checks passed
@trotterdylan
trotterdylan deleted the brief-absent-state branch September 26, 2026 18:16
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