Repository navigation
fix(workboard): truthful run and pull-request facts on Sessions boards - #165189
Conversation
|
🦞👀 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. |
|
Codex review: needs changes before merge. Reviewed October 4, 2026, 9:55 PM ET / October 5, 2026, 01:55 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR corrects Sessions board activity facts, retains known pull-request placement during outages, strips Markdown from previews, and adds clickable pull-request references. Merge readiness⛔ Needs changes before merge - 1 item remains This PR remains useful: current main still contains the reported classification and presentation problems. The earlier integration blocker is resolved, and no blocking introduced code defect was found. Priority: P2 Review scores
Verification
How this fits togetherWorkboard’s Sessions boards group caller-visible conversations using Gateway-owned run, observer, and pull-request facts. The plugin projects those facts into columns and cards in the Control UI. flowchart LR
A[Caller-visible sessions] --> B[Gateway session facts]
C[Live run registry] --> B
D[Shared pull-request owner] --> B
B --> E[Workboard snapshot and retry cache]
E --> F[Column rules and operator pins]
F --> G[Sessions board cards]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +181, Tests +339, Docs +12. Total +532 across 13 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep Gateway ownership of authoritative facts and Workboard’s revision-scoped projection, with explicit stale-state warnings and independently operable PR links. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main classifies a persisted running session as active even when live liveness is false. No runtime reproduction was executed during this read-only review. Is this the best way to solve the issue? Yes. The patch repairs existing owners and preserves the shared snapshot contract rather than creating another loader or cache authority. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 12785be2ff02. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
b29c13f to
9857a47
Compare
|
Landed with a pinned-head squash merge past an inherited red, per the standing rule. Live proof (coordinator, real Gateway + Control UI from head 9857a47): a fresh session was polled through Run state follows the live registry (Working only while the run is active), the last-message preview is plain text with the link label kept and all Markdown markers gone, and the rig's PR-ineligible sessions produce no pull-request warning. PR links and the stale/not-loaded warnings are covered by the unit tests here; Team is the first environment with real PR data and will be checked after deployment. CI attribution (run 37252852828): 46 lanes passed including every lane this diff touches. The only real failures were |
openclaw#165189) Plugin session facts derive run state from the live run registry (hasActiveRun, queued) instead of the persisted status, which a cut-short restart can leave at running. Pull-request facts come from the PR owner's bounded one-shot reads for PR-eligible sessions (worktree or repository workspace), carry url and a bounded title, and report rate limiting; the Sessions board keeps last-known PR lists while reads are unavailable and backs off retries from 60 s to 15 min, with warnings that say stale versus not loaded. Cards link up to four pull requests by state priority with a +N overflow. Last-message previews are projected to plain text through the shared Markdown stripper before redaction and truncation.

What Problem This Solves
Sessions boards could show idle sessions as Working, lose In review/Merged placement when PR facts were unavailable, render PR numbers without links, and expose raw Markdown in last-message preview facts.
Read-only Team evidence supplied with the work order, from 2026-10-04 around 22:00Z: Peter's board contained 294 sessions. Eight Working rows had
status: "running"buthasActiveRun: false, with activity 6–22 hours old. Five shared the 20:28:24Z timestamp when a restart drain exhausted its budget with six agent runs. PR facts were unavailable for 240/294 sessions, all PR lists were empty, and In review/Merged counts fluctuated from 33/32 to zero while the unavailable warning persisted.Solution
Derive active run facts from live run liveness or queued inputs. Persisted
runningalone no longer overrides the live registry; terminal errors still classify as failed when no run is active.Use the Gateway PR owner's existing background one-shot loader, cache, lifetime checks, and concurrency limit. Only sessions with a worktree or repository publication target require PR facts. Admit at most eight fresh loads per facts call, prioritize cold keys over failed-key retries, and expose rate limiting plus optional URL and sanitized titles capped at 120 characters. This checkout already had owner-backed background loading; this change adds eligibility, bounded admission, and failed-snapshot retry without another cache or GitHub client.
Project
lastMessagePreviewthrough the sharedstripMarkdownowner with label-only links and HTML stripping, collapse whitespace, then apply existing redaction and the 400-character cap. Long link destinations therefore do not consume the plain-text preview budget. The Workboard docs describe the plain-text contract.Retain the last ready PR list in the existing cache during unavailable/rate-limited reads while incorporating fresh run/health facts. Preserve main's prepared snapshot owner: only identical authorized rosters, views, and session revisions share facts; a PR-only expiry refreshes due keys from that same view. Changed rosters, revisions, and age expiry keep fresh-read behavior. Existing column rules remain unchanged, with per-session retry delays from 60 seconds to 15 minutes and reset on success. Warnings count stale versus not-yet-loaded sessions, and retained facts never cross a session/lifecycle replacement.
Cards show up to four PRs in open/draft/merged/closed order, with a
+Nremainder. Available URLs become external links; otherwise refs remain text. Link clicks and drags cannot open or drag the session. Existing app-wide hovercards accept these plain links in plugin light DOM, with native title fallback. A native title button preserves keyboard session opening without nesting links inside a button.User Impact
Working reflects live activity. Temporary GitHub failures retain the last known review/merged placement, and PRs can be opened directly from cards. Last-message preview facts are plain text. The Workboard documentation describes these behaviors. No new configuration, SDK barrel exports, direct GitHub calls, or database changes.
Observer headline and assessment fields remain unchanged under their prompt's no-Markdown contract. A separately identified terminal-digest path can bypass that prompt and copy Markdown into the headline; that path remains outside this preview projection change and should be checked in the coordinator's live proof.
Why This Change Was Made
Run liveness and PR discovery already have Gateway owners. Sessions boards should consume their facts consistently, without depending on sidebar visibility or treating unavailable data as a confirmed empty list.
Evidence
tsgo:core23.39 s,tsgo:core:test821.37 s,tsgo:extensions41.66 s, andtsgo:extensions:test55.68 s. These are local wall times, not hosted CI seconds.git diff --checkpassed. SDK declaration preparation hit its default 300-second timeout twice before lint could run. The successful invocation used the existing build-only settingOPENCLAW_PLUGIN_SDK_BOUNDARY_ROOT_SHIMS_TIMEOUT_MS=900000; artifact validation remained enabled, and no source or test timeout was changed.--checkpassed (19.04 s): 151 public entrypoints / 3,652 exports / 2,113 callable exports; 366 total entrypoints / 6,946 exports. This PR adds no SDK barrels, wildcard reexports, or forbidden package subpaths.plugins:assets:checkpassed against committed bytes (15.88 s).git merge-tree --write-tree origin/main HEADpassed, producing tree44fb44da1dc2c303b8e6f7a59dc821d741475004.scoped-clean, exit 0,report_produced: true, no accepted P0/P1 findings, and no timeout. The unchanged card-link implementation was already reviewed and its combined-source rendering tests passed again.