Skip to content

feat(web): fold blocked lens into combined session list filters - #2530

Open
heavygee wants to merge 123 commits into
tiann:mainfrom
heavygee:1996-fold-blocked-filter
Open

heavygee wants to merge 123 commits into
tiann:mainfrom
heavygee:1996-fold-blocked-filter

Conversation

@heavygee

Copy link
Copy Markdown
Collaborator

Summary

Fold the blocked-only lens into the combined Sort-and-filter menu (#1772 / #2376's SessionListViewMenu): showBlockedOnly becomes a MenuRow checkbox alongside unread/active/working/scratchlist, AND-composed with the rest. Drops the standalone BlockedLensToggle header button that duplicated it. BlockedJumpPill (travel-to-next-blocked) is unchanged — it's not a filter.

Also folds showBlockedOnly into isFiltering, matching its new siblings — otherwise a previously-collapsed Blocked (or Pinned) section stayed collapsed after turning the filter on from the menu.

No new blocked-detection logic: sessionIsBlocked / BlockedJumpPill / blockedCount / showBlockedOnly all come from #2520 as-is.

Depends on

Stacked on #2520 (flagship blocked session-list chrome — introduces the blocked concept this PR folds into the filter menu). Branch is based on that PR's tip so CI exercises the real APIs; this diff is 7 files / ~20 net lines on top of it.

Fixes #1996. Umbrella #2356. Discussion #2355. Related #2520, #1772, #2376.

Test plan

heavygee and others added 15 commits November 19, 2026 13:13
…iann#1717)

Operators running hundreds of sessions cannot spot agents that finished
blocked by scanning the list. Today a blocked-but-still-connected agent
lands silently in the quiet grey "Active" bucket among dozens of peers.

Source of truth: the hub already parses AGENT_NOTIFY_SUMMARY footers for
the work-graph ledger, so stamp the same parse onto the session row
(schema v26, `last_notify_*`) and surface it on SessionSummary. O(1) to
read; no client-side message parsing at fleet scale. Lights up on
`blocked` + `stalled`, reusing the hub's existing stalled->blocked fold.

Three surfaces, each doing something the others cannot:

- In-row: amber left rail + "Blocked" text chip. Not a sixth dot — five
  dot colours already compete, and a different visual channel lets a row
  be blocked *and* awaiting a permission with no precedence rule. No
  animation: motion is the list's grammar for live state, and blocked is
  terminal. Demotes to muted past 24h so abandoned rows stop alarming.
- A pinned "Blocked" section above Running/Active, so the default state
  is already in view.
- An always-visible header counter with jump-to-next. Edge chevrons
  cannot do this job: the list collapses directory groups and caps each
  group's preview, so a blocked row is often absent from the DOM, not
  merely scrolled past. The jump clears filters and expands the section
  before travelling. A sibling toggle provides a blocked-only lens.

Clearing is self-maintaining, no ack UI: opening a session does *not*
clear (at 600 sessions you open things to triage), but sending a message
or the agent's next turn does. Covers all three turn-start paths —
markMessageQueued sets thinking before any CLI keep-alive, so a rising
edge in handleSessionAlive alone would never fire for the reply path.

Bounded startup backfill (24h window, deferred off the startup path) so
an upgraded hub shows blocked work immediately rather than after every
agent next speaks.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
The zero-blocked branch set a fresh `{above:0,below:0}` on every effect
run, and the effect's deps churn each render (the `machineLabelsById={}`
prop default cascades through the filter memos), so the list re-rendered
forever. Surfaced as a hang in the soup web suite.

Also corrects the blocked-lens copy: the lens is a real toggle button
now, not a long-press gesture, so "Hold to show blocked only" was
describing an interaction that no longer exists.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Operator's rule: a session sitting on a pending permission or input
request cannot proceed without them, which is the same problem as an
agent that self-reported `blocked`. It gets the same count, the same
section and the same row rail — only the chip's reason label differs
(Blocked / Stalled / Permission / Input).

This revises the first cut, which treated permission as an orthogonal
axis and left those rows in the quiet pending bucket. The dot language
is unchanged, so a row still shows its live permission pulse; blocked
chrome rides the separate rail/chip channel as before.

A live prompt outranks a stored footer when both are present — it is the
one a single click clears. Pending needs no hub persistence or clearing
logic: it is live state, so answering the prompt drops the chrome on the
next render. Staleness still applies, measured from the oldest pending
request, so a prompt ignored for a day demotes like a stale footer.

Also drops the duplicated "pending N" text on blocked rows — the chip
already names the reason, and repeating it truncated the session title.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
…selves (tiann#1717)

Operator asks 2 and 3: flag ALL kinds of blocker, and make them
unmissable.

Coverage, driven by what the fleet actually emits rather than the
documented contract:

- `CursorCreatePlan` was unclassified. It is Cursor's plan-approval
  prompt — the direct analogue of Claude's ExitPlanMode and the second
  most common request tool in the wild (16 uses on a 683-session fleet)
  — so every Cursor plan review read as "approve a tool" rather than
  "answer me". Now an input request, and input outranks permission.
- Notify status `pending` occurs 92 times and `completed` twice, neither
  in the contract vocabulary. `pending` now blocks; `completed` clears.
- Added needs_decision / needs_review / failed / error / waiting, so
  "blocked by a question" and "blocked by an error" are blockers rather
  than only "blocked by the summary line".
- Unrecognised statuses stay quiet. Crying wolf costs more than a missed
  synonym, so the non-blocking set is explicit rather than a default.

Chips name the reason (Blocked / Stalled / Decision / Review / Failed /
Permission / Question) and errors get the red badge; amber keeps meaning
"you are the blocker", red means "it broke".

Alerting, because a static number is easy to walk past:

- The counter pulses when a session *becomes* blocked, keyed on ids not
  the count — a resolve-plus-arrive swap nets to zero and would
  otherwise stay silent on the new blocker.
- Optional short two-tone WebAudio buzzer, throttled so a wave of
  blockers is one tone. Synthesised rather than shipped: no bundle
  bytes, no fetch, works offline.
- Settings → Display → Blocker alerts: count only / pulse / pulse+sound.
  The counter itself is never suppressed; only the transition alert is.
- Pulse decays after 8s and respects prefers-reduced-motion. Nothing
  pulses continuously — permanent motion at fleet scale is wallpaper
  within a day.

Review fixes in the same pass: the pulse could stick forever when the
blocked list churned inside the alert window; a cold page load read its
whole backlog as new arrivals and buzzed; the startup backfill could
resurrect a blocker the operator had already answered; and the notify
cache write reverted an in-memory updatedAt bump via refreshSession.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
…#1717)

Dogfood gap: replying was the only way out of blocked. Now right-click a
blocked row → "Mark unblocked…".

The reason prompt is the point, not friction. Replying to an agent leaves
the rationale in the transcript where anyone — including the overseer —
can read it later; dismissing silently would leave the event log with a
state change and no "why". So the reason is mandatory, with four one-tap
presets so it stays fast at fleet scale and still writes something
machine-comparable rather than "x".

Recorded as a work-graph `operator_unblock` event with a `human`
principal. The payload carries the agent's prior claim (status / note /
timestamp) next to the operator's rationale, so a reader can tell
"operator disagreed with the agent" from "operator resolved it
elsewhere" — those say very different things about whether that agent's
judgement should be trusted next time. Note the overseer and
system_events are soup-only layers; the work graph is the substrate that
exists upstream, and it is what the overseer reads.

