Skip to content

refactor(ui): observe custodian history reads with Solid - #179845

Merged
steipete merged 2 commits into
mainfrom
solid2/w-s2-custodian-history
Oct 21, 2026
Merged

steipete merged 2 commits into
mainfrom
solid2/w-s2-custodian-history

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Raw imported-symbol AST census at a542f24683c324762f28404d99423df33acbc3d2. These are syntax counts, not unclassified migration debt. Column 3 counts async memo syntax; promise-returning non-async memos require manual classification.

Family Files LOC 1 handler expressions 2 cleanup 3 async memos 4 actions 5 imports 6 structured seeds 7 factories 8 contexts 9 Reveal 10 owner calls
solid 59 7858 4 10 0 0 3 0 0 0 0 3
config 22 4962 0 0 0 0 0 1 0 0 0 0
menus 46 8248 0 5 0 0 3 2 2 0 0 0
rest 135 20007 4 19 2 0 6 2 0 2 0 1
pagesA 116 25911 3 3 7 13 6 1 0 0 0 0
pagesB 200 42698 1 12 2 1 22 4 0 1 1 0
pagesC 268 54421 → 54483 4 34 1 2 43 12 → 11 20 0 0 0
app 191 31642 2 3 0 0 67 1 0 1 0 0
lib 346 54612 0 5 0 1 12 1 3 1 0 4
plugins 20 4024 0 3 0 1 13 1 0 0 0 7
api 12 2104 0 0 0 0 2 0 0 0 0 0
total 1415 256487 → 256549 18 94 12 18 177 25 → 24 25 5 1 15

What problem this solves

Custodian history uses an object-valued signal to copy its entries, disclosure, load kind, cursor and error at every request transition. The change keeps the existing synchronous admission owner and lets a history-surface async memo observe each admitted request. Loading, latest and isPending drive the existing initial skeleton and load-more feedback; a narrow Errored region handles retry feedback without replacing the expanded change cards.

The Gateway client, method-advertisement check, duplicate-request admission and stale connection-result rejection remain in their existing owner. Closing/reopening still resets the page cursor, and reconnecting still retires the old history. No new RPC, dependency, component registration, route, CSS, label or selector is introduced.

Touched-file checklist Before After Reason
1 reactive intrinsic callback expression 0 0 Handlers dispatch through current props
2 component-body cleanup 0 0 Existing settled setup/cleanup retained
3 hand-rolled history read status 1 0 Admitted promise observed under native Loading/Errored
4 mutation flow 0 0 History is a read; no action added
5 manual component loader 0 0 Existing lazy route boundary retained
6 structured local signal 1 0 Scalar disclosure and request receipt; snapshot belongs to plain owner
7 hand-written component factory 0 0 Existing JSX retained
8 throwing context wrapper 0 0 Existing context unchanged
9 independent sibling reads 0 0 Error and content slots consume the same read, so no Reveal group
10 manual Solid owner API 0 0 No roots or restored owners

The request receipt is operation identity, not an editable array/object draft. The plain owner snapshot stores accepted server results; no writable presentation mirror is added. A shared HistoryContent renders the identical initial fallback and ready chrome.

Proof

Check Result
Frozen install Passed on Solid rc.16
UI typecheck Passed with tsrs on repaired candidate
Focused unit proof 2/2 focused history regressions passed with default pinned Bun and one worker (56.49 s): delayed pagination retains expanded card identity through failure/retry; replacement connection clears accepted history.
Scoped lint/format/whitespace Typed UI lint, formatting and whitespace passed
Production Knip Final repaired head passed, zero findings (26m 35.4s)
Independent P0–P2 review Scoped clean; final source integrity verified
Same-machine base/head build and enforcing performance Passed; no violations. Startup 325,306 → 325,288 B (−18 B); CSS 40,780 B / 1 request unchanged.
Full PR selection ci:full present from creation

The focused new history-file boundary case holds the initial read, double-clicks load more to prove one admitted request, retains the same expanded change card through failed pagination, then retries with a reset cursor. Existing tests cover pagination/reset and late results after Gateway replacement. No implementation-shaped test seam is added.

Markup, CSS, text and visible states are retained, so this internal rendering/state change introduces no visual design delta. No screenshots or live-data proof are claimed.

Production LOC: 396 → 458 (+62) across the page and history renderer. The extra lines are native readiness/error boundaries plus shared fallback/ready rendering. The list stays mounted while skeleton feedback changes, and semantic entry keys retain expanded-card DOM through pagination failures. The existing page suite is unchanged; the new focused file avoids growing it beyond its 1,000-line lint limit. The exact same-machine comparison reduces every measured boot JS surface: startup −18 B, Chat 1,441,865 → 1,441,777 B (−88 B), and New Session 1,019,633 → 1,019,596 B (−37 B). The base exceeds the current startup cap; this head satisfies the no-growth rule. No budget/baseline changes. No external test lease.

CI repair: the original head exposed a real retained-card regression in custodian change history > retains expanded change cards through a failed delayed read and retries. The loading branch replaced the containing list before pagination settled. The repair keeps that list mounted, preserves the original identity assertions, and adds connection-replacement coverage. The repaired candidate passes 2/2 focused tests, UI tsrs, formatting, independent P0–P2 review with source integrity verified, and the final same-machine build/strict comparison. Typed UI lint passed after selecting the canonical UI configuration; earlier broad-config SDK declaration preparation timed out before source diagnostics. Final-head production Knip passed with zero findings.

