fix(devices): refresh paired device last-seen metadata#88607
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed May 31, 2026, 8:11 AM ET / 12:11 UTC. Summary PR surface: Source +53, Tests +127. Total +180 across 4 files. Reproducibility: yes. from source inspection, though I did not execute a failing current-main repro. Current main updates token Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land a maintainer-reviewed version after redacted real setup proof shows an upgraded or installed paired client refreshing durable last-seen metadata without changing pairing policy, token verification, roles, scopes, config, or schema shape. Do we have a high-confidence way to reproduce the issue? Yes from source inspection, though I did not execute a failing current-main repro. Current main updates token Is this the best way to solve the issue? Yes for the code shape: the PR updates the owner paths that approve pairings, verify device tokens, and refresh reconnect metadata while leaving policy/config/schema unchanged. The remaining blocker is proof from a real setup rather than a different implementation direction. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 94b1427fdfa1. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +53, Tests +127. Total +180 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
Summary
Fixes #81169.
Supersedes #81189.
Real behavior proof
Behavior addressed: Accepted paired-device auth and connect paths now refresh durable device-level last-seen metadata so stale paired clients can be audited.
Real environment tested: Local OpenClaw source checkout on macOS after rebasing the branch onto current origin/main.
Exact steps or command run after this patch: Ran focused paired-device auth and gateway reconnect tests, plus changed-file checks and autoreview.
Evidence after fix:
node scripts/run-vitest.mjs src/infra/device-pairing.test.ts --reporter=verbosepassed with 57 tests after the final rebase.node scripts/run-vitest.mjs src/gateway/server.auth.control-ui.test.ts --reporter=verbosepassed with 31 tests after the final rebase.pnpm check:changedpassed before the final rebase; the post-rebase rerun delegated to Testbox and stopped before checks because local Crabbox is0.21.0while the current Testbox wrapper requires>=0.22.0.Observed result after fix: Device-token verification writes
lastSeenReason: "device-token-auth"; paired reconnects writelastSeenReason: "connect"; first silent auto-approved local pairing also creates the paired record withlastSeenReason: "connect"in the approval write.What was not tested: No physical mobile client or installed user pairing state was used; proof uses OpenClaw's isolated pairing and gateway harnesses.
Verification
node scripts/run-vitest.mjs src/infra/device-pairing.test.ts --reporter=verbosenode scripts/run-vitest.mjs src/gateway/server.auth.control-ui.test.ts --reporter=verbosegit diff --checkpnpm exec oxfmt --check --threads=1 src/infra/device-pairing.ts src/infra/device-pairing.test.ts src/gateway/server/ws-connection/message-handler.ts src/gateway/server.auth.control-ui.suite.tspnpm check:changed(passed before final rebase; post-rebase rerun blocked before checks by local Crabbox version0.21.0needing>=0.22.0).agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main(clean: no accepted/actionable findings)