Skip to content

refactor: deslop UI chat and agents runner (wave-5 bundle B) - #173015

Merged
steipete merged 6 commits into
mainfrom
deslop/bundle-w5b-chat-agents-20261015
Oct 15, 2026
Merged

steipete merged 6 commits into
mainfrom
deslop/bundle-w5b-chat-agents-20261015

Conversation

@steipete

@steipete steipete commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Removes redundant internal work and obsolete adapters in UI chat and agent runner paths without retiring active features.

User Impact

No intended user-visible change. Rendering is identical: markup, styles, labels, and both shipping Lit and Solid renderers remain. No migration or operator action is needed. Protected Phase E session-memory machinery stays intact; no changelog change.

Why This Change Was Made

Two disjoint source lanes are bundled on fresh main:

  • y01 — UI chat: consolidate composer capability loading and Lit/Solid mounting, remove obsolete component adapters and duplicate projections/copies, and reuse existing Talk audio/media owners. Credit: deslop/y01-ui-chat-20261015 at 0a75f7c5cee (three commits).
  • y08 — agents runner: consolidate lifecycle-hook capture, native binding policy loops, session metadata persistence and diagnostics; remove duplicate normalization and single-caller wrappers. Credit: deslop/y08-agents-runner-20261015 at 406c44590b4 (two commits).

Combined production delta: 492 added / 925 deleted = 433 net lines removed (y01: 296; y08: 137). Including tests/support: 733 added / 1,180 deleted = 447 net lines removed, 64 files. All five source commits were cherry-picked, then rebased onto 33488188fcab94359d61e6b96b11b6ac0b91ddee for main's native-composer cutover. Main's composer session-controls and interop tests were retained exactly, along with its deletion of the superseded composer-controls adapter.

Accepted best-effort tradeoffs: late observer callbacks may resample current layout; hypothetical synchronous retirement may lose focus restoration; overlapping pagination may briefly lag pending-input disposition; two tabs may redundantly prefetch one read-only target. The UI trusts canonical Gateway PR identity and settings-normalized internal layouts. Composer snapshots rely on the existing replacement-based editing contract rather than defending against future in-place mutations. Talk trusts already-decoded JSON frames, the current bundled Gateway close-disposition contract, and the browser socket's configured strings/ArrayBuffers; impossible cyclic/BigInt relay frames throw and unsupported synthetic Google frame representations are ignored. Reusing a context-engine object during active disposal may fail normally. Fresh primitive diagnostics and internal delivery-evidence snapshots are not copied again; listener egress and attachment-time isolation remain. Connection/request ownership, durable draft/outbox boundaries, resource bounds, live security authority, and shutdown settlement stay.

Evidence

Source-ledger proof: y01 UI production/chat-test types, scoped lint, 422 distinct focused cases, runtime/static cycles, and production/fixture reviews passed. Its last suppression scan exposed inherited inventory drift in untouched files. y08 production/affected test types, lint/format/cycles, stage timing 7/7, suppressions 3/3, maintenance resources 6/6, CLI spawn 40/40, and restart recovery 33/33 passed. Several y08 broad runtime selections were interrupted or timed out during preparation and remain incomplete, not passing or attributed to main.

Initial bundle proof passed UI/core types, formatting, diff checks, runtime/static cycles (zero), and scoped type-aware lint (zero errors, nine existing Solid warnings). After the native-composer conflict repair, isolated focused tests passed: composer interop 3/3, session controls 15/15, Stop 27/27, and extracted delivery evidence 1/1 (all four assertions retained). Repaired-head UI/core types, supplemental test lint/format, assertion-safety ratchet (2,693 files / 6,295 assertions), line-cap ratchet, runtime cycles (zero), and full static/Madge cycles (zero) all passed.

Exact-head PR CI passed: run 38722942894 at 6226f076f201202cb86037c241aa85403e66ba0d, including all three UI shards, agent/runtime selections, production/test types, lint, baseline ratchets, architecture, security-fast, and openclaw/ci-gate. No rerun or inherited-CI admin exception was used.

Lint-suppressions: 2 passed / 1 failed on the remaining extensions/oc-path/src/oc-path/emit.ts|oxc/no-map-spread|1 inventory drift. Both that file and the suppression test match pinned main byte-for-byte; this bundle changes neither. This is an unresolved inherited local failure, not a passing replay.

Initial CI run 38717729771 failed its three UI shards and baseline-ratchets job. The UI failures reproduced through Stop on the old head (17 failures, 10 passes): sparse shared fixture state lacked stream maps after removal of optional-state guards. Exact-main replay could not reach assertions because of dependency/workspace setup failures. Under the requested inconclusive-replay rule, the entire related stream-state cleanup cluster was withdrawn to main instead of broadening fixture contracts; Stop then passed 27/27. The assertion ratchet reproduced delivery-evidence.ts: 0 < 2, while exact-main ratchet passed; the stale allowance was removed, shrink-only. Its primitive/frozen-error test moved intact out of the oversized spawn suite into its own focused file. No CI reruns were requested. PR CI is the broad proof for the repaired head; changed-path failures are replayed individually at head/main in isolated HOME/OpenClaw/XDG state, and inconclusive paths are withdrawn.

Fresh isolated Keychain-backed P0–P2 review completed, including final source verification. It reported two P2 findings; both were checked against the owners and declined, not silently treated as a clean reviewer verdict. Waiter cleanup already belongs to both real producers: active-run-projections.ts:92–105 removes registration, clears the timer and removes the abort listener in finish; runs.ts:464–479 performs registration/listener cleanup in close/settle. Notification calls those exact resolvers; only their duplicate cleanup was removed. The older-Gateway close-disposition finding contradicts ui/AGENTS.md's same-version UI/Gateway contract and the explicitly accepted unsupported-skew tradeoff. No accepted actionable finding remains; no review rerun was requested to obtain a different verdict.

A fresh review of the substantive repaired candidate completed through the same isolated Keychain route, including final source verification: scoped-clean, no actionable P0–P2 findings.

@clawsweeper

clawsweeper Bot commented Oct 15, 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 app: web-ui App: web-ui agents Agent runtime and tooling size: XL labels Oct 15, 2026
@steipete
steipete marked this pull request as ready for review October 15, 2026 10:05
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 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-15T10:54:05.968650Z 6226f07 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.

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 6226f076f201202cb86037c241aa85403e66ba0d
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/harness/native-session/binding-authority.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@clawsweeper

clawsweeper Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR consolidates chat rendering, Talk media handling, and agent-runner lifecycle plumbing while removing redundant internal work.

Example: A session needs both a refreshed skills snapshot and an interaction timestamp.

  • Before: Preparation persists the metadata in two separate updates.
  • After: Preparation combines the metadata through the existing session writer.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful, owner-directed simplification with focused harness evidence, but the fixture migration and required line-cap checks are incomplete.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; source inspection preserves the authority predicates, serialized draft shapes, settings normalization, and existing session writer, establishing a no-migration case.
Patch quality 🦪 silver shellfish (2/6) 3 actionable review findings remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No user-visible behavior change is intended; redundant internal ownership increases maintenance cost.
Reason: The maintainer directs the simplification and explicitly accepts its bounded tradeoffs; the remaining runner cleanup is distinct from the landed composer work.

Merge readiness

⛔ Needs changes before merge - 4 items remain

Keep open: this maintainer-directed cleanup retains useful runner work, but an incomplete fixture cutover and two diff-caused line-limit failures block merge.

Priority: P3
Reviewed head: 5ab4ede42dc735918141ee2a63c4c0411802987f

Before merge

  • Initialize the shared pane fixture for unconditional stream resets (P2) - Removing the optional-state guard requires every caller to supply the full tool-stream state. createTestChatPane in chat-pane.test-support.ts still omits toolStreamById, toolStreamOrder, and chatStreamSegments. Disconnect and session-replacement paths now throw at resetToolStream instead of exercising their assertions, as the pinned-head UI check annotations show across all three shards. Initialize the shared fixture with the canonical fields; production chat-state-page already supplies them.
  • Move gateway fixture coverage into a coherent sibling suite (P2) - These four fixture fields increase this already-grandfathered file from 1760 to 1764 counted lines. The required line-cap ratchet rejects that growth, and its CI annotation points directly to this file. Split a coherent test section while preserving coverage rather than raising the allowance.
  • Extract delivery-evidence tests from the oversized spawn suite (P2) - The additional declaration increases this grandfathered suite from 1525 to 1526 counted lines, producing a required line-cap failure. Delivery-evidence coverage can move to its own focused suite without weakening the frozen-error assertion or expanding the baseline.
  • Complete next step - Resolve GitHub's reported merge conflict while preserving main's native composer and shared-content implementation.

