Repository navigation
feat(ui): show open and running sessions beside online people - #160022
Conversation
Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: ce5a0298-56f4-4e44-8254-8af784577ac0
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Co-authored-by: steipete <[email protected]>
|
Codex review: needs maintainer review before merge. Reviewed September 27, 2026, 11:23 PM ET / September 28, 2026, 03:23 UTC (Revision 5). ClawSweeper reviewWhat this changesThe branch adds access-scoped open and running conversation counts to the Gateway session list and shows them beside online people in the Control UI with sorting, filtering, totals, and retry feedback. Merge readiness✅ Ready for maintainer review Keep open. Current main shows online presence without session workload counts, so this branch provides a distinct useful capability. The reviewed head has convincing visual and Gateway wire proof, and I found no introduced blocking defect. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway turns visible session records and live run state into a session-list response. The Control UI observes that response alongside presence data to render the Online sidebar. flowchart LR
A[Online people] --> F[Sidebar view]
B[Session records] --> C[Gateway visibility filter]
C --> D[Owner count summary]
E[Live agent runs] --> D
D --> G[Managed list observation]
G --> F
F --> H[Counts sorting and totals]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +357, Tests +655, Docs +3, Other +26. Total +1041 across 22 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the Gateway as the sole owner of access-scoped session counts and let the Online sidebar present its complete, optional summary. Do we have a high-confidence way to reproduce the issue? Not applicable as a feature request. Current main's Online sidebar shows presence without the requested counts. Is this the best way to solve the issue? Yes. The existing Gateway list owner applies visibility and computes the page-independent summary, while the UI consumes it through managed observation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7b2394da7a9d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
Gateway wire-contract verificationAddressed the review's remaining RPC proof gap on Request (viewer Ada, {"method":"sessions.list","params":{"includeOwnerSessionCounts":true,"includeGlobal":false,"includeUnknown":false,"configuredAgentsOnly":true,"excludeSubagents":true,"excludeCron":true,"excludeSystem":true,"limit":1}}Observed and asserted response excerpt (profile IDs replaced with synthetic names): {"ok":true,"returnedSessions":1,"ownerSessionCounts":[{"profileId":"Ada","open":3,"running":1},{"profileId":"Bob","open":1,"running":0}]}The aggregate covered all visible matching sessions despite a one-row page. Ada's own draft counted; Bob's private draft and its active run were excluded. A second request with Result: 1 wire-contract proof passed, 11.191 s test time / 57.22 s total including cold compilation and teardown. The one-off proof is not added to recurring CI. Existing 39 focused regressions cover the broader cross-agent, live/queued, access-change, and UI behavior matrix. |
Regenerate the Swift wire model from its schema and import the people renderer directly to remove the type-import cycle. Co-authored-by: steipete <[email protected]>
Admit initial count hydration through the existing background bootstrap coordinator and fence queued observations across viewer and connection retirement. Co-authored-by: steipete <[email protected]>
…aw#160022) * feat(ui): show open and running sessions beside online people Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: ce5a0298-56f4-4e44-8254-8af784577ac0 * fix(ui): satisfy session-count controller lint rules Co-authored-by: steipete <[email protected]> * fix(ui): reconcile session-count protocol and import graph Regenerate the Swift wire model from its schema and import the people renderer directly to remove the type-import cycle. Co-authored-by: steipete <[email protected]> * fix(ui): defer people counts until chat startup settles Admit initial count hydration through the existing background bootstrap coordinator and fence queued observations across viewer and connection retirement. Co-authored-by: steipete <[email protected]> --------- Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: steipete <[email protected]>


What Problem This Solves
The Online list shows whether people are active, but not how many conversations they own or have running.
User Impact
See Open and Running counts beside each person, sort by either count, or show only people with running sessions. Human presence stays separate from agent work, and totals cover the people shown.
Counts include owned, unarchived conversations you can access across configured agents. Hidden subagents, automation, system, and global/unknown sessions are excluded. Queued work and descendant activity are not counted as direct running sessions. No permission or storage changes are introduced.
Why This Change Was Made
A complete Gateway-owned summary keeps counts accurate when the sidebar is filtered or paginated. The UI reuses managed session-list observation and refresh pacing, fences viewer/connection changes, distinguishes unknown from zero, and preserves the last successful counts with a retry notice after a failed refresh.
Evidence
sessions.listhandler regressions cover cross-agent ownership, pagination, live/queued/stale run states, duplicate runs, reassignment, profile merges, more than 60 owners, access changes, and private/incognito exclusions. Clean summary reads perform no SQLite preparation.72b76842012fis 372,549 B; the original measured candidate was 372,814 B (+265 B), against a 371,581 B absolute limit. CSS grows by 166 B, within its allowance. No budgets or baselines were relaxed.Focused final regression run: 39 tests passed across the Gateway handler, sidebar controller/renderer, and managed-list event tests, with
--maxWorkers=1. Combined wall time: 46.79 s, including cold worker compilation; Gateway tests execute in 2.425 s + 0.493 s, and the UI shard finishes in 3.88 s. Changed-file guards and core/test/UI typechecks passed; the final lint lane found two missing braces in the new controller. Both were corrected without behavior changes; targeted lint passes (0 warnings/errors, 8.6 s). Existing functional and visual proof remains applicable. Hosted feature-test timing has not yet been isolated; the first CI attempt failed on the two checks described below.CI follow-up: run 36366961172 identified stale generated Swift protocol output and a sidebar renderer type-import cycle. The Swift model was regenerated through its canonical generator; the sidebar now imports the people renderer directly instead of through its re-export. Local protocol registry/generation/Swift freshness/Kotlin/since checks pass; Madge reports 0 cycles, UI types and targeted lint pass (0 warnings/errors). The 37 focused UI regressions pass again in 4.59 s. These are mechanical corrections with no visual or behavior change; existing screenshot and Gateway proof remains applicable. No CI rerun or budget relaxation was used.
Startup-admission correction: run 36367759526 exposed four chat-startup-priority E2E failures: the new count summary could dispatch before the selected transcript settled. Initial count hydration now uses the existing background bootstrap coordinator and fences queued work against the captured observation and connection; manual retry remains explicit. Two fake-timer regressions cover startup hold/release and retirement before admission. All 99 focused UI/managed-list regressions pass in 8.57 s wall (5.82 s Vitest); UI types pass, and targeted lint passes (0 warnings/errors, 9.3 s) after marking the two intentionally in-flight test calls with
void. Fresh independent P0/P1 review is scoped-clean. A local full-browser replay was refused by the loopback preflight (HTTP 502), and all nine exact-head hosted UI E2E shards now pass, including the repaired startup-priority shard; no CI rerun, policy bypass, or live Gateway change was used. Existing screenshot and Gateway wire proof remains applicable.Hosted infrastructure follow-up: run 36368977950, iPhone screenshot job stopped before source compilation while Xcode resolved Swift packages: the runner’s cached WebRTC repository directory was missing (exit 74). Uploading its failure evidence also failed with DNS
ENOTFOUND. The original job log was inspected and retained; this is not a feature-test assertion or Swift compiler error. The first cancellation interrupted proof; attempt 2 subsequently passed all nine UI E2E shards, closing the repaired browser-flow gap. After the run settled as cancelled, one bounded failed-job/dependency rerun was requested at 02:25 UTC for this identified runner-cache/network failure. The unchanged head is pinned to f1dc5eb; attempt 2 passed the iPhone job but failed the iPad 13-inch screenshot job during a later XCTest application launch, so it did not produce passing whole-run CI. Original failure evidence is retained. No budget or source changes were made for this infrastructure failure.Latest CI recovery: attempt 2’s iPad job successfully captured Control and Chat, then hung in
XCUIApplication.launch()for the Agent snapshot until the 180-second allowance expired; XCTest reported that the app had no process ID. The retained log and capture-attempt manifest establish the launch boundary, not a feature assertion or a proven root cause inside the app. All nine UI E2E shards, UI checks, and hosted Control UI performance checks passed on this exact head. One bounded failed-job/dependency retry was accepted at 03:14 UTC for this distinct launch failure; attempt 3 is in progress on unchangedf1dc5eb976530f93461d7d959e7d4a06e6316914. No source change, timeout increase, assertion weakening, or budget relaxation was made for this recovery. A passing retry will not be described as a fix for the launch failure.Worked on by
Work sessions
View the OpenClaw team session