Skip to content

refactor(ui): bind chat recovery and icons to Solid owners - #176375

Merged
steipete merged 4 commits into
mainfrom
solid2/w-zero-chat-reactive-owners
Oct 18, 2026
Merged

steipete merged 4 commits into
mainfrom
solid2/w-zero-chat-reactive-owners

Conversation

@steipete

@steipete steipete commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Chat recovery, provider-review notices, and plugin tool icons still carried effect-driven state and lifetime wiring after the Solid migration. Recovery and icon requests now live with their binding, provider-review presentation derives from canonical terminal receipts, and pane presentation consumes the existing owner projection.

Recovery observes the chat-run owner directly and retires only durable matching user receipts. Host/identity replacement disposes outstanding work. Tool icons retain one abortable request context per connection/session binding and release blob URLs during computation cleanup through the canonical PluginIconOwner. A terminal provider-review receipt stays visible across later row snapshots; explicit retry obtains a fresh idempotency key. Render invalidation telemetry reuses committed-generation state, preserving live visibility checks before layout callbacks.

Host tags, markup, styling, routes, and lazy boundaries are unchanged. The obsolete recovery messages bridge property is removed with its sole caller. No new dependencies or options. Main integration preserves its completed icon-owner rename; the conflict resolution changes only that import and constructor relative to the previously reviewed implementation.

Solid audit

Measured across the six touched production modules against integrated base 762a44b819ee:

Pattern Before After
Rendering controller patterns 0 0
createEffect 6 1
createRenderEffect 0 0
untrack 5 0
addEventListener 0 0
querySelector(All) 0 0
Manual class strings 0 0
flush 0 0
Owner capture 0 0
Production LOC 1,559 1,552

The sole effect is ui/src/pages/chat/solid-render-lifecycle.ts:124: committed DOM gates imperative layout work and cancellation when a retained pane parks. Effects decrease 83.3%; production decreases 7 lines. Tests add 48 lines for terminal-receipt persistence and direct owner-delivery retirement, including local-only receipt rejection.

Evidence

Current head: f663d675d8f2a74e59ff3f542799ef4df94977da. Full CI: 39172310997.

Proof Result
Focused provider-review, recovery-owner, and pane-presentation tests 28 passing
Voice transcript render-count regression file All 4 passing after the invalidation correction
Post-integration icon ownership file All 10 passing, including credential changes, retired requests, and blob cleanup
Post-integration pnpm tsgo:ui, scoped format/lint, git diff --check Passed
Independent Codex review (P0–P2), including integrated candidate No actionable findings
Production Knip on integrated candidate Exactly two inherited unused core files: src/auto-reply/reply/reply-admission-ticket.ts, src/auto-reply/reply/reply-turn-admission-owner.ts
Current-head ci:full All 3 UI unit, all 9 Control UI E2E, both real-Gateway shards, and security-fast passed
Current-head CI startup 337,259 B gzip, 7 JS requests, 1 startup CSS request; startup budget passed
Original same-host startup comparison, before main integration Exact base 6fcf1c433273: 336,506 B → head 1038712f833c: 336,520 B (+14 B), identical 1,019,449 B raw JS and 1 startup CSS request; strict checks passed

The Agents catalog-publication real-Gateway case passes on the current head. Its fixture waits for visible primary selection before beginning the independent fallback gesture; existing post-fallback primary/config/draft assertions remain, without a backend-persistence wait or timeout change. Rendered appearance and styles are unchanged, so the screenshot gate does not apply.

Only performance job 117808026313 and aggregate gate 117810753367 failed. That job's own same-host comparison proves the pre-existing chat-boot excess: base 50bb09d7ba13 is 1,490,230 B, already above the unchanged 1,490,000 B ceiling; tested merge 43964a795474 is 1,490,304 B (+74 B), with 25 → 25 requests. Startup remains within budget. The performance-checker source blobs are unchanged in the tested merge.

The authorized inherited-failure admission binds the exact failed run, checkout, ordered merge parents, performance output, complete job inventory, inspected delta, and artifact hashes. No test failure is waived, and the aggregate CI run is not claimed green.

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

clawsweeper Bot commented Oct 18, 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 18, 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-18T22:30:49.457050Z f663d67 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c732c916ed

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

setRevision(requestedGeneration);
// Invalidation samples visibility without subscribing its synchronous domain caller.
if (untrack(options.presented)) {
if (options.presented()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep presentation sampling out of caller tracking

When ChatThread evaluates its contents memo, renderRows() reaches ChatTranscriptRenderer.render(), which queues an after-commit task and calls this invalidate(). Reading options.presented() here therefore subscribes that outer render memo to the retained transcript root's presentation signal. A presentation-owner event can then rerender and reveal the transcript immediately with the previous pane snapshot, instead of waiting for the parent's next props as the presentation contract requires. Preserve the deliberate untracked sample (or move it outside the caller's reactive computation).

AGENTS.md reference: ui/AGENTS.md:L5-L5

Useful? React with 👍 / 👎.

Comment on lines +116 to +119
!previous.pending &&
!previous.refreshing &&
continuationInFlight !== current &&
refreshInFlight !== current &&

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Recheck terminal receipts after refresh settles

If reconcileMutation() publishes a matching failed/timeout/killed row before its promise settles, this derivation observes it while pending or refreshing is still true and discards it. The later setPresentation calls that clear those local flags do not change the authoritative deps.source() dependency, so the terminal receipt is not reconsidered until an unrelated source publication; the dialog can remain stuck on the disabled “Waiting” state even though the Gateway already reported failure. Re-evaluate the current row when the pending flags settle rather than requiring another roster publication.

AGENTS.md reference: ui/AGENTS.md:L16-L18

Useful? React with 👍 / 👎.

@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 18, 2026
@clawsweeper

clawsweeper Bot commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR binds chat recovery, provider-review presentation, plugin icons, and pending-session cleanup to their Solid owners.

Example: A saved queued message has sendRunId "pending-delivery".

  • Before: Delivery retirement depends on the pane refreshing the recovery element’s messages property.
  • After: The recovery element observes the chat-run owner and removes the saved entry when a matching durable user receipt arrives.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful ownership simplification with focused harness coverage, but two source-supported correctness regressions block merging.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; supplied evidence covers focused mounted-owner tests and static/build checks, without a demonstrated shipped-entry recovery scenario.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Recovery controls and artwork must retain the correct chat lifetime without stale results or unnecessary pane-wide rendering.
Reason: The maintainer-authored direction continues the established Solid migration, reuses existing domain owners, and introduces no options or public contracts.

Merge readiness

⛔ Needs changes before merge - 4 items remain

Keep this maintainer-authored PR open: the ownership refactor is useful, but two introduced reactive-dependency defects need repair before merging.

Priority: P2
Reviewed head: c732c916edcc54c474b16b6a4452076399d938b4

Before merge

  • Preserve untracked presentation sampling during invalidation (P2) - ChatThread evaluates renderRows inside its contents memo, and transcript rendering queues afterCommit work that calls invalidate. Reading options.presented() here subscribes that caller to the separate transcript root’s presentation signal. Connecting or changing presentation can therefore rerun row rendering independently of new parent props, defeating retained-pane ordering and adding a second render; exact-head UI CI reports four voice-transcript cases with two renders instead of one. Restore the deliberate untracked sample at this boundary.
  • Reconcile terminal receipts when pending work settles (P2) - If reconcileMutation publishes the attempted run’s failed, timeout, or killed row while the acknowledgment or refresh remains pending, this derivation rejects that receipt. Its tracked dependencies are binding() and deps.source(); clearing pending and refreshing through setPresentation does not publish either dependency. The matching row is therefore never reconsidered until another source update, leaving submitted true and the acknowledgment button disabled despite a known terminal failure. Reconcile the current receipt after pending work settles, and extend the existing pending-phase test without its final publishSource call.
  • Complete next step - Compare the remaining real-Gateway failures with the pinned base and attribute them before requiring any unrelated repair.
  • Explain or restore the original intent of Transcript lifecycle visibility sampling - de691c1: The lifecycle isolates retained rendering and commit ordering; later boundary comments explicitly explain sampling presentation without subscribing the caller.

Findings

  • [P2] Preserve untracked presentation sampling during invalidation — ui/src/pages/chat/solid-render-lifecycle.ts:42
  • [P2] Reconcile terminal receipts when pending work settles — ui/src/pages/chat/chat-provider-review-controller.tsx:115-119

Provenance

  • Transcript lifecycle visibility sampling changes intended behavior without addressing why it exists (de691c1: The lifecycle isolates retained rendering and commit ordering; later boundary comments explicitly explain sampling presentation without subscribing the caller.)

Tests

  • Missing end-to-end proof: Supplied tests do not demonstrate terminal settlement without an extra source publication or presentation changes without rerunning the caller’s row-render memo, and red-on-base results are not shown.
Agent review details

How this fits together

The Control UI consumes Gateway session facts and browser recovery storage, then renders retained chat panes, continuation controls, and plugin artwork while preserving synchronous mutation admission.

flowchart TD
  A[Gateway session facts] --> B[Synchronous chat owners]
  C[Browser recovery storage] --> D[Recovery owner]
  B --> D
  B --> E[Solid projections and bindings]
  D --> F[Retained chat pane]
  E --> F
  F --> G[Explicit continuation requests]
Loading

Technical review

Best possible solution:

Keep the owner-scoped refactor while restoring untracked lifecycle sampling and terminal-receipt reconciliation when continuation work settles.

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

Both failing paths can be traced through production callers without executing target code; exact-head CI also records extra transcript renders.

Is this the best way to solve the issue?

The existing owners support this refactor, but removing deliberate tracking isolation and replacing settlement-sensitive reconciliation with a source-only derivation breaks their contracts.

Full review comments:

  • [P2] Preserve untracked presentation sampling during invalidation — ui/src/pages/chat/solid-render-lifecycle.ts:42
    ChatThread evaluates renderRows inside its contents memo, and transcript rendering queues afterCommit work that calls invalidate. Reading options.presented() here subscribes that caller to the separate transcript root’s presentation signal. Connecting or changing presentation can therefore rerun row rendering independently of new parent props, defeating retained-pane ordering and adding a second render; exact-head UI CI reports four voice-transcript cases with two renders instead of one. Restore the deliberate untracked sample at this boundary.
    Confidence: 0.98
  • [P2] Reconcile terminal receipts when pending work settles — ui/src/pages/chat/chat-provider-review-controller.tsx:115-119
    If reconcileMutation publishes the attempted run’s failed, timeout, or killed row while the acknowledgment or refresh remains pending, this derivation rejects that receipt. Its tracked dependencies are binding() and deps.source(); clearing pending and refreshing through setPresentation does not publish either dependency. The matching row is therefore never reconsidered until another source update, leaving submitted true and the acknowledgment button disabled despite a known terminal failure. Reconcile the current receipt after pending work settles, and extend the existing pending-phase test without its final publishSource call.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 53395d97c193.

Provenance checked

  • Provider-review terminal settlement changes intended behavior with a stated reason (11bbb82: Canonical receipts settle failed attempts while request claims remain synchronous and pending work prevents premature retry.)
  • Recovery and icon lifetimes keeps the original intent (481c554: Mounted Solid owners retain cleanup, storage admission, lazy artwork lookup, credential retirement, and blob disposal.)
  • Pane presentation projection keeps the original intent (86abec4: Owner events park immediately while ordinary reveal waits for parent props.)
  • Pending-session projections and image custody keeps the original intent (7807f20: Views consume synchronous owners while Gateway and create events revoke image custody directly.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test ui/src/pages/chat/chat-provider-review-controller.test.ts --maxWorkers=1
  • pnpm test ui/src/pages/chat/solid-render-lifecycle.test.tsx --maxWorkers=1
  • pnpm test ui/src/pages/chat/components/chat-transcript-voice-reconciliation.test.ts --maxWorkers=1
  • pnpm test ui/src/pages/chat/chat-outbox-recovery-owner.test.ts --maxWorkers=1
  • pnpm tsgo:ui

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 481c554 adds ui/src/pages/chat/chat-tool-icon-controller.ts:18 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 481c55484f16; files: ui/src/pages/chat/chat-tool-icon-controller.ts)
  • Patrick Erichsen: Raw commit bda26b8 adds ui/src/pages/chat/chat-tool-icon-controller.ts:2 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bda26b810554; files: ui/src/pages/chat/chat-tool-icon-controller.ts)

PR surface

Source -9, Tests +47. Total +38 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 6 317 326 -9
Tests 2 56 9 +47
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 373 335 +38

Labels

Label changes:

  • add P2: The introduced defects affect retained transcript rendering and retry recovery within a limited Control UI workflow.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: The introduced defects affect retained transcript rendering and retry recovery within a limited Control UI workflow.
  • 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 18, 2026, 4:19 PM ET / 20:19 UTC.

@steipete
steipete merged commit 5e27311 into main Oct 18, 2026
99 of 104 checks passed
@steipete
steipete deleted the solid2/w-zero-chat-reactive-owners branch October 18, 2026 23:38
@steipete

Copy link
Copy Markdown
Contributor Author

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

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 19, 2026
…176375)

* refactor(ui): bind chat recovery and icons to Solid owners

* fix(ui): keep render invalidation telemetry untracked

* test(ui): settle primary selection before fallback edit
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: L 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