Skip to content

Openers report scales with unfinished work: recorded totals for finished words, unfinished-only default, 100 per page - #404

Merged
ahernsean merged 2 commits into
mainfrom
claude/openers-scale
Oct 9, 2026
Merged

ahernsean merged 2 commits into
mainfrom
claude/openers-scale

Conversation

@ahernsean

@ahernsean ahernsean commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

The Openers report rescanned every membership the queue had ever recorded (1.2M rows at 2,760 openers, ~556 per finished opener) on every poll, and the client rendered every opener. Projected to 10,000 openers that was about 20 s per build, 6.4 MB per poll and ~250,000 DOM nodes. This change makes a build depend on the queue's unfinished work, not on everything the sweep has finished.

  • Finished words read recorded totals. opener_work gains completed_at, completed_branch_count, completed_direct_branch_count and completed_direct_done_branch_count. Both paths that complete a request (mark_openers_complete, now in its own BEGIN IMMEDIATE, and the withdrawal path _finish_opener_work_ids) record the word's totals over every one of its requests in the same transaction. opener_rows reads them for a word whose requests are all complete, and counts from memberships only the words with an unfinished request.
  • The cross-word "branches" total counts unfinished words only. The client labels it "branches (unfinished)". Open branches are gathered in one pass over the live memberships instead of once per group.
  • The Openers list opens on queued and active words, 100 per page. The request always names the states (the server has no default); the page URL leaves the default out and writes opener_state=all for every state. Ticking every state or none shows them all, a named word's view has no state default, and switching into Openers from another view returns to the default. The page size is the report's own default, applied where its request and pager read it and never written into the shared limit, so a word report opened from an opener card is not capped at 100 response groups.

Measured on a snapshot of the live queue after migration and backfill: all 2,760 words report the same totals as before, a full build takes ~2.2 s (was 5–6 s), and the default page takes ~2.2 s for a 112 kB response (was ~6 s for 1.6 MB). What remains is the live membership read and rollups, which grow with unfinished openers.

Deploy: this is a queue migration, so stop the swarm, pull and start it. The migration that adds the columns also records the totals of every request already complete, from its retained memberships (1.7 s for 2,006 words on a snapshot of the live queue).

🤖 Generated with Claude Code

https://claude.ai/code/session_01PpacbZRqT46b4Duhxq5QNQ

…on unfinished words, 100 per page

A request records, when it completes, the word's branch totals over
every one of its requests.  opener_rows reads those for a word whose
requests are all complete and counts only words with unfinished work
from their memberships, so a build no longer grows with every opener
the sweep has finished.  The cross-word branch totals count unfinished
words only, and their open branches are gathered in one pass.

The Openers list now defaults to queued and active words, 100 per page.
Ticking every state, or none, shows them all; a named word's view has no
state default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpacbZRqT46b4Duhxq5QNQ
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T12:37:42.481293Z 1b021de PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1b021de3ac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread erd_queue.py
Comment thread erd_queue.py
MIN(s.requested_at) AS requested_at,
NULL AS started_at,
MAX(s.requested_priority) AS requested_priority,
MAX(s.completed_at) AS completed_at,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve read-only compatibility with pre-upgrade queues

If the report server opens an existing queue before any writable swarm or CLI process has migrated it, this unconditional reference to completed_at fails with no such column and the Openers report returns a queue-source error. _open_report_queue() deliberately uses initialize_schema=False, so a stopped-swarm/report-only deployment cannot add the columns itself; retain a schema-aware fallback like the previous started_at handling or otherwise ensure the read works against the prior schema.

AGENTS.md reference: AGENTS.md:L518-L521

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Not adopting this. The code is always updated before anything reads the queue: the deploy stops the swarm, pulls, and starts it, and erd_search.py start starts the supervisor (whose writable open migrates the queue) before the report server. A report server that ever did read an unmigrated queue would show a queue-source error on the Openers page until the swarm's next start, and the report opens the queue per request, so it recovers on its own with no restart.

Comment thread report_client.html Outdated
…the opener page size out of shared state

A queue from before completion totals were recorded gets them, and the
moment each request completed, from its retained memberships when the
migration adds the columns.

The Openers report's default page size is applied where its request and
pager read it, never written into the shared limit, so a word report
opened from an opener card no longer inherits a cap on its response
groups.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PpacbZRqT46b4Duhxq5QNQ
@ahernsean
ahernsean enabled auto-merge October 9, 2026 12:51
@ahernsean
ahernsean merged commit 65de302 into main Oct 9, 2026
7 checks passed
@ahernsean
ahernsean deleted the claude/openers-scale branch October 9, 2026 12:52
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