Stored as a WATERMARK (`blocked_ack_at` + reason, schema v27), not a
flag: anything reported at or before the ack is dismissed, anything
newer blocks again. One mechanism covers both blocker sources, and
"mark unblocked" can never mute a session permanently.

Review fixes folded in: an acknowledged prompt used to return early and
silently mute a NEWER footer on the same session; the watermark was
compared only against the oldest pending request, so a prompt raised
after the ack stayed suppressed; the confirm button never disabled, so a
double click wrote two ledger rows; a closed AudioContext (backgrounded
iOS PWA) permanently killed the alert tone; collapsing the Pinned
section left a stale off-screen glyph; and the blocked count was taken
after the active-only filter, which hid exactly the disconnected blocked
agents it was supposed to surface.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
)

Seven findings from the fork-stage review, all reproduced before fixing.

P1 — a live prompt no longer loses to `thinking`. A remote Claude agent keeps
`thinking` true for the whole time it waits on a permission or a question:
`claudeRemote` only clears it on the turn's result, and the permission handler
never touches it. `getSessionBlockedState` returned early on `thinking`, so the
single commonest blocker there is — an agent parked on a prompt — was missing
from the section, the count and the arrival alert for as long as it waited. The
comment justifying that guard claimed `classifySessionAttention` suppresses
attention while thinking; it does not, and never did. Prompts are now read
first and the guard applies only to the stored notify footer, which really is
superseded once a new turn starts.

Acknowledgement handling, two ways it could silently mute a session:

- Kind priority ran before the ack filter, so an older dismissed question still
  won the contest and the matching pool held only that question — a genuinely
  unanswered permission raised afterwards was discarded. Acks are now applied
  first and the contest runs over what still needs answering.
- `pendingRequests` is capped at five and keeps the OLDEST, so once the cap is
  full the carried slice cannot show a prompt that arrived after the ack. Adds
  `pendingRequestsNewestAt`, computed uncapped from `agentState` beside
  `pendingRequestsCount` — no column, no migration, optional so an older hub
  may omit it.

Also:

- Keep the blocked lens toggle mounted while the lens is on. When the last
  blocker resolved, `blockedCount > 0` unmounted it without clearing the lens,
  leaving every row hidden and no control to turn it off.
- Pass the content-search props to blocked rows. They float out of their
  directory group during a search like any other floated row, but were the one
  path not given `contentSnippet` / `targetMessageId`, so a blocked hit lost
  its match preview and opened the conversation instead of the message.
- Order the startup backfill by message time. `getMessages` sorts by insertion
  `seq` while replayed transcripts keep their original timestamps, so a delayed
  older footer could outrank a newer `done` and restore the wrong status. The
  operator-reply boundary moves with it.
- Reconcile the notify signal after a rewind truncates history. Nothing else
  repaired it: a Codex rollback starts no new turn, so clear-on-new-turn never
  fires and the next refresh re-read the stale columns.

Two preview-cap tests drove "required" rows with a pending request and leaned
on `thinking` to keep them out of the Blocked section — a workaround for the P1
bug above. They now use the other `requiredIds` trigger, unread, which keeps a
row in its group without depending on state this feature relocates.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
…n#1717)

Second cold-review round.

An archived session kept its prompt as a blocker. `handleSessionEnd` drops
activity and thinking but leaves `agentState.requests` in place, and archived
conversations stay sidebar-visible, so a session archived while holding a
permission sat in the Blocked section and count permanently — on a prompt that
can no longer be answered. `classifySessionAttention` has always excluded
inactive requests for this reason; the blocked classifier now does too. A
notify footer still applies on its own: an agent that said it was stuck before
the session ended still was.

The blocked pill and lens also needed to be reserved for. They render in the
actions row but are not shed-able slots, and the shed budget subtracted only
the machine menu — so the shedder kept icons inline that no longer fit and the
row overflowed its allocation instead of moving the excess into More. They are
now one measured box whose width feeds `blockedPx` into `toolbarChrome` and
comes off the budget, mirroring the existing machine-menu handling.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Four findings, all reproduced before fixing.

A session merge dropped the acknowledgement. `mergeSessionData` moves the
source's pending requests onto the destination with their original
timestamps, but left `blocked_ack_at` behind — so a prompt the operator had
already dismissed read as newer-than-nothing and blocked again the moment the
rows consolidated. The ack now travels with the requests it silences, keeping
the later of the two so a genuinely newer prompt on either side still blocks.

Scheduling a reply for later erased the blocker. `MessageService.sendMessage`
deliberately withholds a future-scheduled message from the CLI, but
`SyncEngine.sendMessage` called `markMessageQueued` regardless — starting a
thinking turn nothing ends and clearing a footer the agent never received an
answer for. Cancelling the schedule then left it erased with no way back.
Future-scheduled sends skip the marker; the matured path still sets it.

The uncapped request watermark went stale on SSE patches. `pendingRequests`
is capped at five, which is why `pendingRequestsNewestAt` exists — but
`patchSessionSummary` recomputed the three neighbouring pending fields and not
that one, so a prompt arriving after an acknowledgement stayed suppressed
until the next full refresh. It is now recomputed with the set it belongs to.