Repaired-head CI 39674956904 completed with all UI unit jobs passing and one E2E failure: Chat boot render storm > prewarms session actions after a busy cold load without building unrelated menus or losing the draft. The same case fails on the independent Chrome-store PR. It passes on latest scheduled main 39671240295; no inherited classification is claimed. A shared exact-604a2923292bd985e2f7ccdc19fea9360aed8bc2 base diagnostic passed this case locally (1/1, 363.11 s overall; Playwright Node configuration). Current-head reproduction and overlay-state diagnosis remain open, so this is not inherited-failure landing evidence.

Current CI attribution: the exact failing case Chat boot render storm > prewarms session actions after a busy cold load without building unrelated menus or losing the draft also fails on the latest completed scheduled main run 39679539559, waiting for the stale Message permissions heading at line 233. This supersedes the earlier scheduled-main observation that passed that case. No other non-aggregate job fails on this PR; security-fast passes. The native inherited-failure route records the failed CI result, actual tested merge, unchanged failing test source, matching name/assertion, and scoped passing proof.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T21:11:17.425548Z 4115df9 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR replaces Custodian history’s presentation signal with an owner-backed asynchronous Solid read and loading/error boundaries.

Example: Expand Changed paths for gateway.port, then click Load more while the next page is delayed.

  • Before: The existing card remains mounted with its details expanded.
  • After: The reviewed candidate replaces the card and collapses its details, contrary to its intended preservation behavior.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The direction and owner placement are supported, but the focused candidate test demonstrates a user-visible retention regression.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored internal refactor is outside the ordinary contributor proof gate; the supplied mounted-page CI evidence exposes a rendering defect rather than demonstrating successful preservation.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Users must retain expanded change details while loading additional history or recovering from a failed read.
Reason: The maintainer-authored direction adopts the repository’s native Solid read pattern while retaining the established Gateway request owner.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this maintainer-authored refactor open; exact-head CI confirms that pagination replaces expanded history cards and loses their disclosure state.

Priority: P2
Reviewed head: 68a99cdec25a326b9613c7e1bf3f533fd146f0ad

Before merge

  • Preserve mounted history cards when pagination starts (P2) - After the initial page resolves, expand a card’s Changed paths disclosure and start a delayed Load more request. The new content rendering path replaces the existing article and loses the details element’s open state before that request settles. Exact-head checks-ui (2/3) demonstrates this at custodian-history.test.ts:67, with the replacement article missing open. Keep the card subtree stable across receipt changes and update readiness/error feedback around it; retain the new identity assertion.

Findings

  • [P2] Preserve mounted history cards when pagination starts — ui/src/pages/custodian/custodian-history.tsx:166-169

Tests

  • Missing end-to-end proof: Successful browser coverage of delayed pagination, failed-read retry, retained disclosure state, and connection replacement is not supplied.
Agent review details

How this fits together

The Custodian page admits paginated openclaw.changes.list requests through the current Gateway client, rejects stale results, and renders accepted change records in the Control UI.

flowchart TD
  A[History controls] --> B[Synchronous request owner]
  B --> C[Gateway changes RPC]
  C --> D[Accepted history snapshot]
  D --> E[Solid receipt memo]
  E --> F[Loading and error boundaries]
  F --> G[Change cards]
Loading

Technical review

Best possible solution:

Keep one stable history-card subtree while the existing request owner and Solid readiness slots update pagination and retry feedback.

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

Exact-head CI exercises the mounted Custodian page with a delayed pagination response and records card replacement at the new test’s identity assertion; no local execution or current-main failure is claimed.

Is this the best way to solve the issue?

Observing admitted receipts follows the repository’s Solid recipe, but the content boundary must preserve existing card identity before this is a behavior-preserving refactor.

Full review comments:

  • [P2] Preserve mounted history cards when pagination starts — ui/src/pages/custodian/custodian-history.tsx:166-169
    After the initial page resolves, expand a card’s Changed paths disclosure and start a delayed Load more request. The new content rendering path replaces the existing article and loses the details element’s open state before that request settles. Exact-head checks-ui (2/3) demonstrates this at custodian-history.test.ts:67, with the replacement article missing open. Keep the card subtree stable across receipt changes and update readiness/error feedback around it; retain the new identity assertion.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 604a2923292b.

Provenance checked

  • Connection-scoped request admission and completion keeps the original intent (0cdbdc8: Derive history lifetime from the connection while preserving synchronous admission and live completion authority.)
  • History cards and pagination presentation keeps the original intent (6fcd048: Port the existing Custodian page to Solid while preserving rendered structure, selectors, domain ownership, and behavior.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/pages/custodian/custodian-history.test.ts src/pages/custodian/custodian-page.test.ts --maxWorkers=1
  • git diff --check
  • Verify expanded-card identity through pending pagination, failure, and retry, plus existing reconnect and cursor-reset coverage.

What I checked:

PR surface

Source +69, Tests +86. Total +155 across 3 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 2 133 64 +69
Tests 1 86 0 +86
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 219 64 +155

Review metrics

Metric Value Why it matters
Production versus test growth Production +69 lines; tests +86 lines Native readiness/error boundaries and shared content account for the production growth; the focused test protects a distinct disclosure-retention contract and currently exposes its failure.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The candidate introduces a bounded history-view regression that loses expanded disclosure state during pagination.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 21, 2026, 4:22 PM ET / 20:22 UTC.

@steipete
steipete merged commit 4015c3d into main Oct 21, 2026
115 of 123 checks passed
@steipete
steipete deleted the solid2/w-s2-custodian-history branch October 21, 2026 23:00
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

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 ci:full Keep ordinary native-locale CI selection on the next PR run. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant