Skip to content

WIP: the live queue serves the whole instance (#51) - #84

Draft
fiddur wants to merge 1 commit into
developfrom
live-instance-queue
Draft

WIP: the live queue serves the whole instance (#51)#84
fiddur wants to merge 1 commit into
developfrom
live-instance-queue

Conversation

@fiddur

@fiddur fiddur commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Draft to preserve WIP — not ready to merge. Pushed so this work survives a machine move; it still needs the steps in "What's left" below.

The bug it fixes (#51)

The file browser is its own diffity session, and every ref gets one. A reader asking a question on one session while the only agent sat parked (via diffity-live) on a different session left both waiting forever — the parked agent never saw the request, and the reader never got an answer.

What this does

Makes the live queue, its listeners, and the page's "listening" answer instance-wide instead of per-session: the request names its own thread, so whichever agent is parked anywhere on this instance takes it. Waiting and working counts stay per-session (they describe the requests a given page can see).

Touched: live.ts (claimNextLiveRequest() with no session filter; single listeners set; liveListenerTotal(); notifyLiveListeners() no-arg; waitForLiveRequest(waitMs, signal?) with abort-before-claim), review-routes.ts, server.ts (listening: liveListenerTotal() > 0), and the live-requests / idle-instance-guards tests.

State

What's left before it can merge

  1. Merge current develop into the branch (clean merge, no rebase) and resolve conflicts — most likely in live.ts and server.ts against feat: diffity inbox — watch review-requested PRs and prepare them ahead #82's live-queue changes.
  2. Bump the patch version (npx tsx scripts/release.ts patch --no-git).
  3. Run pnpm check / the full suite green.
  4. Take it through the normal @code-reviewer round loop to 0 P1 / 0 P2.
  5. Mark ready, squash-merge, deploy the global.

Local worktree while WIP: ~/nc/diffity-fork/live-queue.

Closes #51 (on merge).

The file browser is its own session and every ref gets one, and a
reader asking on one session while the only agent sat parked on
another left both waiting forever. The queue, the listeners and the
page's "listening" answer are now instance-wide: the request names its
thread, so whichever agent is parked here takes it. Waiting and
working stay per session — they describe the requests a page can see.

WIP toward #51 — not yet reviewed or pushed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs
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.

Collapse the live-queue scope mismatch (per-session queue vs process-global presence)

1 participant