The jump pill could not reach rows the new lenses hid. Active, Working,
Scratchlist (tiann#2376) and the date range all narrow `sessionFilteredSessions`,
so the header count included rows that never mounted and the pending-scroll
effect had nothing to travel to. The jump clears those alongside the search,
machine and persisted-view filters it already cleared.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
… search (tiann#1717)

Third cold-review round; both findings sit next to the previous round's fixes.

The merge carried the acknowledgement but not the footer. `mergeSessionMessages`
moves the blocked turn onto the surviving row and replays no `message-added`,
so nothing re-derives the signal there: the conversation kept an unanswered
AGENT_NOTIFY_SUMMARY in its transcript while dropping out of the Blocked
section and count entirely. The signal now travels with its messages, newest
winning, matching the monotonic rule the live writes already use.

The blocked lens did not reach content search. `searchMessageContent` keeps
only the 100 most recently updated matching sessions, and `showBlockedOnly`
was the one lens missing from `contentSearchCandidateSessions` — so unblocked
matches could consume the whole budget and exclude an older blocked
conversation the lens was specifically asking for.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
…d replies (tiann#1717)

Fourth cold-review round. Both findings are the previous round's fixes not
carried into their sibling path.

OpenCode rewinds do not go through `truncateHubTranscriptFrom`. They use
`reportOpenCodeRewind` -> `truncateOpenCodeRewind`, which rebuilds todos and
refreshes the session — restoring the signal of the very footer the rewind
deleted. A rollback starts no new turn, so the clear-on-new-turn transition
never fires either. That path now reconciles the notify columns the same way.

The startup backfill treated a future-scheduled reply as an answer.
`isOperatorReplyMessage` reads content only, so the scan stopped at a message
`MessageService.sendMessage` deliberately withholds from the agent, burying an
unanswered footer on restart. This is the same blind spot the live path had at
`markMessageQueued`, fixed there last round and missed here.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
…iann#1717)

Fifth cold-review round, and a blind spot in the merge fix from the third.

Carrying the source's notify signal onto the destination keyed on the
destination's `lastNotifyAt` being null. That null is ambiguous: it means
"never had a footer", but it equally means "the operator already replied and
`markMessageQueued` cleared it". In the second case the merge handed an
answered blocker straight back, and the row reappeared as blocked once the
thinking grace expired.

The merge now applies the same operator-reply boundary the startup backfill
uses: scan the (already merged) transcript for a delivered reply newer than
the footer, and leave the destination alone when one exists. Future-scheduled
replies do not count, for the reason they do not count anywhere else — the
agent was never given them.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
…tiann#1717)

Sixth cold-review round.

A subagent's footer was being read as the session's status. Both the local
transcript scanner and the remote SDK converter forward sidechain assistant
output, and `extractAssistantPlainText` does not filter it — so a background
subagent's `done` erased the main agent's unanswered blocker, and its
`blocked` flagged a parent that had finished. Sidechain output is now rejected
before the session-level signal is derived, which covers the backfill scan too
since both go through `extractSessionNotifySignal`.

A cleared signal had no boundary. `clearSessionLastNotify` nulls
`last_notify_at`, which disarms the store's timestamp-monotonic check, and
Claude transcript messages keep their original timestamps — so a footer
delayed past the operator's reply was accepted and the row reappeared as
blocked once thinking ended. Incoming signals older than the turn that did the
clearing are now rejected, which is the same operator-reply boundary the
startup restore and the merge already apply through the transcript.

That null is the third place this branch has had to distinguish "no footer"
from "footer deliberately cleared"; the other two were the merge path and the
backfill scan.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Three Major and three Minor findings from the upstream bot review on tiann#2520.

Major — a dismissal could silence a blocker the operator never saw. The hub
stamped its own receive time as the watermark, so a permission request or
footer arriving between the dialog opening and the confirmation landing was
covered by a reason written for an earlier blocker. The client now sends the
timestamp of the blocker it was displaying; the hub clamps it to now so a
skewed clock cannot dismiss the future. Optional, so an older client keeps the
previous behaviour.

Major — a delayed SSE snapshot could restore cleared blocker state. `lastNotify`
and `blockedAck` ride full-session snapshots on both the global and
session-scoped streams with no ordering between them, so an older snapshot
arriving after a newer clear revived the blocker until the next refresh. Adds a
`notifyUpdatedAt` watermark, bumped on every write including clears, and the
web keeps whichever side is newer — the same shape `attachedJobUpdatedAt`
already uses.

Major — the replay boundary did not outlive the turn. It read
`activeTurnStartedAt`, which resets when the agent goes idle: once the reply
turn ended, that and `last_notify_at` were both null and a delayed pre-reply
footer was accepted. Replaced with a persisted `last_notify_cleared_at`
(schema v39), enforced in SQL and in the cache, so the boundary survives the
turn ending and a restart. The review was right that the previous test only
covered arrival during the reply turn.

Minor — due time is not delivery. A scheduled reply can pass its due time while
the agent is offline and still never be invoked. Recovery and merge now share
one `isDeliveredOperatorReply` predicate that requires invocation for scheduled
messages and orders them by invocation time.

Minor — jumping to a blocker no longer discards saved list filters
speculatively. The target is chosen first, and the status/unread/lens
preferences are only cleared when that specific row is hidden.

Minor — collapsed Blocked rows left focusable buttons mounted, so a keyboard
user tabbing out of the collapsed header landed on invisible rows, one dead tab
stop per blocker. The section now uses `CollapsiblePanel`, which unmounts its
children once the close transition settles.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
tiann#1717)

Four Major and four Minor findings, plus the CI failure they sat behind.

The CI failure was real, not a flake. `withSettingsLock` takes the
cross-process lock by creating `settings.json.hapi.lock` beside the settings
file, but the parent directory was only created inside `writeSettingsUnlocked`
— which runs inside the lock. On a data dir that does not exist yet the lock's
own mkdir fails with ENOENT and retries its whole budget, 50 x 100ms, which is
the unnamed ~5s failure. The directory is now created before the lock is taken.
Latent in upstream; new hub tests that build a SyncEngine on a fresh data dir
made it deterministic. Regression test asserts both the success and the
timing, since the symptom is a retry storm.

Major — refreshSession dropped the blocker revision. The watermark was
in-memory only, so any ordinary refresh reset it to zero and a delayed snapshot
could pass the ordering check. Now persisted alongside the blocker fields.

Major — rewind rejected the footer it should restore. Clearing stamped the
boundary at now, and the retained footer predates that, so the restore failed
the guard the clear had just created and a session whose retained history still
ends blocked dropped out of the section. The signal and its boundary are now
derived first and written together; after a truncation the transcript is the
truth, not arrival order.

Major — the boundary did not advance when no footer was cached. A turn that
starts before the previous footer reaches the hub skipped the write entirely,
so that footer could arrive after the reply turn ended and be accepted. The
write now moves the watermark even with nothing stored, which changes the
store contract an existing test pinned as a no-op.

Major — a merge applied the source acknowledgement to every older blocker on
the destination, hiding ones the operator never saw. It now refuses the
transfer when the destination holds an unacknowledged older blocker.

Minor — delivery evidence is required for every queued reply, not just
scheduled ones, and recovery orders replies by invocation time: a reply
composed before a footer can be invoked after it.

Minor — the unblock dialog froze only the timestamp while still rendering the
live label and note, so it could show one blocker and acknowledge another.
Identity and copy are now captured together.

Minor — jumping to a hidden blocker rewrote saved list and machine filters.
The target row is now exempted from those filters transiently instead.

Minor — the dialog declared `aria-modal` without enforcing it. Adds a focus
trap, an Escape handler, and focus restoration on dismissal.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Third upstream review round. Four Major, two Minor.

The acknowledgement now records WHICH blocker it covered. It was a bare
timestamp, which cannot tell two blockers apart, so it suppressed everything
older than itself: a blocker that arrived while the dialog was open, a
destination prompt during a merge, an incoming source footer during the
reverse merge. Three rounds of findings were all that one shape. `notify:<at>`
for a self-reported footer, `request:<id>` for a prompt, threaded from the
dialog through the API to the store. Acks written before the identity existed
keep the old watermark semantics so an upgrade does not resurrect dismissed
work — and the one-directional merge guard added last round is deleted,
because identity covers both directions properly.

The blocker clears on confirmed delivery, not on optimistic queueing.
Queueing starts no turn: an idempotent retry of an already-consumed message
reuses its row, and a prompt can be cancelled before the agent ever sees it.
Both erased a live blocker. Queueing still advances the clear boundary, so a
footer delayed past the reply cannot slip in behind it.

A stale list response could restore a cleared blocker. The GET can be captured
before a clear and land after SSE applied it; the revision reconciliation now
covers the REST path too, not only SSE summary writes.

The jump could not reach a blocker hidden by the saved status filter. The
target exemption now applies above status and date filtering rather than below
it, and the revealed row stays mounted until the flash ends — releasing it as
the smooth scroll began unmounted the row mid-travel.

The unblock dialog took its focus-return target from `document.activeElement`,
which races the action menu closing and the textarea's own autoFocus, so
cleanup tried to focus the textarea as it unmounted. The caller now names the
row button explicitly.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
@heavygee
heavygee force-pushed the 1996-fold-blocked-filter branch from 9497e56 to 8624538 Compare November 19, 2026 21:28

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Needs changes

Review mode: initial

Requirement — Pass

Operators should be able to combine Blocked only with the existing session filters from one menu. The jump pill serves a separate purpose by taking them to the next blocker.

Evidence

  • Issue #1996 specifies a single filter menu, AND composition, removal of the standalone toggle, and retention of the jump pill. #1996
  • The base menu already groups Active now, Working only, and With drafts only in web/src/components/SessionListViewMenu.tsx:308.

Approach — Needs changes

Reusing the existing menu checkbox and transient filter state is a sound UI approach. Against the declared main target, however, this PR would also ship the open blocker feature, including three database migrations and a new API endpoint. That makes the filter consolidation inseparable from the broader behavior under separate review in #2520.

Evidence

  • The fixed merge-base diff changes 61 files and includes all 15 commits from open PR #2520. The seven-file follow-up is the diff from #2520's tip to 8624538. #2520
  • The current head raises the database schema from 36 to 39 in hub/src/store/index.ts:63 and adds the blocked acknowledgement endpoint in hub/src/web/routes/sessions.ts:1757.
  • The follow-up itself wires the existing transient state into the menu and reset action in web/src/components/SessionList.tsx:3803.

Suggestions

  • Land #2520 through its own review, then rebase the filter commit onto the updated main so this PR's merge-base diff contains only the filter consolidation.

Code — Not reviewed

Line-by-line review stopped at the approach stage because the declared target still includes the separately reviewed dependency.

Testing

Not run (automation; PR code execution is prohibited).

  • At 8624538, GitHub reported core and fixture drift checks passing. Web unit, CLI unit, browser, integration, and Windows Codex MCP checks were still running when inspected.
  • The review was read-only. PR code and tests were not executed.

HAPI Bot

@github-actions github-actions Bot added the codex-review:changes HAPI Bot: review requests changes label Nov 19, 2026
heavygee added a commit to heavygee/hapi that referenced this pull request Nov 19, 2026
heavygee added a commit to heavygee/hapi that referenced this pull request Nov 19, 2026
…eliver (tiann#1717)

Fourth upstream review round. Five Major, three Minor. Three are fallout from
the previous round's fixes.

A session can now retain dismissals for several prompts. One identity slot
meant dismissing a newer question and then the older permission overwrote the
first key — and because the write was timestamp-monotonic, that second
dismissal was rejected outright and surfaced as a 500. The acknowledgement
carries a merged set of identities; `at` and the reason stay monotonic so a
replayed older acknowledgement cannot walk the watermark backwards, which is
what the monotonic guard was actually protecting.

`refreshSession` dropped the acknowledgement identity, so a restart or merge
fell back to timestamp-cutoff semantics — the exact behaviour the identity
replaces. This is the same omission made one round earlier in the same
function with the revision field.

A replayed consumption acknowledgement cleared a live blocker. Re-emitting it
after the turn finished blocked, or naming unknown local ids, consumes nothing
— `recordMessagesConsumed` now reports how many rows it actually invoked and
the clear only fires when that is non-zero.

A stale list snapshot brought answered prompts back. Keeping the newer footer
while taking older pending-request data returned a dismissed prompt to Blocked
and re-fired the arrival alert; those fields are one picture and now travel
together, in both the REST and SSE paths.

The jump still missed blockers hidden by the saved status filter: the
exemption was applied below `allSessions`, which filters by status first.

Rewind reused the startup backfill's six-message scan, so a retained footer
sitting behind a run of sidechain rows was missed — and there the miss is not
a delayed signal but a cleared blocker. Rewind scans deeper.

The ledger recorded whatever footer was current at confirmation rather than
the one the operator read, and the dialog's focus-return ran on every render
(the callback identity changed), focusing the row while the dialog was still
open and bypassing its own focus trap.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
@heavygee
heavygee force-pushed the 1996-fold-blocked-filter branch from 8624538 to 437000b Compare November 19, 2026 21:43
@github-actions github-actions Bot removed the codex-review:changes HAPI Bot: review requests changes label Nov 19, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Needs changes

Review mode: follow-up after new commits

Requirement — Pass

Operators should be able to combine Blocked only with other session filters from one menu. Removing the standalone toggle frees toolbar space while the jump pill still takes operators to the next blocker.

Evidence

  • Issue #1996 specifies AND composition, removal of the standalone toggle, and retention of the jump pill. #1996
  • The base menu already groups unread, date, active, working, and scratchlist filters in web/src/components/SessionListViewMenu.tsx:293.

Approach — Needs changes

Reusing the existing filter state and menu checkbox fits the request. The fixed main-target diff still includes all of open PR #2520, so merging this PR would also ship the blocked-session persistence and acknowledgement API under separate review.

Evidence

  • The fixed main-target diff changes 61 files. The seven-file filter commit sits directly on the current tip of #2520, which remains open. #2520
  • The main-target diff advances the database schema from 36 to 39 and adds PUT /sessions/:id/blocked-ack. See hub/src/store/index.ts:63 and hub/src/web/routes/sessions.ts:1757.
  • The filter commit wires the existing transient state into the menu and its reset action in web/src/components/SessionList.tsx:3803.

Suggestions

  • Land #2520 through its own review, then rebase the filter commit onto updated main so this PR's diff contains only the filter consolidation.

Code — Not reviewed

Code review stopped at the approach stage because the target diff still includes the separately reviewed dependency.

Testing

Not run (automation; PR code execution is prohibited).

  • At 437000b, GitHub reported core and fixture drift checks passing. Web and CLI unit tests, browser tests, integration tests, and Windows Codex MCP checks were still in progress when inspected.
  • The review was read-only. No PR code or tests were executed.

HAPI Bot

@github-actions github-actions Bot added the codex-review:changes HAPI Bot: review requests changes label Nov 19, 2026
…ardening (tiann#1717)

Fifth upstream review round: one Blocker, five Major, three Minor.

BLOCKER — the hub would not start on a v26 database. The v26 fast path
enumerated each later migration by hand, and three migrations added to the step
ladder were never copied into it. A real v26 database ran as far as v36, was
stamped SCHEMA_VERSION anyway, and then lacked `blocked_ack_key` while claiming
to have it; every session load threw. That branch now drives the remainder of
the ladder from `stepMigrations` by index, so a migration can never be silently
missing from it again, and `parseAckKeys` tolerates an absent column.

A queued reply no longer advances the clear boundary. Queueing is optimistic:
if the reply was cancelled before delivery, the boundary it left behind
rejected a footer the agent had generated beforehand and the blocker never
reappeared. The clear and the boundary now move together, on delivery.

Agent output no longer counts as a delivered reply. `sendAgentMessage` emits
`messages-consumed` for id-bearing output such as OpenCode compaction
summaries; the delivered count now considers only rows that are operator input.

A merge unions dismissals instead of discarding the source's. Skipping the
whole source acknowledgement whenever the destination had its own meant two
rows that had each dismissed a different request lost one of them — the merge
unions the requests, so it has to union what dismissed them.

Overflow prompts have real identities. `pendingRequests` is capped, so a prompt
beyond it fell back to a synthetic footer key and its dismissal stopped
matching the moment the real request entered the slice. The summary now carries
every pending request id, uncapped; ids are small, the bodies are not.

Pending-request fields follow `agentStateVersion`, not the notify revision:
answering a prompt advances one and not necessarily the other, so a stale
snapshot could restore an answered prompt and re-fire the arrival alert.

Rewind scans the whole retained transcript. Any fixed window is wrong there —
a miss does not delay the signal, it writes null and drops a session whose
history still ends unanswered.

The unblock dialog joins the existing overlay-hold list, so a row revealed by
the jump exemption cannot unmount from under it mid-entry, and the ledger
records the dismissed blocker's identity even when the footer it named has
already been replaced.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
@heavygee
heavygee force-pushed the 1996-fold-blocked-filter branch from 437000b to c1311e6 Compare November 19, 2026 21:56
@github-actions github-actions Bot removed the codex-review:changes HAPI Bot: review requests changes label Nov 19, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Needs changes

Review mode: follow-up after new commits

Requirement — Pass

Operators should be able to combine Blocked only with other session filters from one menu. Removing the standalone toggle frees toolbar space while the jump pill still takes operators to the next blocked session.

Evidence

  • Issue #1996 specifies AND composition, removal of the standalone toggle, and retention of the jump pill. #1996
  • The base menu already groups unread, date, active, working, and scratchlist filters in web/src/components/SessionListViewMenu.tsx:293.

Approach — Needs changes

Reusing the existing Blocked only state in the shared filter menu fits the requirement. The current main-target diff would also ship the database migrations and acknowledgement API from open PR #2520, making the filter change inseparable from that feature.

Evidence

  • The seven-file filter commit sits directly on the current tip of open PR #2520. The fixed merge-base diff against main includes all 17 dependency commits and changes 62 files. #2520
  • The full diff raises the database schema from 36 to 39 and adds PUT /sessions/:id/blocked-ack. See hub/src/store/index.ts:65 and hub/src/web/routes/sessions.ts:1757 at the fixed head.
  • The filter commit passes the existing state and setter to the menu in web/src/components/SessionList.tsx:3828.

Suggestions

  • Land #2520 through its own review, then rebase the filter commit onto updated main so the target diff contains only the filter consolidation.

Code — Not reviewed

Code review stopped at the approach stage because the main-target diff includes the separately reviewed blocked-session feature.

Testing

Not run (automation; PR code execution is prohibited).

  • At c1311e6, GitHub reported that core and fixture drift checks passed. Web and CLI unit tests, browser tests, integration tests, and Windows Codex MCP checks were still running when inspected.
  • No PR code or tests were executed during this review.

HAPI Bot

@github-actions github-actions Bot added the codex-review:changes HAPI Bot: review requests changes label Nov 19, 2026
heavygee and others added 29 commits November 30, 2026 13:46
Each yield between pages in the startup backfill's chunked fallback
read is a window for a rewind to delete a row a page already read. The
rewind's own reconciliation correctly derives and writes state from the
retained history, but the in-flight scan's accumulated pages still
contain the deleted row — finishing anyway would let the backfill
overwrite that correct, more recent write with a signal computed from
data that no longer exists (tiann#1717 cold-review round 36).

getMessageEpoch is already bumped by every rewind and merge. Capture it
before paging and compare again right after, discarding the whole scan
(never retrying — nothing here is time-sensitive enough to justify a
second full scan) when it changed.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
A touch fires pointerdown before pointerup. Stopping on the first
gesture event regardless of outcome removed every listener — including
pointerup — on a pointerdown whose resume() attempt did not actually
take, since some browsers only grant the autoplay-unlock gesture on
release (tiann#1717 cold-review round 36). The release that would have
genuinely unlocked it was never heard.

unlockBlockedAlertAudioContext now reports whether the context actually
reached running, and the listener only stops once that is true.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
… covered

The round-36 collision-key fix only stripped a key when canonical's
CURRENT signal had different content from the winner's, using that
comparison as proof the key was for a different footer. A reply
answering canonical's own footer between the dismissal and the merge
leaves canonical's derived signal null, with nothing left to compare —
so the stale key survived unexamined and still hid a sibling's
distinct, genuinely unresolved footer at the same coincidental
timestamp.

Default to stripping a colliding key now; only a canonical signal whose
full content matches the winner's is positive evidence the key is
actually for the surviving occurrence. New regression test covers
canonical being answered after the dismissal.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
…l id

A session merge's collision handling clears local_id on an older copy
to sever its ack path, while preserving its invoked_at and
agent_delivered untouched. operatorReplyDeliveredAt used localId == null
alone to decide a reply was never hub-queued and fell back to its much
earlier hub-arrival time — which also matches a row collision-cleared
by a merge, even when it carries a genuinely later, hub-confirmed
delivery. A footer the reply actually answered stayed blocked.

agent_delivered is only ever set to 1 by a real queue-ack
(markMessagesInvoked) or carried forward from one by a copy, so it
survives the clear and is the positive signal a never-queued local
reply has no way to produce. Trust it alongside localId. Also drops
`reconciledInvokedAt`, a type-only field with no write site and no
read site anywhere in the codebase — the comment describing it was
stale and actively misleading next to the real bug.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
…poch bump

Not every getMessageEpoch bump is a rewind or a merge — cancelling a
queued prompt bumps it too, and does no notify reconciliation of its
own. Discarding the scan unconditionally on any epoch change (round 36)
left a session whose transcript still ends in a genuinely unanswered
footer sitting out of Blocked until the next restart's scan or a fresh
live report (tiann#1717 cold-review round 36).

Retry a bounded number of times instead of giving up on the first
mismatch. A retry against an epoch a rewind already reconciled just
recomputes the same correct answer reconciliation already wrote, so
there is no harm in not knowing which kind of change it was — only a
session under genuinely constant mutation exhausts the retries and
still falls back to discarding.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
…delimiters

notifySignalIdentity joins fields with a literal NUL byte rather than a
space, specifically because it is the one character guaranteed not to
appear in a status, note, or local id. That makes this file binary to
a plain grep, which skips it silently and looks identical to "the
string isn't here" (tiann#1717 cold-review round 36) — a trap for every
future search against this file. Note it in the file itself, pointing
at grep -a.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
…cal dismissal

Content equality is not identity. Two imported footers can share every
displayed field — status, note, author time — while being genuinely
distinct occurrences, each with its own native message id. The prior
pass at this fix compared content to prove a colliding dismissal key
belonged to a different footer, and missed exactly this case: identical
content, different id, still wrongly treated as "the key is for the
surviving occurrence" and left in place.

notifySignalIdentity already prefers a native message id when one
exists, falling back to content only when it does not — exactly the
identity this comparison needs. Carry it through DerivedNotifyState.signal
(already computed for every footer during derivation, previously
dropped before reaching this check) and compare identities instead of
raw fields. This subsumes the content comparison for the one case
content comparison was actually sound in — the no-id fallback computes
the identical string either way.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
…succeeds

computeNotifyStateAcrossDuplicateSessions writes a colliding canonical
dismissal's strip immediately, before the merge loop even reaches
source deletion. If deletion is then refused (an unconfirmed Codex
resume, say), the request fails but the write had already committed —
canonical's own footer could reappear on a cache refresh with no
replacement ever actually applied, since the merge that was supposed
to bring the replacement in never completed.

Return the computed edit instead of writing it, following the same
"computed here, committed in applyReconciledNotifyState" convention
the function already uses for the signal itself, and apply it only
after the caller's merge actually succeeds. The winner's own ack
TRANSFER stays eager and untouched: it reads a SOURCE session's ack
keys, which only exist before the merge deletes that session, so
there is no later point left to read them from — unlike canonical,
which is never deleted.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
The row's action menu renders as a SIBLING of the row button, not a
descendant — it needs position: fixed to escape the row's own overflow
clipping. Opening it on a filter-hidden jump target moves focus to a
menu item the row's flash-timeout check never contained in the first
place, so the exemption released underneath the open menu and
unmounted the row (and the menu with it) while the operator was
choosing an action.

Gives the menu the row's own data-session-id and matches on that from
the focused element UPWARD instead of checking containment downward
from the row — this also fixes the focus-hold effect's listener, which
was attached to the row itself and so could never observe a focusout
originating inside the menu's separate DOM subtree at all; it now
listens on the scroll container and filters by the new target's own
session id.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
…ot before

The deferred canonical dismissal strip and the winner's own ack
transfer could both touch the SAME coincidental key: canonical
answered its own dismissed footer (stripping its stale key) while the
winner — a distinct, also-dismissed footer from the duplicate sharing
that same timestamp — transfers that key onto canonical. The transfer
used to write eagerly, union-merging the winner's key into canonical
immediately; the strip, computed separately against canonical's
PRE-transfer keys and applied later, then wiped out the key the
transfer had just legitimately added. A dismissal the operator
actually made disappeared on a successful merge.

Snapshot the winner's ack before a source winner can be deleted, same
as before, but defer the WRITE to applyReconciledNotifyState alongside
the strip — and apply the strip first there, so the transfer's own
fresh read of canonical's keys picks up the post-strip state and unions
the winner's key back in correctly. transferBlockedAck now accepts an
optional pre-fetched source snapshot for exactly this case, where the
source may already be gone by the time the write actually happens.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
…both ways

When blockers sit both above and below the viewport, the picker
skipped the measured, guaranteed-off-screen `above`/`below` candidates
entirely and jumped straight to `fallbackOrder` — which is not scoped
to off-screen at all. Clicking the bidirectional arrow could center a
row already on screen while leaving both real off-screen blockers out
of view.

`both` now tries the same measured candidates the single-direction
cases already use — nearest `above` first, then `below` — before ever
reaching the fallback. Updated the existing test that encoded the old
behavior as its expectation, and added one proving repeated clicks
still reach both sides before falling through to filter-hidden
blockers.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
…ling

Claude applied a bare /plan (no prompt) locally and acknowledged the
queue row with an unflagged emitMessagesConsumed call — the only such
call site in the codebase missing this flag. Every other synchronous,
locally-handled command (Codex, Pi, OpenCode, Copilot) already sets it
at their own analogous call sites. Without it, the hub recorded the
acknowledgement as genuine agent delivery and could clear an unanswered
footer, even though a bare /plan only changes permission mode and
never reaches the agent.

No automated test: reproducing this requires driving runClaude's full
session bootstrap (sessionReady + SDK catalog resolution gating the
internal message queue) through a heavy mock harness, which proved
unreliable to construct reliably in the time available. Verified by
exact pattern match against the 15 other identical
`clearQueuedThinkingGrace: true` call sites across every other CLI
flavor, by typecheck, and by the already-tested hub-side consumption
(sessionHandlers.ts:527) of this flag.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
The hub advances thinkingRevision on every alive tick, and
isRenderIrrelevantPatch treats a bare revision bump as render-relevant
on purpose (rounds 22/28/30) — so a session gets a new object
reference, and the candidate-session array a new array reference, on
every keepalive even when nothing visible changed. contentSearchSessionIds
was a plain useMemo keyed on that array by reference, so it produced a
new ids array on every such tick too; the search effect, keyed on it
by reference, aborted and restarted the same search on every keepalive
while content search was open.

Compare the newly computed ids against the previous value and reuse
that array when nothing actually changed, so the search effect's own
dependency stays stable across a revision-only tick.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
…rozen search response (tiann#1717)

The round-36 fix stabilized contentSearchSessionIds so an unchanged
candidate set no longer forces a refetch on every keepalive tick. That
exposed a staleness bug it had been incidentally masking: a dismissal
that doesn't change candidate membership never refetches, so a search
row kept rendering result.session from the original API response and
could show a dismissed blocker as still blocked. Render each hit via a
sessionsById lookup against the current session instead.

Cold-review round 37.
…iann#1717)

The round-36/37 id-stability and live-lookup fixes correctly stop
refetching when candidate membership is unchanged, but a new matching
message inside an existing candidate's transcript doesn't change
membership either. Nothing in the search effect's dependencies tracked
that, so a fresh match (or an updated snippet/target for an existing
one) never surfaced without something else forcing a refetch.

contentRevision is the hub's own signal for genuine transcript growth,
never bumped by a bare keepalive tick. A plain string of per-candidate
contentRevisions in the effect's own dependency array reinstates a
targeted refetch without reintroducing the unconditional one round 36
removed.

Cold-review round 37.
…1717)

contentRevision only advances for eligible AGENT output, by design —
it's the unread badge's own definition of new content. A new OPERATOR
prompt, also indexed by content search, bumped nothing in the search
effect's dependencies and so never surfaced as a fresh match.

lastUserMessageAt is the hub's own monotonic watermark for exactly
that, already carried on every SessionSummary. Folded it into the same
revision signature alongside contentRevision.

A third sub-case (a rewind deleting an indexed message) has no
existing summary-level signal to reuse and needs real hub-side
plumbing — tracked separately in tiann#2708 rather than rushed in
here.

Cold-review round 37.
…sts (tiann#1717)

PUT /sessions/:id/blocked-ack makes the observed key optional. A
reason-only request arriving after an existing keyed dismissal reused
the stale key set instead of clearing it, silently keeping the ack
scoped to blockers that no longer exist. The endpoint returned 200 and
wrote a fresh blockedAckAt, but a genuinely new blocker (whose key
isn't in that stale set) stayed undismissed — a dismissal that
reported success while dismissing nothing new.

Reject rather than guess: there's no honest way to resolve a keyless
request against an existing keyed dismissal, since the caller's
actual intent (dismiss broadly vs. just didn't supply a key) can't be
inferred from a reason string. BlockedAckMissingKeyError propagates
from SessionCache.setSessionBlockedAck through SyncEngine to the
route, which maps it to 400. Unreachable from the web dialog today
(it always supplies a key) but live via direct API access.

Cold-review round 37.
One real conflict: hub/src/store/sessions.test.ts. Both sides appended
a new top-level describe block at the same position (end of file) —
this branch's setSessionLastNotify/setSessionBlockedAck/
clearSessionBlockedAck (tiann#1717) tests, upstream's DSH metadata
carry-forward test (new on main since this branch's last rebase).
Not a conflicting edit to the same assertions: reconciled structurally
by closing this branch's trailing describe block before upstream's
begins, keeping every assertion from both sides. All 78 tests in the
merged file pass.

Everything else merged automatically.
One conflict: hub/src/sync/syncEngine.ts's @hapi/protocol import line.
Both branches added different symbols to the same import statement —
this branch's own BLOCKED_NOTIFY_STALE_MS/notifyBlockerKey/
isBlockedNotifyStatus (tiann#1717), upstream's hasActiveSteeringTurn
(tiann#2623, Hub-wide Queue or Steer preference, new on main). Not a
competing edit, just two additions to one line: unioned both sets.
hasActiveSteeringTurn is used at line 3128 from upstream's merged
changes; this branch's three symbols are used elsewhere as before.

Everything else merged automatically.
No conflicts — upstream's web/src/api/client.ts change auto-merged
cleanly alongside this branch's own changes to the same file.

Everything else merged automatically.
Upstream's tiann#2727 (group spawned sessions under their leader) lands
squarely on web/src/components/SessionList.tsx, the file this PR
touches most. Two marked conflicts:

- SessionList.quick-unpin.test.tsx: both branches extended the SAME
  shared test ("keyboard-unpinning preserves focus") for their own
  feature — this branch's Blocked-section collapse/expand assertions,
  upstream's new Members-fold-list assertions. Not competing edits to
  one test; split into two complete, independent tests so every
  assertion from both sides survives.
- SessionList.tsx: three regions where this branch's blocked-section
  exclusion logic (`blockedSectionIds`) and upstream's grouping
  primitives (`topLevelSessions`, `groupMembersByLeader`,
  `bucketRunningGroups`) both needed to apply to the same
  computations (globalPinnedSessions, runningSessions, groups).
  Combined both: blocked sessions stay excluded from the running/
  grouped catch-all buckets (so a blocked, still-connected agent never
  renders twice), now filtering upstream's topLevelSessions basis
  instead of this branch's machineFilteredSessions, since group
  members no longer live at the top level.

A fourth, unmarked defect found only by typechecking after the marked
conflicts resolved clean: git's auto-merge silently misattributed
upstream's `{renderGroupMembers(s)}` + `</Fragment>` addition to this
branch's near-identical-looking Blocked-section SessionItem block
instead of the Pinned-section block it actually belonged to — no
conflict markers, just wrong code that would have shipped if
typecheck hadn't caught the resulting unbalanced JSX. Confirmed by
diffing against this branch's pre-merge tip (b8ee9c0) that the
Blocked section never had this content, and against upstream/main
that the Pinned section's own block always did. Moved it to the
correct location.

Full verification: hub/web typecheck clean, hub suite 2516/0 fail,
web suite 429 files/5208 pass/1 expected fail, shared 649/0 fail.
No marked conflicts — upstream's tiann#2728 (keep session groups together
when a row is replaced) auto-merged cleanly into both
hub/src/sync/sessionCache.ts and web/src/components/SessionList.tsx.

Given the previous merge's silent misattribution in this exact file,
verified by hand rather than trusting "went well": diffed tiann#2728's
actual upstream change directly and confirmed both pieces
(transferGroupMembership/setGroupLeader in sessionCache.ts, the
pinned-members-first sort in the member-list render) landed intact
and in context, and re-checked the specific Pinned/Blocked
SessionItem blocks that broke last time — correctly undisturbed this
round, no duplicate function declarations.

Full verification: hub+web typecheck clean, hub suite 2520/0 fail,
web suite 429 files/5209 pass/1 expected fail, shared 649/0 fail.
…cked (tiann#2730)

Session grouping (upstream tiann#2727/tiann#2728) and the Blocked section
(tiann#1717) each independently decided where a session renders, and
neither accounted for the other. Two failure modes:

A blocked group leader orphaned its members entirely. A grouped
member never appears in topLevelSessions; it only ever renders via
renderGroupMembers(leader), called from the Pinned-section loop, the
member-list's own recursion, and the directory-group loop. The
Blocked section's render loop wasn't one of them, so a leader
floating to Blocked took its members out of the tree completely, not
just out of a fold control.

A blocked group member double-rendered. renderGroupMembers' own
member list had no blocked-exclusion filter, so a blocked member kept
rendering nested under its non-blocked leader at the same time it
independently appeared in Blocked.

Fixed by giving each session exactly one render location, matching
the design `docs/guide/session-list.md` already specifies for the
Pinned exception: the Blocked section's render loop now calls
renderGroupMembers(s), same shape as Pinned, so a blocked leader's
remaining members stay reachable underneath it; renderGroupMembers
excludes any member already in blockedSectionIds from its own nested
list, so a blocked member renders once, in Blocked, not twice.

Two pre-existing tests asserted the old, now-superseded behavior — a
member with a pending permission request is itself blocked, so it now
floats to Blocked instead of staying nested behind a "waiting" badge
on the leader. Updated both to assert the member's new direct
visibility in Blocked instead.

Red-green verified: reverted, ran the full groups.test.tsx file,
confirmed exactly the 4 touched tests failed (the 2 new ones and the
2 updated ones) with the predicted wrong behavior, restored
byte-identical, confirmed all 11 green again.

Full verification: web typecheck clean, web suite 429 files/5211
pass/1 expected fail, hub typecheck clean, hub suite 2520/0 fail
(one unrelated migration-timing flake reproduced and cleared on
re-run), shared 649/0 fail.
One conflict, same known-bad region: upstream added a group-dissolve
feature (DissolveGroupButton, allGroupMembersByLeader) to
renderGroupMembers's empty-members branch, in the exact function
tiann#2730's blocked-exclusion filter lives in.

Not competing edits to the same behavior — combined both: kept the
tiann#2730 filter (!blockedSectionIds.has(member.id)) on the visible
member list, adopted upstream's allMembers/dissolveButton so a leader
whose members are all pinned elsewhere, filtered out, OR floated to
Blocked still keeps its dissolve action reachable instead of losing
the group entirely.

Ran the standing hazard check on this exact area regardless of the
marked conflict's scope: all four renderGroupMembers(s) call sites
(Pinned, directory-group, running-bucket, Blocked) verified
individually, no duplication, each correctly closed. Everything past
the conflict markers (the non-empty member-list render, already
carrying upstream's dissolveButton wrapper) auto-merged correctly.

Full verification: web typecheck clean, web suite 429 files/5222
pass/1 expected fail, hub typecheck clean, hub suite 2520/0 fail,
shared 649/0 fail.
Upstream restructured session groups significantly: the "Members (N)"
summary and toggle moved off a separate nested block and onto the
leader's own row (new SessionItemProps.groupSummary/groupMembers/
onToggleGroup, GroupSummaryLine, getGroupRowProps), and the dissolve
action moved from a standalone button into the row's action menu
(DissolveGroupDialog replacing DissolveGroupButton). This is the same
function area tiann#2730's blocked-exclusion filter lives in, again.

Three marked conflicts (destructured props, overlayOpen, and
renderGroupMembers's body) reconciled by combining both sides rather
than picking one. renderGroupMembers adopted upstream's simpler
shape (no more standalone dissolve-button/empty-state branch, since
that moved to getGroupRowProps) while keeping the tiann#2730 filter on its
member list.

getGroupRowProps itself — entirely new from upstream, so it carried
no mark — needed the SAME tiann#2730 filter added by hand: without it, a
blocked member would inflate the leader's own row summary (count,
waiting/working status) instead of being excluded, reintroducing the
double-counting tiann#2730 fixed in a new location.

The standing hazard check caught a second silent misattribution in
this exact area, unmarked by git: the new `{...getGroupRowProps(s)}`
spread landed on the Blocked section's SessionItem (which does need
it) but never made it onto the near-identical Pinned section's
(which also needs it) — confirmed by direct comparison, not assumed.
Added it to Pinned, with a new dedicated test (no prior coverage
exercised a pinned leader with a blocked member) since the gap could
have shipped silently otherwise.

Two existing tiann#2730 tests needed updating for the toggle's new text
("N members"/"1 member" rendered on the leader's own row, replacing
"Members (N)"); two more already-correct tests had the same stale
selector sitting unexercised by the conflict and were fixed too.

Red-green verified both non-marked fixes (the getGroupRowProps filter
and the Pinned-section spread) independently: reverted each, ran the
group test file, confirmed the predicted exact failures (double-
counted summary / missing toggle), restored byte-identical, confirmed
green again.

Full verification: web typecheck clean, web suite 429 files/5223
pass/1 expected fail, hub typecheck clean, hub 2520/0 fail, shared
649/0 fail.
…n-affordance-1717

# Conflicts:
#	web/src/components/SessionList.tsx
…n-affordance-1717

# Conflicts:
#	hub/src/store/index.ts
#	hub/src/store/migration-v13.test.ts
#	hub/src/store/migration-v15.test.ts
#	hub/src/store/migration-v18.test.ts
#	hub/src/store/migration-v19.test.ts
#	hub/src/store/migration-v20.test.ts
#	hub/src/store/migration-v23.test.ts
#	hub/src/store/migration-v24.test.ts
#	hub/src/store/migration-v25.test.ts
#	hub/src/store/migration-v26.test.ts
#	hub/src/store/migration-v28.test.ts
#	hub/src/store/migration-v30.test.ts
#	hub/src/store/migration-v36.test.ts
#	hub/src/store/migration-v37.test.ts
…n-affordance-1717

# Conflicts:
#	hub/src/web/routes/codexDesktop.test.ts
#	hub/src/web/routes/codexExtras.ts
Move showBlockedOnly into the Sort-and-filter menu as a MenuRow
alongside unread/active/working/scratchlist, AND-composed with the
rest. Drop the standalone BlockedLensToggle header button; keep
BlockedJumpPill (still the only way to travel to the next blocked
row, not a filter). Predicate (sessionIsBlocked) and chrome are
unchanged, from tiann#1717.

Also folds Blocked into `isFiltering`, matching its new siblings —
otherwise a previously-collapsed Blocked (or Pinned) section stayed
collapsed after turning the filter on from the menu.

Fixes tiann#1996
@heavygee
heavygee force-pushed the 1996-fold-blocked-filter branch from 1d94280 to 39626b4 Compare December 4, 2026 06:18

This branch has not been deployed

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

Labels

codex-review:changes HAPI Bot: review requests changes status:blocked-upstream Blocked on upstream dependency

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(web): fold blocked-only lens into combined session list filter menu

1 participant