Skip to content

fix(workboard): truthful run and pull-request facts on Sessions boards - #165189

Merged
steipete merged 3 commits into
mainfrom
steipete/sessions-board-truthful-facts
Oct 5, 2026
Merged

steipete merged 3 commits into
mainfrom
steipete/sessions-board-truthful-facts

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

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" but hasActiveRun: 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 running alone 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 lastMessagePreview through the shared stripMarkdown owner 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 +N remainder. 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

  • The new facts-reader regression failed before the fix with literal link/bold/code/HTML markup. It now proves label-only links, flattened ordered lists, whitespace/HTML cleanup, and a 400-character bound applied after stripping a long link destination. Its warm test time was 256 ms. The initial preview candidate passed 63 focused tests in 130.70 s wall time.
  • Rebase integration preserves main's inlined PR reader and authorized-view/revision snapshot cache. The Gateway/PR-owner/contract/cache run passed 56 tests in 506.16 s; UI passed 14 tests, and the additional Workboard Gateway RPC suite passed 18 tests (the UI + RPC invocation took 344.06 s). Together these cover all five original focused files plus conditional-read RPC composition. Compiler-cache preparation and existing database fixtures dominate these wall times; no real sleeps or per-test Gateway boots were added. New cache tests protect per-key deadlines, concurrent retry sharing, and revision-scope renewal.
  • All four type lanes passed on the integrated candidate: tsgo:core 23.39 s, tsgo:core:test 821.37 s, tsgo:extensions 41.66 s, and tsgo:extensions:test 55.68 s. These are local wall times, not hosted CI seconds.
  • Touched-file oxfmt, core oxlint (75.10 s), extension oxlint (691.51 s), and git diff --check passed. SDK declaration preparation hit its default 300-second timeout twice before lint could run. The successful invocation used the existing build-only setting OPENCLAW_PLUGIN_SDK_BOUNDARY_ROOT_SHIMS_TIMEOUT_MS=900000; artifact validation remained enabled, and no source or test timeout was changed.
  • Deprecated API usage passed (74.44 s); Madge reported zero cycles (175.33 s); both dead-code passes passed (435.90 s).
  • SDK surface --check passed (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.
  • Rebuilt and copied the plugin bundle after integration. plugins:assets:check passed against committed bytes (15.88 s). git merge-tree --write-tree origin/main HEAD passed, producing tree 44fb44da1dc2c303b8e6f7a59dc821d741475004.
  • Fresh direct-route Codex autoreviews of the preview candidate and subsequent Gateway/cache rebase resolution both reported 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.
  • Three commits remain, with the preview code, documentation, and regression folded into the Gateway commit. Final branch delta: 13 files, +601/-69 lines; net production growth 181 lines. Growth covers bounded owner admission/retry publication, existing-snapshot retry metadata, optional fact fields, plain-text projection, and card links.
  • Hosted test CI timing is not yet available for the rewritten head. Live and visual proof is added by the coordinator. No browser automation, Team mutation, merge, or auto-merge was performed.

@clawsweeper

clawsweeper Bot commented Oct 4, 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 plugin: workboard size: L labels Oct 4, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 4, 2026
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed October 4, 2026, 9:55 PM ET / October 5, 2026, 01:55 UTC (Revision 3).

ClawSweeper review

What this changes

The 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
Reviewed head: 9857a4723c985415f83fc47d49a2e56d1bdfeed5

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) PR readiness rating was derived from proof quality, review findings, security review, and reviewer confidence.
Proof confidence 🌊 off-meta tidepool Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Evidence reviewed 7 items Current main still needs the fixes: At fetched main, the facts reader still treats persisted running status as active, passes previews through without Markdown stripping, and exposes only pull-request numbers and states. The branch changes remain behaviorally distinct from main.
Introduced owner-boundary repair: The introduced facts reader uses live liveness, limits background PR admission to eight loads per call, prioritizes cold keys, and uses the existing Markdown projection before redaction and truncation.
Scoped retention and retries: Last-ready PR retention checks session and lifecycle identity; retry-only snapshot renewal reuses facts only for the identical authorized roster and captured revision. Added regressions cover retention, replacement, per-key deadlines, concurrent readers, and recovery.
Findings None None.
Security None None.

How this fits together

Workboard’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]
Loading

Before merge

  • Complete next step (P2) - Supply the required sanitized before/after Sessions board screenshots in chat and embedded in the PR, and verify that the PR images render.
Agent review details

Security

None.

PR surface

Source +181, Tests +339, Docs +12. Total +532 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 8 223 42 +181
Tests 4 355 16 +339
Docs 1 23 11 +12
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 601 69 +532

Review metrics

Metric Value Why it matters
Production and regression growth production net +181 lines; tests net +339 lines The body explains production growth through bounded admission, retry metadata, plain-text projection, and card links; the tests protect distinct Gateway, cache, contract, and UI behavior.

Technical review

Best 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.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs misleading activity and PR placement on an optional board without evidence of an urgent core-runtime failure.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.

Evidence

What I checked:

  • Current main still needs the fixes: At fetched main, the facts reader still treats persisted running status as active, passes previews through without Markdown stripping, and exposes only pull-request numbers and states. The branch changes remain behaviorally distinct from main. (src/gateway/server-plugin-session-facts.ts:121, 12785be2ff02)
  • Introduced owner-boundary repair: The introduced facts reader uses live liveness, limits background PR admission to eight loads per call, prioritizes cold keys, and uses the existing Markdown projection before redaction and truncation. (src/gateway/server-plugin-session-facts.ts:114, 9857a4723c98)
  • Scoped retention and retries: Last-ready PR retention checks session and lifecycle identity; retry-only snapshot renewal reuses facts only for the identical authorized roster and captured revision. Added regressions cover retention, replacement, per-key deadlines, concurrent readers, and recovery. (extensions/workboard/src/sessions-board.ts:243, 9857a4723c98)
  • Previous integration blocker resolved: Raw test-merge records establish the pinned base followed by the exact PR head as parents. Its delta contains the 13 introduced paths and preserves the shared revision-aware snapshot implementation from merged perf(workboard): avoid redundant Sessions board reloads #165141. (extensions/workboard/src/sessions-board.ts:409, 57ffe902670c)
  • Security and compatibility inspection: PR URLs originate from the existing loader, which validates HTTPS and the selected GitHub host. The patch adds optional fact fields without new permissions, dependencies, SDK entrypoints, configuration, or persisted schemas; existing caller and lifecycle assertions remain in place. (src/gateway/control-ui-session-prs.ts:249, 9857a4723c98)
  • Required visual evidence outstanding: The captured body, source identity 3ad1ea4ad08b25adcf7d3c76130d3f377bb966e476ba813b6998fc1eff0c27ff, reports pre-fix Team observations and after-fix automated validation, while explicitly leaving live and visual proof to the coordinator. No downloaded media was found, and the three current comments contain no media references. Root policy requires inspected, sanitized before/after screenshots in the originating chat and embedded in the PR for rendered UI changes. (AGENTS.md, 9857a4723c98)

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 (2 earlier review cycles)
  • reviewed 2026-10-04T23:28:32.219Z sha b29c13f :: needs changes before merge. :: none
  • reviewed 2026-10-05T01:11:31.378Z sha b29c13f :: blocked before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot closed this Oct 5, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Oct 5, 2026
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Oct 5, 2026
@openclaw-barnacle openclaw-barnacle Bot closed this Oct 5, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Oct 5, 2026
@steipete
steipete force-pushed the steipete/sessions-board-truthful-facts branch from b29c13f to 9857a47 Compare October 5, 2026 01:47
@steipete
steipete merged commit 6c6f9a1 into main Oct 5, 2026
126 of 133 checks passed
@steipete
steipete deleted the steipete/sessions-board-truthful-facts branch October 5, 2026 02:15
@steipete

steipete commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

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 workboard.sessionsBoard.read while a real turn ran:

19:08:35 col=working run=active  preview="Reply with exactly this markdown…"
19:08:55 col=done    run=idle    preview="Landed PR #164963 into main as fdba2abd7eda. 1. first item 2. second item"

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.

After: rule placement from live run state and plain-text previews

CI attribution (run 37252852828): 46 lanes passed including every lane this diff touches. The only real failures were checks-ui-e2e (2/9) and (5/9) (sidebar-name-marquee.e2e.test.ts touch animation and sidebar-agent-first.e2e.test.ts geometry, "expected 68 to be 48"); this PR changes nothing under ui/. The same two shards fail on main's own hourly run 37250652894 (a2affcf, 01:14Z) after the 23:30Z hourly was green, and fixes are already in flight on sibling branches (fix/sidebar-marquee-drawer, fix/sidebar-nav-head-slot).

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. plugin: workboard rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. 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.

1 participant