Skip to content

fix(tui): read the seat queue on drilled Topology views so Q / WORK / NOW fill - #1173

Merged
mvschwarz merged 2 commits into
mvschwarz:mainfrom
Quentin-M:fix/tui-topology-seat-queue
Oct 12, 2026
Merged

mvschwarz merged 2 commits into
mvschwarz:mainfrom
Quentin-M:fix/tui-topology-seat-queue

Conversation

@Quentin-M

@Quentin-M Quentin-M commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Hello, and thank you for OpenRig. I kindly propose this fix for #1172. If it is not the right approach, I apologize in advance, and I am happy to rework or close it.

What a user gets

Before: on the Topology table (instance, rig and pod views) the Q, WORK and NOW columns are empty for every seat, and the footer reads 0 open rows, even when seats hold queued, in-progress and blocked items. After: Q is the seat's open-item count, WORK its slice, NOW its current item. Fixes #1172.

How you verified it

Tested at 3001cc4 plus this commit. The fix resolves the issue: the issue reporter ran the compiled TUI from this branch against the same live daemon and confirmed the columns now populate.

  • Live check: node packages/tui/dist/main.js --url <daemon> against a running 20-seat rig. Before the fix every seat showed · / — / — and 0 open rows. After it, Q shows per-seat counts, WORK the slice and NOW the current item. The footer showed 22 open rows, matching the 22 active items in rig queue list -A.
  • New test in hydrate.test.ts is red without the fix (expected [] to deeply equal ['qi1']) and green with it.
  • npx vitest run in packages/tui: 921 pass. Three tests fail. Two fail on a clean 3001cc4 too (socket.test.ts socket home, execution-view.test.ts at 24 cols). The third (navigation-continuity.test.ts) pinned the old behaviour and is updated here: the drilled-rig page now reads the four queue lists, and the landing keeps its names-only read.
  • A new test checks that a drilled rig on the overview, graph and health tabs makes no /api/queue/list call. It fails without the gate.
  • Not run: npm run lint, and the daemon and cli suites.

Anything you were unsure about

  • 53ca93f7 gates the queue reads, and its message does not say whether that was intended. I kept the gate for the landing and for the other heavy reads (health, review, stream, scopes, execution) and enabled the four seat-queue lists only on a seat's page and the drilled table tab, as suggested in review. That adds 4 list calls per refresh on those views. I did not measure the cost.

  • rig ps --nodes already returns pendingWorkCount per seat. The Q column could use those counts and skip the list reads, but WORK and NOW need the rows.

  • One concern per PR; no version bump; no CHANGELOG.md edit

  • Tests added or updated where the change is testable

  • I listed the checks I ran, their results, and any checks I could not run

Summary by CodeRabbit

  • Bug Fixes
    • Focused topology table views drilled into a selected agent now display its attention, blocked, in-progress, and pending queue items.
    • Recently finished items remain limited to broad views and are not shown in focused topology views.
    • Drilling into a selected agent from the overview, graph, or health tab does not load queue items; queue details are loaded for the applicable focused topology table view.

… NOW fill

53ca93f gated the queue reads behind broadReads, which is false on every
Topology table view, so Q, WORK and NOW were always empty. Drilled views now
read the four seat-queue lists; the seatless landing stays names-only.
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 58c367b2-9354-47dd-9f30-6d9ceee02b5e


📥 Commits

Reviewing files that changed from the base of the PR and between e2ed672 and 634c787.



📒 Files selected for processing (3)
  • packages/tui/src/hydrate.ts
  • packages/tui/test/hydrate.test.ts
  • packages/tui/test/navigation-continuity.test.ts


Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.




📝 Walkthrough
📝 Walkthrough

Walkthrough

Focused topology table views now fetch attention, blocked, in-progress, and pending queue lists. Other focused views continue to skip those reads. Tests cover hydrated queue data and navigation requests.

Changes

Topology queue hydration

Layer / File(s) Summary
Queue reads and validation
packages/tui/src/hydrate.ts, packages/tui/test/hydrate.test.ts, packages/tui/test/navigation-continuity.test.ts
Queue reads now run for broad reads and focused topology views drilled to an agent or a resource with the table tab selected. Tests check hydrated queue fields and confirm that other focused views make no queue-list requests.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: mvschwarz



Merge Risk: ⚪ Minimal · up to 634c7

The topology table can populate its queue-backed fields and open-row footer for host, rig, and pod drills. No concrete unresolved issue from this review blocks merging.

Pre-merge checks | Passed 3 | Failed 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check Warning Issue #1172 requires Q, WORK, NOW, and the open-row footer on instance, rig, and pod Topology tables. The current hydration loads seat queue lists for a drilled table and for a seat page, so the rig a… Implement queue-backed Topology data for the instance table, or document an agreed change to #1172 before narrowing its scope. Add regression coverage for the instance and pod tables, and verify Q, WORK, NOW, and the open-row footer.
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Out of Scope Changes check Passed The hydration change and the updated navigation and hydration tests directly support issue #1172. The navigation assertions validate that queue reads remain disabled on unrelated drilled tabs. No unre…
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: restoring seat queue reads on drilled Topology views so Q, WORK, and NOW display queue data.

Full details: Linked Issues check

Explanation

Issue #1172 requires Q, WORK, NOW, and the open-row footer on instance, rig, and pod Topology tables. The current hydration loads seat queue lists for a drilled table and for a seat page, so the rig and pod drilled-table cases are addressed. The Topology landing remains names-only and does not load the seat inventory or queue lists. Therefore the instance table requirement remains unmet. The focused regression coverage also covers a rig only.


  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR



  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mvschwarz

Copy link
Copy Markdown
Owner

Thanks, @Quentin-M, for the clear report in #1172 and for the quick fix. As you describe it, the Topology table's Q, WORK and NOW columns stay empty on the rig and pod views even when seats hold queued, in-progress and blocked items, and this fills them again; thanks too for checking it against a live daemon. We'll review it and comment here.

@mvschwarz

Copy link
Copy Markdown
Owner

Thanks again, @Quentin-M. We've reviewed this and checked the cause: 53ca93f7 moved these queue reads behind the check for the broad, undrilled view, so drilled Topology views stopped loading them. With your change the instance, rig and pod tables and a seat's page fill again, the landing view still loads names only, and your new hydrate test fails without the fix.

One change we'd ask for: please load the queue lists only on the views that show them. As written, any drilled view loads all four lists, plus the blocked-item lookups, on every tab, including overview, graph and health, which never show them. Gating it to a seat's page and the table tab would do it, for example:

const seatQueueReads = broadReads || (focusedTopology && (topologyLeaf?.kind === "agent" || (!!topologyLeaf && viewContext.viewTab === "table")));

The recent tab can stay as it is on main, since it falls back to each transition's own summary. A check in navigation-continuity.test.ts that a rig drill on the graph or health tab makes no /api/queue/list call would cover it.

One small thing: in the new hydrate.test.ts case, could the drill entry be a real drill segment, { kind: "rig", name: "myrig" }, so the test goes through the gate the way the TUI calls it?

And optionally, the PR description names the rig and pod views. The instance (host) table fills too.

Gate the four seat-queue lists to a seat's page and the drilled table tab.
Overview, graph and health tabs make no /api/queue/list call. The hydrate
test now drills with a real segment.
@Quentin-M

Copy link
Copy Markdown
Contributor Author

Thank you @mvschwarz, and sorry I gated it too wide. All three points are in e2ed672 → the new commit:

  • Queue lists now load only on a seat's page and the drilled table tab, using your gate.
  • navigation-continuity.test.ts has a new case: a drilled rig on the overview, graph or health tab makes no /api/queue/list call. I checked it fails without the gate (3 failures) and passes with it.
  • The hydrate test drills with { kind: "rig", name: "myrig" }.
  • The description now says instance, rig and pod views.

packages/tui vitest: 921 pass, the same 2 failures as a clean main (socket.test.ts, execution-view.test.ts at 24 cols). Against a live 20-seat daemon the table still fills (21 open rows). Happy to change anything else.

@mvschwarz

Copy link
Copy Markdown
Owner

Thanks, @Quentin-M, and no need to apologize. This is what we asked for: the queue lists now load only on a seat's page and the drilled table tab, the overview, graph and health tabs stay as light as before, and your new test pins that. The hydrate test now drills the way the TUI does too.

It's approved. Once its checks finish, it'll merge with other ready changes for an upcoming release, and we'll update here when it does.

@Quentin-M

Copy link
Copy Markdown
Contributor Author

Thanks guys <3

@openrig-review openrig-review left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved at 634c787. The TUI's Topology table reads the seat queue again on drilled views, so the Q, WORK and NOW columns fill: Q is a seat's open-item count, WORK its slice and NOW its current item. The queue is read only on a seat's page and the table tab, so the graph and health tabs make no extra calls. Required CI passed at this head, on current main for its files.

— dev60-planner@v-openrig-build

@mvschwarz
mvschwarz merged commit 001c070 into mvschwarz:main Oct 12, 2026
10 checks passed
@mvschwarz

Copy link
Copy Markdown
Owner

Merged to main, thanks @Quentin-M. It will ship in the next release.

mvschwarz added a commit that referenced this pull request Oct 12, 2026
…1175)

When a queue list reaches its cap or fails to load, the TUI's instance, rig, pod and seat views and Pulse say the count is a sample or a lower bound. A seat missing from a partial sample reads as unknown work, genuinely empty data still reads empty, and a row that appears in two lists counts once. No new reads, and no daemon, query or setting change; the caps the TUI assumes (100, and 50 for pending) are a stated limit.

Refs #1172, #1173.
@mvschwarz

Copy link
Copy Markdown
Owner

An update, @Quentin-M: OpenRig 0.6.11 is out on npm, and this change is in it (release notes: https://github.com/mvschwarz/openrig/releases/tag/v0.6.11). Thanks again.

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.

TUI Topology table: Q / WORK / NOW stay empty while seats hold queue items (regressed in 53ca93f7)

3 participants