Skip to content

refactor(ui): finish the assistant dock rename and drop duplicate work - #134435

Merged
steipete merged 1 commit into
mainfrom
steipete/home-dock-cleanup
Aug 31, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/home-dock-cleanup

Conversation

@steipete

@steipete steipete commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up cleanup on the Home agent dock landed in #133676.

What Problem This Solves

The dock was renamed to "assistant panel" when it started hosting both Home and Ask OpenClaw, but its internals kept the old vocabulary, and the feature left two places doing the same work:

  • .cp* (custodian panel) CSS classes sat in the same stylesheet as the newer .assistant-panel-context — two spellings for one concept — and --oc-custodian-reserve-* named the layout reservation for a dock that is no longer custodian-only.
  • The "refresh Ask OpenClaw's transcript when it becomes visible" policy existed in three places (connectedCallback, willUpdate, setOpen), and the home ? homeAvailable : custodianAvailable decision in two.
  • The shell called buildHomeWorkContext() on every render and passed the result to the panel, which immediately rebuilt it from two of its fields. The panel has to rebuild — it re-derives on its own work-context and agent-selection subscriptions without waiting for a shell render — so the shell's copy was redundant scanning of sessions and agents on a hot path.
  • formatChatWorkContext's truncation table was a plain literal, so a newly added ChatWorkContext field would be silently dropped from the snapshot instead of bounded.

Why This Change Was Made

One spelling per concept, one owner per decision. The dock's classes and reservation variable are now assistant-panel*; the repeated policies collapse into refreshCustodianTranscript() and availableFor(destination); the work snapshot is derived once, by the component that subscribes to its inputs, from a narrower workPage prop; and the truncation table is satisfies Record<keyof ChatWorkContext, number>, so an unbounded new field is a compile error rather than a silent omission.

The shipped openclaw.custodian.panel.v1 localStorage key deliberately keeps its legacy name — it holds operators' saved dock size and placement, and renaming it would silently reset their layout. A comment now records that so a future cleanup does not "fix" it.

User Impact

None intended: no visual, behavioral, or persistence change. Saved dock placement and size continue to load from the existing key.

Evidence

  • Mocked Control UI verification at this head: renamed hooks all resolve (section.assistant-panel, 2 tabs, 3 icons, 1 resizer), zero stale .cp* nodes, --oc-assistant-reserve-right: 440px / --oc-assistant-reserve-bottom: 420px applied with no stale --oc-custodian-reserve-*, and .assistant-panel--bottom renders on dock switch. Both placements are visually identical to the landed version.

Right dock:

Assistant dock, right placement, after the rename

Bottom dock with the work-context snapshot expanded:

Assistant dock, bottom placement, context expanded

  • 7,273 tests pass across 412 files (ui/src/components, ui/src/app, ui/src/pages/chat).
  • node scripts/check-changed.mjs passes, including the assertion-SAFETY ratchet — the retained type assertion now cites the satisfies clause as its proof.
  • Structured autoreview (codex, local diff): scoped-clean, 0.98.

Size

Production +64/−58 (net +6); the growth is nine short comment lines recording non-obvious contracts (why the legacy storage key stays, why the dock derives its own snapshot, the truncation-table invariant). Non-comment production code is net negative. Tests +26/−16.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 31, 2026
@steipete
steipete marked this pull request as ready for review August 31, 2026 19:40
@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 31, 2026, 4:04 PM ET / 20:04 UTC.

ClawSweeper review

What this changes

The branch renames assistant-dock CSS and layout hooks, consolidates small dock helpers, and moves Home work-context construction from the application shell into the dock component.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

The prior P1 reactivity finding remains: this refactor removes the shell’s reactive work-context object but does not make the dock subscribe to session updates that change the snapshot title.

Priority: P1
Reviewed head: 579095709232481ab811d9b21447a76a0feaea4b

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The refactor is focused, but its unresolved P1 reactive-state regression blocks merge readiness.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored UI refactor is outside the external-contributor proof gate; the supplied mocked-dashboard evidence is supplemental and does not exercise the discovered session-label path.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored UI refactor is outside the external-contributor proof gate; the supplied mocked-dashboard evidence is supplemental and does not exercise the discovered session-label path.
Evidence reviewed 5 items Introduced input change: The PR replaces a freshly built work-context object with the route string alone; session-driven shell renders need not change that primitive property.
Snapshot reads session state: The work-context builder derives its title from the current session row.
Dock omits session subscription: The dock subscribes to pane-context and agent-selection updates only, then derives its snapshot from session state during render.
Findings 1 actionable finding [P1] Keep the work-context snapshot reactive
Security None None.

How this fits together

The Control UI shell tracks route and session state and renders the assistant dock. The dock creates a bounded work-context snapshot for Home chat and reserves page space through its layout controller.

flowchart LR
  Sessions[Session state] --> Shell[Application shell]
  Shell --> Dock[Assistant dock]
  Dock --> Snapshot[Work-context snapshot]
  Snapshot --> Home[Home chat]
  Dock --> Layout[Page layout reservation]
Loading

Before merge

  • Keep the work-context snapshot reactive (P1) - The Home snapshot reads context.sessions.state for its title, but the dock now listens only to pane-context and agent-selection changes. The shell still rerenders on session updates, yet it passes unchanged workPage and pageSessionKey, so the mounted Home pane can retain a previous session label. Subscribe here to context.sessions, or retain an equivalent reactive input, and cover this update path.
  • Resolve merge risk (P1) - A session-label update while the Home dock is open can leave the next captured chat context with the prior title until an unrelated pane-context or agent-selection update occurs.

Findings

  • [P1] Keep the work-context snapshot reactive — ui/src/app/app-shell-view.ts:645
Agent review details

Security

None.

PR surface

Source +6, Tests +10. Total +16 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 5 63 57 +6
Tests 1 26 16 +10
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 89 73 +16

Review metrics

Metric Value Why it matters
Production versus test delta production +6, tests +10 The small refactor’s net production growth is explanatory comments, but it lacks coverage for the changed reactive owner boundary.

Root-cause cluster

Relationship: canonical
Canonical: #134435
Summary: This PR is the canonical item for the introduced assistant-dock work-context reactivity regression.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Restore snapshot reactivity (recommended)
    Subscribe the dock to session-state updates and cover a changed work-session title before merge.
  2. Pause the cleanup
    Keep this refactor open only if the behavior change is intentionally deferred to a separately tracked repair.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Subscribe the assistant dock to session updates for work-context refreshes and add a regression test for a session-label update while it remains open.

Technical review

Best possible solution:

Subscribe the dock to session-state updates, or retain an equivalently reactive snapshot input, and add an owner-boundary regression for a work-session title update while the dock stays open.

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

Yes. Open the Home dock on a chat route, update that session’s label through the session capability, then send without a pane-context or agent-selection update.

Is this the best way to solve the issue?

No. Local derivation is reasonable only when it reacts to every input it reads; this patch drops the shell-provided session reactivity without replacing it.

Full review comments:

  • [P1] Keep the work-context snapshot reactive — ui/src/app/app-shell-view.ts:645
    The Home snapshot reads context.sessions.state for its title, but the dock now listens only to pane-context and agent-selection changes. The shell still rerenders on session updates, yet it passes unchanged workPage and pageSessionKey, so the mounted Home pane can retain a previous session label. Subscribe here to context.sessions, or retain an equivalent reactive input, and cover this update path.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 75de683dd299.

Labels

Label justifications:

  • P1: The introduced omission can silently send Home chat a stale work-session title in normal use.
  • merge-risk: 🚨 session-state: The dock serializes session metadata into the next Home message, so missed session updates can preserve stale context.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This MEMBER-authored UI refactor is outside the external-contributor proof gate; the supplied mocked-dashboard evidence is supplemental and does not exercise the discovered session-label path.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Subscribe the dock to session updates or restore a reactive snapshot input.
  • Add a focused test for changing the active work-session title while the Home dock remains open.

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 (1 earlier review cycle)
  • reviewed 2026-08-31T19:49:10.910Z sha 9c3ba1958c34ea9ecc9833c05831b80124d74d4c :: found issues before merge. :: [P1] Keep the work-context snapshot reactive

The shared dock still spoke the old custodian vocabulary: .cp* classes sat
beside .assistant-panel-context in one stylesheet, and --oc-custodian-reserve-*
named the layout reservation for a dock that now hosts both destinations.
Rename both to assistant-panel; the shipped localStorage key stays and says why.

Collapse three copies of the visible-transcript refresh policy into one guard
and the duplicated availability ternary into availableFor(). The shell built a
full work context that the panel immediately rebuilt from two of its fields;
pass the route id instead, so the snapshot is derived once by the owner that
subscribes to its inputs. Make the truncation table exhaustive with satisfies
so a new context field cannot reach the model unbounded.
@steipete
steipete force-pushed the steipete/home-dock-cleanup branch from 9c3ba19 to 5790957 Compare August 31, 2026 19:58
@steipete
steipete merged commit d8d5ef1 into main Aug 31, 2026
153 checks passed
@steipete
steipete deleted the steipete/home-dock-cleanup branch August 31, 2026 20:13
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Aug 31, 2026
Use the captured main generation-scope contract in lifecycle and
source/compiled provider-owner fixtures. Remove its retired config input
while preserving provider selection and empty-generation fencing.

Integrate captured main 10564e2 with the Home context refinement from
PR #134059 and the assistant dock cleanup from PR #134435. Preserve the
existing contributor credit and canonical catalog owner already on main.

The integrated candidate passes the normal full build, scoped checks,
679 original-order model cases, 400 backend owner cases, both catalog
E2Es, 290 UI cases and 18 browser cases. Final grouped startup gzip is
347299 B under the unchanged 347353 B enforcement limit.
steipete added a commit that referenced this pull request Aug 31, 2026
* chore(deps): refresh eligible seven-day npm dependencies

* docs(plugins): align embedded TypeBox dependency pins

* test(deps): align evidence and Escape ownership

* fix(ci): repair native PID imports and cancellation assertions

* test(ui): make effort Escape ownership explicit

* fix(agents): keep error presentation on prepared policy

* fix(agents): preserve loaded provider policy in error presentation

* fix(agents): carry prepared provider owners into lifecycle errors

Preserve endpoint-owned recovery guidance for custom provider routes in terminal events and callbacks. Reuse the prepared model handle and full-signal classifier, with a real Agent/AgentSession boundary regression.

* fix(agents): reconcile explicit diagnostic ownership and structured errors

Keep presentation on explicit prepared owners, preserve full assistant error facts ahead of generic request wrappers, and retain raw-schema diagnostics. Carry prepared owners into terminal observations and prove source/compiled scope boundaries. Complete the shared attempt fixture with the real model-handle getter.

* fix(agents): carry full classified facts into safe failure copy

Share explicit-owner assistant classification between direct formatting and the user-facing wrapper. Preserve structured codes, types and body evidence in safe provider/model/status copy, including message-less failures, while retaining raw-schema diagnostics and ownerless policy boundaries.

* fix(ui): keep Home work context lazy and current

Let the existing deferred assistant panel prepare page work context once,
using the shell's validated route facts. Keep explicit agent ownership
through global/main aliases and refresh the quoted reference when session,
agent or Gateway snapshots change.

Reuse the frozen refinement from PR #134059:
6e2a8f9550e6e6da957b0352fa674024f198118e.
Add source-bound roster-refresh/send proof, extend the existing owner
fixture for snapshot updates and cleanup, and regenerate the boot manifest
for the pinned dependency graph. Startup gzip is 347243 B under the
unchanged 347353 B gate. The UI repair removes two production lines net.

* test(agents): align generation fixtures with prepared metadata

Use the captured main generation-scope contract in lifecycle and
source/compiled provider-owner fixtures. Remove its retired config input
while preserving provider selection and empty-generation fencing.

Integrate captured main 10564e2 with the Home context refinement from
PR #134059 and the assistant dock cleanup from PR #134435. Preserve the
existing contributor credit and canonical catalog owner already on main.

The integrated candidate passes the normal full build, scoped checks,
679 original-order model cases, 400 backend owner cases, both catalog
E2Es, 290 UI cases and 18 browser cases. Final grouped startup gzip is
347299 B under the unchanged 347353 B enforcement limit.

* refactor(ui): keep submission projection in lazy chat owner

Keep the app store responsible for bounded retained bytes and client lifetime.
Move receipt adaptation and display retirement into the existing history
projection owner, shared by both lazy chat consumers. Preserve missing-store
behavior and the retained-prompt, attachment and reconnect contracts.

Continue the retained-submission owner from PR #134059
(0f3e17e).

Validation: 808 owner tests, 21 Chromium cases, grouped-bundle Home and
retired-prompt proof, changed checks and fresh full-candidate autoreview.
Startup gzip: 347588 -> 347320 bytes; unchanged limit 347353.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 1, 2026
openclaw#134435)

The shared dock still spoke the old custodian vocabulary: .cp* classes sat
beside .assistant-panel-context in one stylesheet, and --oc-custodian-reserve-*
named the layout reservation for a dock that now hosts both destinations.
Rename both to assistant-panel; the shipped localStorage key stays and says why.

Collapse three copies of the visible-transcript refresh policy into one guard
and the duplicated availability ternary into availableFor(). The shell built a
full work context that the panel immediately rebuilt from two of its fields;
pass the route id instead, so the snapshot is derived once by the owner that
subscribes to its inputs. Make the truncation table exhaustive with satisfies
so a new context field cannot reach the model unbounded.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 1, 2026
…3772)

* chore(deps): refresh eligible seven-day npm dependencies

* docs(plugins): align embedded TypeBox dependency pins

* test(deps): align evidence and Escape ownership

* fix(ci): repair native PID imports and cancellation assertions

* test(ui): make effort Escape ownership explicit

* fix(agents): keep error presentation on prepared policy

* fix(agents): preserve loaded provider policy in error presentation

* fix(agents): carry prepared provider owners into lifecycle errors

Preserve endpoint-owned recovery guidance for custom provider routes in terminal events and callbacks. Reuse the prepared model handle and full-signal classifier, with a real Agent/AgentSession boundary regression.

* fix(agents): reconcile explicit diagnostic ownership and structured errors

Keep presentation on explicit prepared owners, preserve full assistant error facts ahead of generic request wrappers, and retain raw-schema diagnostics. Carry prepared owners into terminal observations and prove source/compiled scope boundaries. Complete the shared attempt fixture with the real model-handle getter.

* fix(agents): carry full classified facts into safe failure copy

Share explicit-owner assistant classification between direct formatting and the user-facing wrapper. Preserve structured codes, types and body evidence in safe provider/model/status copy, including message-less failures, while retaining raw-schema diagnostics and ownerless policy boundaries.

* fix(ui): keep Home work context lazy and current

Let the existing deferred assistant panel prepare page work context once,
using the shell's validated route facts. Keep explicit agent ownership
through global/main aliases and refresh the quoted reference when session,
agent or Gateway snapshots change.

Reuse the frozen refinement from PR openclaw#134059:
6e2a8f9550e6e6da957b0352fa674024f198118e.
Add source-bound roster-refresh/send proof, extend the existing owner
fixture for snapshot updates and cleanup, and regenerate the boot manifest
for the pinned dependency graph. Startup gzip is 347243 B under the
unchanged 347353 B gate. The UI repair removes two production lines net.

* test(agents): align generation fixtures with prepared metadata

Use the captured main generation-scope contract in lifecycle and
source/compiled provider-owner fixtures. Remove its retired config input
while preserving provider selection and empty-generation fencing.

Integrate captured main a3310c7 with the Home context refinement from
PR openclaw#134059 and the assistant dock cleanup from PR openclaw#134435. Preserve the
existing contributor credit and canonical catalog owner already on main.

The integrated candidate passes the normal full build, scoped checks,
679 original-order model cases, 400 backend owner cases, both catalog
E2Es, 290 UI cases and 18 browser cases. Final grouped startup gzip is
347299 B under the unchanged 347353 B enforcement limit.

* refactor(ui): keep submission projection in lazy chat owner

Keep the app store responsible for bounded retained bytes and client lifetime.
Move receipt adaptation and display retirement into the existing history
projection owner, shared by both lazy chat consumers. Preserve missing-store
behavior and the retained-prompt, attachment and reconnect contracts.

Continue the retained-submission owner from PR openclaw#134059
(1ae5ba2).

Validation: 808 owner tests, 21 Chromium cases, grouped-bundle Home and
retired-prompt proof, changed checks and fresh full-candidate autoreview.
Startup gzip: 347588 -> 347320 bytes; unchanged limit 347353.
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 maintainer Maintainer-authored PR merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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