Findings

  • [P2] Initialize the shared pane fixture for unconditional stream resets — ui/src/pages/chat/run-lifecycle.ts:521-524
  • [P2] Move gateway fixture coverage into a coherent sibling suite — ui/src/pages/chat/chat-gateway.test.ts:99-102
  • [P2] Extract delivery-evidence tests from the oversized spawn suite — src/agents/cli-runner.spawn.test.ts:1497-1498

Provenance

  • CLI delivery evidence: original intent not found (0ea0807: History identifies delivery-evidence preservation, but git show could not read the historical object; current attachment-time snapshotting remains visible.)

Tests

  • Missing end-to-end proof: The supplied evidence records focused tests and static checks, without a shipped-entry-point run of this bundle.
Agent review details

How this fits together

Control UI chat owners translate Gateway events and user input into rendered conversations and persisted drafts; agent-runner owners prepare sessions, enforce lifecycle authority, and settle runs.

flowchart LR
  A[User input] --> B[Chat owners]
  B --> C[Lit and Solid rendering]
  B --> D[Gateway]
  D --> E[Agent runner]
  E --> F[Harness lifecycle]
  E --> G[Session writer]
Loading

Technical review

Best possible solution:

Preserve the existing production owners and accepted tradeoffs while completing the fixture migration and retaining main's newer composer cutover.

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

Pinned-head CI traces and the shared fixture show the undefined-map failure directly; no target code was executed during this read-only review.

Is this the best way to solve the issue?

Consolidating existing owners is appropriate, but every fixture using the strengthened state contract must migrate with its callers.

Full review comments:

  • [P2] Initialize the shared pane fixture for unconditional stream resets — ui/src/pages/chat/run-lifecycle.ts:521-524
    Removing the optional-state guard requires every caller to supply the full tool-stream state. createTestChatPane in chat-pane.test-support.ts still omits toolStreamById, toolStreamOrder, and chatStreamSegments. Disconnect and session-replacement paths now throw at resetToolStream instead of exercising their assertions, as the pinned-head UI check annotations show across all three shards. Initialize the shared fixture with the canonical fields; production chat-state-page already supplies them.
    Confidence: 1
  • [P2] Move gateway fixture coverage into a coherent sibling suite — ui/src/pages/chat/chat-gateway.test.ts:99-102
    These four fixture fields increase this already-grandfathered file from 1760 to 1764 counted lines. The required line-cap ratchet rejects that growth, and its CI annotation points directly to this file. Split a coherent test section while preserving coverage rather than raising the allowance.
    Confidence: 1
  • [P2] Extract delivery-evidence tests from the oversized spawn suite — src/agents/cli-runner.spawn.test.ts:1497-1498
    The additional declaration increases this grandfathered suite from 1525 to 1526 counted lines, producing a required line-cap failure. Delivery-evidence coverage can move to its own focused suite without weakening the frozen-error assertion or expanding the baseline.
    Confidence: 1

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

Provenance checked

  • Native binding policy and lifecycle capture keeps the original intent (03440e1: Prepare lineage outside the Gateway thread while preserving current authority after awaits; the extraction retains the final checks.)
  • Descendant cancellation keeps the original intent (d4820c4: Cancel owned native descendants and retain settlement results; hook capture is shared without removing the existing caller assertions.)
  • Composer rendering keeps the original intent (07384e0: Port the composer to Solid while preserving native input identity and field-level equality; this PR reuses the shared interop owner.)
  • Talk close disposition changes intended behavior with a stated reason (6b27489: Preserve accepted work on Talk failures with older-Gateway capability fallback; the PR explicitly replaces that fallback under the repository's same-version contract.)
  • Cross-tab prefetch and disposal bookkeeping changes intended behavior with a stated reason (0e7f8c9: Coordinate background history warming across tabs; navigation-intent prefetch now accepts redundant read-only warming, and the body separately records the disposal-reuse tradeoff.)
  • Session metadata persistence keeps the original intent (ccadf6a: Consolidate session operations through existing owners; the combined update still uses the writer's current-entry merge and session-identity check.)
  • Transcript row observation keeps the original intent (b705895: Keep messages anchored while registering and pruning measured rows; the refactor retains deferred observation and current-row checks.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/pages/chat/chat-pane-stop.test.ts src/pages/chat/chat-pane-connection-lifecycle.test.ts src/pages/chat/chat-pane-retained-presentation.test.ts
  • pnpm --dir ui test src/pages/chat/chat-gateway.test.ts
  • pnpm test src/agents/cli-runner.spawn.test.ts
  • pnpm check:line-cap-ratchet
  • git diff --check

What I checked:

PR surface

PR surface statistics unavailable: the file list is incomplete.

Labels

Label changes:

  • add P3: This is internal cleanup with validation and integration blockers; the observed crashes originate in incomplete test fixtures rather than production initialization.
  • 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:

  • P3: This is internal cleanup with validation and integration blockers; the observed crashes originate in incomplete test fixtures rather than production initialization.
  • 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 15, 2026, 6:22 AM ET / 10:22 UTC.

Keep both live rendering routes and the existing DOM, text, persisted shapes,
security boundaries, draft durability, and ordinary session concurrency.
Consolidate effective-tool loading, header registration, transcript refs,
history target capture, and PCM output ownership. Remove unused adapters
after their completed native-control cutovers and redundant internal work.

Best-effort tradeoffs accepted:
- Pending-page/live-update overlap: #145240 records synthetic request-order
  proof, not a cited human incident. Displayed disposition can briefly lag
  until the next ordinary refresh; durable receipts remain authoritative.
- Synchronous rail self-retirement: #153245 records a synthetic benchmark,
  not a cited human incident. Focus restoration is best effort in that case.
- Obsolete intersection callbacks: #142227 records synthetic E2E proof, not
  a cited stale-delivery incident. Target maps ignore retired rows; a late
  callback can request redundant layout.
- Obsolete mutation callbacks: the same #142227 provenance. Native disconnect
  remains; a late delivery can resample the current scroller.
- Obsolete resize callbacks: #162617 records synthetic performance traces,
  not a cited stale-delivery incident. Native cleanup remains; a late callback
  can sample current layout.
- Wrong bundled Gateway PR identity: #148070/#147952 describe the feature,
  not a wrong-target incident. The producer constructs the exact requested
  target; a contract violation now displays its returned result.
- Cross-tab prefetch election: #125128 covered a retired five-session idle
  sweep with synthetic performance proof. Two tabs can now redundantly read
  one explicitly hover/focus-intended target; per-tab limits remain.
- Malformed internal sidebar maps: #113712 introduced feature normalization,
  not a cited incident. Settings validates load/save and all callers use that
  output; impossible malformed typed values are not repaired at every update.
Continue the y01 largest-owner, export/caller and duplicate-helper audit.
Delegate composer mounting to the canonical interop boundary while retaining
field equality, keyed renderer identity and foreground picker cleanup. Remove
test-only panel refresh methods and commit counters; exercise the actual view,
polling and committed DOM instead. Trust admitted immutable composer metadata
and the full tool-stream owner contract. Narrow sidebar traversal to its
normalized single column and simplify browser/Gateway realtime decoding.

Both shipping Lit/Solid paths and rendered markup remain unchanged. No config,
protocol, storage, dependency, security-boundary or Phase E backend changes.

Best-effort tradeoffs accepted

- Malformed internal tool-stream hosts: #158032 introduced shape probes during
  a bookkeeping refactor, not a human incident. Real owners have complete state;
  a broken internal caller now fails rather than silently skipping cleanup.
  #125197's human steering/order report still justifies the unchanged causal
  reconciliation algorithm; no report ties malformed-host probes to that bug.
- In-place mutation of admitted draft metadata: #158335 added reply persistence
  and #166682 moved the annotation copies, without a mutation incident. Actual
  editors replace records/arrays. A future in-place mutator must follow that
  contract or it may alter a pending snapshot. Durable receipts/revisions stay.
- Non-JSON relay events: #146676 added transport machinery without a human
  cyclic-frame incident. Frames already crossed JSON decoding; an impossible
  internal cycle or BigInt now throws. Activation count/byte bounds remain.
- Older Gateway close-disposition support: #171377 added a compatibility path,
  but UI/Gateway ship together and the current server advertises the field.
  Unsupported skew now rejects. Accepted-answer durability from the real human
  report #171310 and fixes #171377/#172159 remains intact.
- Blob/typed-array/arbitrary Google message representations: c399fb7
  added these alternate decoder branches without a linked human report. The
  browser WebSocket is configured as arraybuffer before listeners. Unsupported
  synthetic representations are ignored; actual strings/ArrayBuffers still
  decode, and removal of the artificial await needs no post-await stale check.
- Extra sidebar columns after normalization: #123874 flattened the flexible
  #113712 layout to one tabbed panel. A broken internal producer is no longer
  searched as a multi-column layout; persisted legacy flattening still runs.

The earlier commit records the original eight accepted best-effort scenarios.
Coverage and remaining justified owners are logged in .local/y01-ledger.md for
coordinator bundling. Combined candidate removes 416 net production lines
against 5716bb1 (tests/support excluded).
Require detach disposition when append rejection closes the relay. The UI and
Gateway ship together; the prior fallback's omitted field is no longer valid.

Close the Google socket before start settles when testing startup rejection.
Synchronous frame decoding removed the fixture's former artificial decode
microtask; waiting one turn now settles start before the close. Preserve all
error, callback, microphone, socket and timer assertions.

No production change or new best-effort tradeoff. The preceding commit records
the accepted transport assumptions and their provenance.
Share lifecycle hook capture, native policy loops and gated diagnostic content
construction. Combine initial session metadata updates through the existing
writer and reuse the persisted-input notifier. Keep delivery evidence in a
typed WeakMap without mutating or wrapping frozen error objects.

Security checks, public contracts, transcript durability, parallel tool
correlation and ordinary shutdown settlement remain. No schema, configuration,
dependency, protocol or public SDK signature changes. The standalone session
memory backend and its lifecycle machinery are untouched.

Best-effort tradeoffs accepted:
- Reusing the same engine during active disposal no longer has a WeakRef
  tombstone rejection. #168789 cites synthetic #143426/#143592 disposal cases,
  not a human production report. Misuse may fail in the engine normally;
  closing admission and actual resource settlement remain.
- Fresh bounded primitive diagnostics are not redundantly cloned before
  publication (#108304). Listener egress still isolates its payloads.
- Internal delivery-evidence readers receive the attachment-time snapshot,
  not another defensive copy (0ea0807). No human mutation report was found;
  unsupported internal mutation could affect a later reader. Confirmed-send
  suppression and attachment-time copying remain.

Lane y08: 105 net production lines removed (165 added / 270 removed), excluding
tests; tests add 67 net lines. Below-500 branch-only handoff for coordinator
bundling after recent, older and largest-owner audits found no further sound
candidate. No PR or hosted-CI success is claimed.

Proof: production and affected test types, changed-file lint/format, runtime
and madge cycles (zero), lint-suppressions (3/3), and independent P2 review
passed. Maintenance resources (6/6), CLI spawn (40/40), and restart recovery
(33/33) completed. Support proof was stopped after ten minutes without an
assertion result; Gateway cancellation timed out during startup/imports with
no assertion result, and deletion was not reached. CLI reliability was only
partially exercised in an earlier interrupted selection. These are unresolved
proof gaps, not attributed main failures.
Trust canonical inline model modalities and waiter-owned cleanup. Fold the
sole-caller HTTP setup wrapper and stage warning predicate into their owners,
and remove an unused diagnostic clock option.

This pass removes 32 net production lines; the branch total is 137. Core and
affected test types, lint, format, cycle checks, stage timing and suppression
tests pass. Independent P2 review is clean. Wider focused runtime selections
remain incomplete under host load; coordinator bundling needs broad CI proof.
…hets

Retain current main stream-state contracts after the UI failure replay could not establish an exact-main comparison. Shrink the delivery-evidence assertion allowance and keep its frozen/primitive regression intact in a focused unit file.
@steipete
steipete force-pushed the deslop/bundle-w5b-chat-agents-20261015 branch from 5ab4ede to 6226f07 Compare October 15, 2026 10:49
@steipete
steipete merged commit 00b8a8e into main Oct 15, 2026
157 of 159 checks passed
@steipete
steipete deleted the deslop/bundle-w5b-chat-agents-20261015 branch October 15, 2026 11:23
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…w#173015)

* refactor(ui): consolidate chat owners and remove obsolete adapters

Keep both live rendering routes and the existing DOM, text, persisted shapes,
security boundaries, draft durability, and ordinary session concurrency.
Consolidate effective-tool loading, header registration, transcript refs,
history target capture, and PCM output ownership. Remove unused adapters
after their completed native-control cutovers and redundant internal work.

Best-effort tradeoffs accepted:
- Pending-page/live-update overlap: openclaw#145240 records synthetic request-order
  proof, not a cited human incident. Displayed disposition can briefly lag
  until the next ordinary refresh; durable receipts remain authoritative.
- Synchronous rail self-retirement: openclaw#153245 records a synthetic benchmark,
  not a cited human incident. Focus restoration is best effort in that case.
- Obsolete intersection callbacks: openclaw#142227 records synthetic E2E proof, not
  a cited stale-delivery incident. Target maps ignore retired rows; a late
  callback can request redundant layout.
- Obsolete mutation callbacks: the same openclaw#142227 provenance. Native disconnect
  remains; a late delivery can resample the current scroller.
- Obsolete resize callbacks: openclaw#162617 records synthetic performance traces,
  not a cited stale-delivery incident. Native cleanup remains; a late callback
  can sample current layout.
- Wrong bundled Gateway PR identity: openclaw#148070/openclaw#147952 describe the feature,
  not a wrong-target incident. The producer constructs the exact requested
  target; a contract violation now displays its returned result.
- Cross-tab prefetch election: openclaw#125128 covered a retired five-session idle
  sweep with synthetic performance proof. Two tabs can now redundantly read
  one explicitly hover/focus-intended target; per-tab limits remain.
- Malformed internal sidebar maps: openclaw#113712 introduced feature normalization,
  not a cited incident. Settings validates load/save and all callers use that
  output; impossible malformed typed values are not repaired at every update.

* refactor(ui): consolidate chat lifecycle and internal state paths

Continue the y01 largest-owner, export/caller and duplicate-helper audit.
Delegate composer mounting to the canonical interop boundary while retaining
field equality, keyed renderer identity and foreground picker cleanup. Remove
test-only panel refresh methods and commit counters; exercise the actual view,
polling and committed DOM instead. Trust admitted immutable composer metadata
and the full tool-stream owner contract. Narrow sidebar traversal to its
normalized single column and simplify browser/Gateway realtime decoding.

Both shipping Lit/Solid paths and rendered markup remain unchanged. No config,
protocol, storage, dependency, security-boundary or Phase E backend changes.

Best-effort tradeoffs accepted

- Malformed internal tool-stream hosts: openclaw#158032 introduced shape probes during
  a bookkeeping refactor, not a human incident. Real owners have complete state;
  a broken internal caller now fails rather than silently skipping cleanup.
  openclaw#125197's human steering/order report still justifies the unchanged causal
  reconciliation algorithm; no report ties malformed-host probes to that bug.
- In-place mutation of admitted draft metadata: openclaw#158335 added reply persistence
  and openclaw#166682 moved the annotation copies, without a mutation incident. Actual
  editors replace records/arrays. A future in-place mutator must follow that
  contract or it may alter a pending snapshot. Durable receipts/revisions stay.
- Non-JSON relay events: openclaw#146676 added transport machinery without a human
  cyclic-frame incident. Frames already crossed JSON decoding; an impossible
  internal cycle or BigInt now throws. Activation count/byte bounds remain.
- Older Gateway close-disposition support: openclaw#171377 added a compatibility path,
  but UI/Gateway ship together and the current server advertises the field.
  Unsupported skew now rejects. Accepted-answer durability from the real human
  report openclaw#171310 and fixes openclaw#171377/openclaw#172159 remains intact.
- Blob/typed-array/arbitrary Google message representations: 2a4c20f
  added these alternate decoder branches without a linked human report. The
  browser WebSocket is configured as arraybuffer before listeners. Unsupported
  synthetic representations are ignored; actual strings/ArrayBuffers still
  decode, and removal of the artificial await needs no post-await stale check.
- Extra sidebar columns after normalization: openclaw#123874 flattened the flexible
  openclaw#113712 layout to one tabbed panel. A broken internal producer is no longer
  searched as a multi-column layout; persisted legacy flattening still runs.

The earlier commit records the original eight accepted best-effort scenarios.
Coverage and remaining justified owners are logged in .local/y01-ledger.md for
coordinator bundling. Combined candidate removes 416 net production lines
against 7f7310a (tests/support excluded).

* test(ui): align talk fixtures with transport contracts

Require detach disposition when append rejection closes the relay. The UI and
Gateway ship together; the prior fallback's omitted field is no longer valid.

Close the Google socket before start settles when testing startup rejection.
Synchronous frame decoding removed the fixture's former artificial decode
microtask; waiting one turn now settles start before the close. Preserve all
error, callback, microphone, socket and timer assertions.

No production change or new best-effort tradeoff. The preceding commit records
the accepted transport assumptions and their provenance.

* refactor(agents): consolidate runner lifecycle plumbing

Share lifecycle hook capture, native policy loops and gated diagnostic content
construction. Combine initial session metadata updates through the existing
writer and reuse the persisted-input notifier. Keep delivery evidence in a
typed WeakMap without mutating or wrapping frozen error objects.

Security checks, public contracts, transcript durability, parallel tool
correlation and ordinary shutdown settlement remain. No schema, configuration,
dependency, protocol or public SDK signature changes. The standalone session
memory backend and its lifecycle machinery are untouched.

Best-effort tradeoffs accepted:
- Reusing the same engine during active disposal no longer has a WeakRef
  tombstone rejection. openclaw#168789 cites synthetic openclaw#143426/openclaw#143592 disposal cases,
  not a human production report. Misuse may fail in the engine normally;
  closing admission and actual resource settlement remain.
- Fresh bounded primitive diagnostics are not redundantly cloned before
  publication (openclaw#108304). Listener egress still isolates its payloads.
- Internal delivery-evidence readers receive the attachment-time snapshot,
  not another defensive copy (8c995fb). No human mutation report was found;
  unsupported internal mutation could affect a later reader. Confirmed-send
  suppression and attachment-time copying remain.

Lane y08: 105 net production lines removed (165 added / 270 removed), excluding
tests; tests add 67 net lines. Below-500 branch-only handoff for coordinator
bundling after recent, older and largest-owner audits found no further sound
candidate. No PR or hosted-CI success is claimed.

Proof: production and affected test types, changed-file lint/format, runtime
and madge cycles (zero), lint-suppressions (3/3), and independent P2 review
passed. Maintenance resources (6/6), CLI spawn (40/40), and restart recovery
(33/33) completed. Support proof was stopped after ten minutes without an
assertion result; Gateway cancellation timed out during startup/imports with
no assertion result, and deletion was not reached. CLI reliability was only
partially exercised in an earlier interrupted selection. These are unresolved
proof gaps, not attributed main failures.

* refactor(agents): remove duplicate runner preparation work

Trust canonical inline model modalities and waiter-owned cleanup. Fold the
sole-caller HTTP setup wrapper and stage warning predicate into their owners,
and remove an unused diagnostic clock option.

This pass removes 32 net production lines; the branch total is 137. Core and
affected test types, lint, format, cycle checks, stage timing and suppression
tests pass. Independent P2 review is clean. Wider focused runtime selections
remain incomplete under host load; coordinator bundling needs broad CI proof.

* refactor: withdraw inconclusive stream cleanup and repair bundle ratchets

Retain current main stream-state contracts after the UI failure replay could not establish an exact-main comparison. Shrink the delivery-evidence assertion allowance and keep its frozen/primitive regression intact in a focused unit file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant