Skip to content

fix: show idle people accurately while they stay online - #159493

Merged
roboclaw-bot merged 2 commits into
mainfrom
openclaw/detecting-online-active-and-inactive-users
Sep 27, 2026
Merged

roboclaw-bot merged 2 commits into
mainfrom
openclaw/detecting-online-active-and-inactive-users

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #159423

What Problem This Solves

Fixes: connected people look active even when their last interaction is old or unavailable.

User Impact

Online remains connection status; people now show Active for recent interaction, Idle after two minutes, or plain Online when activity is unavailable. A fresh foreground web visit counts as activity; automatic reconnects, background traffic, and incoming agent output do not. Sidebar rows, person cards, and the Activity page use the same rules.

This is recent OpenClaw use, not physical presence or attention. Reading without interacting can become idle. No configuration or data migration is required.

Why This Change Was Made

Reuse the Gateway's authenticated person timing and cross-tab aggregation. The small presence.activity request accepts no identity, timestamp, or input contents; the server records accepted interaction time. The web client reports trusted visible input with a 30-second throttle. A shared UI expiry controller updates idle status without network events and handles hidden pages, remounts, and expiry during rendering.

Evidence

  • 348 focused tests passed across the Gateway, activity reporter, presence projections, sidebar, Activity page, and mention rendering. The final expiry-owner run passed 164 tests in 21.95 seconds.
  • Real Chromium with a deterministic mock Gateway: 12 committed browser cases plus one proof-only Activity-page case passed in 45.87 seconds. The new state assertions fail against original source f6974fb3550fe089663bc56ce89d8e1ec79170de.
  • Full pnpm build, Control UI build, and changed-scope checks passed. Final UI-only repairs were rechecked with focused tests, UI production/test type graphs, and lint.
  • Canonical ui:check-performance:base comparison passed: startup JavaScript 371,200 B, below 371,332 B; startup CSS +73 B. No baseline or limit changes. Local non-pinned build metadata produced a misleading absolute-size overage; the same-identity CI comparison resolves it.
  • Independent review completed; its remount finding and an additional render-deadline regression were fixed and proved red/green. No live Team Gateway was modified.

Before

Before: online people do not distinguish recent interaction

After

After: Active, Idle, and plain Online are separate from connection duration

Activity-page comparison and test cost

Before

Before: a person idle for ten minutes is only labeled Online

After

After: the Activity page distinguishes Online and Idle

One-worker local wall observations using pnpm test <file> --maxWorkers=1:

Test file Wall
server-methods.presence-activity.test.ts 43.80 s
server-methods-list.test.ts 9.17 s
gateway-presence-activity.test.ts 2.94 s
presence-users.test.ts 2.02 s
presence-activity-controller.test.ts 2.06 s
session-activity-view.test.ts 3.46 s

The registered Gateway request test spends most wall time compiling the shared subprocess fixture (91% transform in this cold observation); its assertions take about 1.7 seconds. It exercises real method dispatch, scope admission, identity hydration, and live-connection recording rather than bypassing that boundary. Sidebar support changes run in its existing suite; the final sidebar/Activity-page/expiry group took 21.95 seconds. Hosted CI run 36302065400 passed on head 741d7e9. Whole-job wall times (including setup and other shard tests): UI 297–309 s; UI E2E 242–454 s; bundled protocol 226 s; UI performance 130 s. ClawSweeper completed the same-head review without actionable findings.

Browser proof used AWS Crabbox cbx_8a0a18f8d6a7: run. The repository UI E2E runner executed people-activity-card.e2e.test.ts with screenshot capture. Synthetic data only; no provider APIs or live user accounts were exercised.

Worked on by

Work sessions


View the OpenClaw team session

Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: d2b6e89e-2f4e-4421-963f-17c0ffed6810
@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: L labels Sep 27, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 27, 2026 06:56
@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: 741d7e934abd365d385f57beaa0c4628274c60dc
  • Maintainer: @roboclaw-bot
  • Repository role: maintain

These security sensitive changes were made:

  • src/gateway/methods/core-descriptors.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/methods/core-profile-access.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 27, 2026
@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 27, 2026, 3:13 AM ET / 07:13 UTC (Revision 2).

ClawSweeper review

What this changes

The branch adds a read-scoped Gateway interaction signal and shows Active, Idle, or plain Online for connected people in the Control UI sidebar, person cards, and Activity page.

Merge readiness

✅ Ready for maintainer review

Keep open. Current main does not provide the requested activity states, and the linked issue remains open. The latest head has a coherent implementation, visible before-and-after proof, and no concrete introduced defect found in this review.

Priority: P2
Reviewed head: 741d7e934abd365d385f57beaa0c4628274c60dc

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Direct visual proof and focused boundary coverage support a coherent, multi-surface change with no confirmed blocking defect.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before-and-after Chromium screenshots show the changed sidebar, card, and Activity-page states; browser tests exercise the Control UI against a mock Gateway, while registered Gateway dispatch tests exercise the real activity owner and denied callers. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before-and-after Chromium screenshots show the changed sidebar, card, and Activity-page states; browser tests exercise the Control UI against a mock Gateway, while registered Gateway dispatch tests exercise the real activity owner and denied callers. No stored-data contract changes.
Evidence reviewed 8 items Current main behavior: The current projection treats absent native input recency as not idle; it has no separate unknown interaction state.
Introduced Gateway boundary: The new method requires operator.read; its schema accepts an empty object, and the handler records activity on the requesting connection.
Final activity write: The presence owner accepts only the same live client object still in the registry, derives the timestamp on the server, and shares it only with identity-matched live peers.
Findings None None.
Security None None.

How this fits together

The Gateway holds ephemeral presence for connected clients and sends authorized readers presence snapshots. The Control UI groups those connections by person and renders their online status and recent interaction state.

flowchart LR
  A[Visible browser interaction] --> B[Activity request]
  B --> C[Scope and live connection checks]
  C --> D[Gateway presence timing]
  D --> E[Presence snapshot]
  E --> F[Activity expiry controller]
  F --> G[Sidebar, cards, and Activity page]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +244, Tests +572, Docs +23, Other +1. Total +840 across 31 files.

View PR surface stats
Area Files Added Removed Net
Source 20 290 46 +244
Tests 9 596 24 +572
Docs 1 23 0 +23
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 31 910 70 +840

Review metrics

Metric Value Why it matters
Gateway request surface 1 added, 0 client-supplied fields The new read-scoped request changes shared presence only through the authenticated live connection.
Production versus test growth production +245 net lines, tests +572 net lines The PR explains the new Gateway, reporting, and UI expiry responsibilities; the tests cover their separate boundaries.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #159423
Summary: This PR is the candidate implementation for the linked open issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep the Gateway as the activity-timing owner and render connection status separately from interaction age across the Control UI.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a new activity-display capability. Current-main source and the inspected before screenshots establish the previous presentation; no current-main runtime reproduction was run.

Is this the best way to solve the issue?

Yes. The branch uses existing Gateway-owned person timing and one shared UI activity projection instead of creating a competing state owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 53b95fd0bef8.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded improvement to how connected people's activity is presented, without evidence of an outage or blocked core workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected before-and-after Chromium screenshots show the changed sidebar, card, and Activity-page states; browser tests exercise the Control UI against a mock Gateway, while registered Gateway dispatch tests exercise the real activity owner and denied callers. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before-and-after Chromium screenshots show the changed sidebar, card, and Activity-page states; browser tests exercise the Control UI against a mock Gateway, while registered Gateway dispatch tests exercise the real activity owner and denied callers. No stored-data contract changes.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before-and-after Chromium screenshots show the changed sidebar, card, and Activity-page states; browser tests exercise the Control UI against a mock Gateway, while registered Gateway dispatch tests exercise the real activity owner and denied callers. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-27T07:03:07.416Z sha 15047ef :: needs maintainer review before merge. :: none

Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: f7105551-cbc5-4752-bc65-4b3f2da4e152
@openclaw-barnacle openclaw-barnacle Bot added the app: android App: android label Sep 27, 2026
@roboclaw-bot
roboclaw-bot merged commit 6152db4 into main Sep 27, 2026
243 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/detecting-online-active-and-inactive-users branch September 27, 2026 07:24
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 28, 2026
)

* fix: show idle people accurately while they stay online

Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: d2b6e89e-2f4e-4421-963f-17c0ffed6810

* fix: show idle people accurately while they stay online

Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: f7105551-cbc5-4752-bc65-4b3f2da4e152

---------

Co-authored-by: steipete <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security-sensitive-changed size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Separate online connectivity from recent person activity

1 participant