Skip to content

refactor: remove inert lifetime and metadata plumbing - #177294

Merged
steipete merged 2 commits into
mainfrom
deslop/z34-2-lifetime-plumbing-20261015
Oct 19, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/z34-2-lifetime-plumbing-20261015

Conversation

@steipete

@steipete steipete commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Several independent internal paths carry inert cancellation signals, duplicate cleanup or read-only publication custody beyond the owner that does the real work. The extra state makes native cancellation, FIFO admission and physical settlement harder to see.

User Impact

No features, DOM/CSS, config keys or command surfaces change. Descriptive model metadata can remain stale during catalog/config churn until refresh or restart; current execution and disclosure authority remain enforced.

Why This Change Was Made

Remove the never-aborted Team Reports collection signal tree while preserving the native runner's actual stop/deadline and admitted SQLite/LLM settlement. Remove duplicate Nextcloud staged-media cleanup, an unused injection early-release latch, inert lane/compaction controllers, and manual parent-signal relays already expressible with native composition. Discord keeps physical listener capacity/settlement without an unobserved observer deadline. WebSocket insertion uses one empty-cache check; catalog admission uses the existing FIFO permit owner.

Read-only model metadata now follows the campaign's explicit best-effort policy during catalog/config churn. Remove request retirement/transport barriers in the UI and captured config/auth/plugin identity comparisons around a rendered Gateway fallback. Keep exact request/account/session partitioning, real forced discovery, connection-clear cancellation, bounded caches, and current requester/operator/effect authority. Reuse the shared avatar Blob reader and mutate only the captured slash-command cache entry.

Net production LOC: 503 removed across 32 production files, against merge base 13d2ead after conflict-only rebase; tests, fixtures, test support, generated files and declarations excluded. No config keys, persisted shapes, protocol, dependencies or public SDK contract changes. The standalone Phase E session-memory backend, its factory/registry/expiry/federation machinery and tests are untouched.

Best-effort tradeoffs accepted

Evidence

Independent review of the complete final candidate was scoped-clean through P2. Core focused proof completed339 passing/1 failing across24 files, with completed compiled generation verified. Extension focused proof passed568tests/23files across6 selected shards, with completed generation verified. The first UI batch passed286tests and failed6 across18files (both browser files/27tests passed). Three test expectations retained removed display-transport barriers; three fixture migrations awaited catalog delivery instead of the model-control's applied preference/runtime/hosted state. Updated only those observation expectations/waits, preserving all kept result/authority assertions. Focused rerun of all six failing owners and two direct model-control sibling suites passed206tests/8files; these overlap the initial batch and are not additional unique coverage.

All three targeted production-root typechecks passed. Core type-aware lint, extension focused lint/boundary guards and UI lint passed. Runtime cycles:0; Madge cycles:0. PR-wrapper/eager-runtime closure checks passed. Formatting completed after a test-only import-layout correction; diff whitespace check passed.

Conflict-only rebase retained main's shared Search fixtures and moved the removed catalog-settlement await into that shared owner. The configuration fixture uses its existing waitForRefresh option to await rendered readiness, preserving every assertion. Rebased UI production-root types passed; affected four unit files passed102tests, general Search browser passed16tests, and the repaired configuration browser passed9tests. No production hunk changed during conflict resolution. Final rebase focused lint and formatting passed; runtime and Madge cycle counts are both0; the full suppression audit passed all14tests (34.1seconds wrapper wall time).

Historical pre-rebase proof encountered an unchanged production-suppression baseline mismatch: ui/src/e2e/chat-managed-media-order.test-support.ts typescript/unbound-method count2 was absent from the97-entry allowlist. The exact98-versus97 signature was recorded open in the coordinator main-flakes ledger and scheduled-main runs39232001367 and39238273501 (the latest six completed scheduled runs were inspected). Neither source nor allowlist is changed by this PR. The final rebased audit now passes all14tests; no current suppression failure, added suppression or baseline exception is claimed. Hosted exact-head CI remains the gate.

Investigated local failure: the unchanged cached-WebSocket caller-retention test at line144 retained {turn:1} after its unowned control was collected. One serial two-file head/exact-clean-b8 baseline comparison reproduced the identical failure on BOTH sides, each45PASS/1FAIL, using the same pinned runtime, one worker and isolated state. The underlying cause remains unknown; no GC limitation or fix is claimed. Pair-only runs requested no compiled subprocess generation; the baseline invokes its own checkout-local workspace aliases while sharing only immutable installed dependencies. An ignored helper's inapplicable manifest postcondition failed after collecting both results; corrected the helper without rerunning tests. No kept assertion was changed.

Local tests use one worker, nice priority and isolated HOME/OpenClaw/XDG state. The changed real-Gateway E2E is not run locally under the campaign's host budget; exact-head PR CI owns broad/E2E proof. No retries, skips, higher timeouts or weaker kept-behavior assertions were introduced.

@clawsweeper

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

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR removes redundant cancellation, cleanup, admission, and metadata-publication plumbing across core, plugins, and the Control UI.

Example: The Gateway rebuilds its catalog after signing out of the provider serving openai/gpt-5.4.

  • Before: The retained model list immediately hides that provider's rows.
  • After: Previously rendered rows may remain until replacement publication or refresh, while current authorization still governs responses and execution.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A useful simplification with no concrete introduced defect found; focused validation supports it, but broad validation of the changed runtime paths is not established.
Proof confidence 🦐 gold shrimp (3/6) The ordinary external-contributor proof gate does not apply to this maintainer-authored PR; supplied focused tests support lifecycle invariants, while inspected historical screenshots establish only preserved rendering.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Redundant internal lifetime bookkeeping obscures the owners that actually cancel work, preserve ordering, and settle resources.
Reason: The maintainer author explicitly chooses the best-effort display tradeoffs, and the patch removes substantial production machinery while retaining the consequential boundaries.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this maintainer-authored cleanup preserves the active lifecycle owners and explicitly accepts descriptive metadata staleness; no actionable introduced defect was found, but the draft has confirmed merge conflicts.

Priority: P3
Reviewed head: 4025fee6acc3e3b8859754447dff1f498f0c5ecc

Before merge

  • Complete next step - Resolve GitHub's reported merge conflicts before advancing this draft for landing.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied validation does not show this head exercising catalog publication and recovery through the real Gateway; the body explicitly leaves that scenario to PR CI.
Agent review details

How this fits together

Plugin workers, provider transports, and Gateway catalog services consume requests and lifecycle signals; their existing owners retain execution, cancellation, authorization, and settlement while UI stores cache descriptive results.

flowchart TD
  A[User requests and change events] --> B[Gateway authorization]
  B --> C[Catalog and session owners]
  C --> D[Control UI display caches]
  A --> E[Plugin and transport lifecycle owners]
  E --> F[Network and worker operations]
  F --> G[Owned cleanup and settlement]
Loading

Technical review

Best possible solution:

Keep active cancellation, FIFO admission, settlement, and authorization with their existing owners while removing redundant plumbing under the documented best-effort display policy.

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

This is a cleanup proposal rather than a bug report; source inspection confirms the inert worker signal and redundant owners, and no target code was executed.

Is this the best way to solve the issue?

The simplification uses existing lifecycle and cache owners without adding parallel production machinery; the changed display chronology is expressly accepted by the maintainer author.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 55bc065d06fb.

Provenance checked

  • UI model-catalog retirement and metadata transport barriers changes intended behavior with a stated reason (919e835: Prevent stale replies after invalidation; the earlier metadata coordinator also waited for transport settlement to coordinate visible demand.)
  • Gateway retained provider filtering changes intended behavior with a stated reason (204ff97: Serve published lists during rebuilds while immediately hiding providers whose config, credentials, selection policy, or plugins changed.)
  • Team Reports collection cancellation tree keeps the original intent (9dc8955: Move collection into a native worker while retaining host-owned SQLite and LLM settlement; the worker-local controller had no abort producer.)
  • Discord observation timeout changes intended behavior with a stated reason (03e59c8: Distinguish caller-facing timeout from physical listener settlement so timeouts cannot release real concurrency capacity.)
  • Nextcloud staged-media cleanup keeps the original intent (2afa400: Clean staged attachments on aborted or rejected ingress and transfer cleanup ownership after dispatch.)
  • Message injection early-release callback keeps the original intent (9cbcd21: Serialize preparation on the captured backend with an optional early release; neither current production caller uses that callback.)
  • Google first-response child signal keeps the original intent (3af8148: Cancel stalled first responses and retry with a lean thinking payload; native signal composition retains the deadline and parent cancellation.)
  • Browser and Copilot parent-signal relays keeps the original intent (unknown: Local history locates relay code in extraction and feature commits, but deeper moved-file searches encountered unavailable historical blobs; exact introduction remains unverified.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 224c0bc adds ui/src/lib/model-catalog-store.ts:213 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 224c0bcd8991; files: ui/src/lib/model-catalog-store.ts)
  • Dallin Romney: Raw commit 919e835 adds ui/src/lib/model-catalog-store.ts:205 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 919e835d22f4; files: ui/src/lib/model-catalog-store.ts)
  • Ayaan Zaidi: Raw commit 204ff97 adds src/gateway/server-methods/chat-metadata-runtime.ts:414 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 204ff9770617; files: src/gateway/server-methods/chat-metadata-runtime.ts)

PR surface

Source -505, Tests +29. Total -476 across 58 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 33 120 625 -505
Tests 25 358 329 +29
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 58 478 954 -476

Review metrics

Metric Value Why it matters
Production versus test/support delta Production +120/-623; tests and support +358/-331 The production reduction removes duplicate machinery; test growth exercises native-worker cancellation, accepted SQLite settlement, and distinct request shapes.

Labels

Label changes:

  • add P3: This is internal cleanup with explicitly accepted recoverable display staleness and no established urgent user-facing defect.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • 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 explicitly accepted recoverable display staleness and no established urgent user-facing defect.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rank-up moves

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

  • Exercise real-Gateway catalog publication and recovery on the conflict-resolved candidate.

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 19, 2026, 8:06 AM ET / 12:06 UTC.

@steipete
steipete force-pushed the deslop/z34-2-lifetime-plumbing-20261015 branch from 4025fee to 36c1c17 Compare October 19, 2026 12:11
@steipete
steipete marked this pull request as ready for review October 19, 2026 12:12
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 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-19T12:19:48.792576Z 36c1c17 Draft marked ready
ℹ️ 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: 36c1c17cbd

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

publishModelCatalogResult(read, params, result);
}
// Catalog changes during a read are best effort until the next refresh.
publishModelCatalogResult(read, params, result);

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 Prevent older catalog reads from overwriting a refresh

When a normal catalog request is in flight and a forced refresh starts, the two requests use different keys and may complete out of order. If the refresh publishes first, this unconditional publication lets the older normal request publish afterward and replace the refreshed models indefinitely; the previous retirement check prevented that. Preserve a request generation/retirement fence so a pre-refresh response can settle its callers without overwriting the newer result.

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

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the best-effort display-freshness tradeoff explicitly accepted in this cleanup, rather than an unintentional lost fence. A same-client ordinary metadata response can overwrite a newer forced response until the next refresh or restart. The original fence's #174812 evidence is held mock replies and intermittent CI; no human actual-use incident requiring that chronology guard was identified. Forced discovery remains a separate real request, connection clearing still cancels pending intents, and account/session partitioning plus current disclosure/execution authority remain enforced. Reintroducing the generation/retirement machinery would restore the exact speculative display-only protocol this PR intentionally removes. No change is planned for this finding.

@steipete
steipete merged commit 6e23cf0 into main Oct 19, 2026
214 of 218 checks passed
@steipete
steipete deleted the deslop/z34-2-lifetime-plumbing-20261015 branch October 19, 2026 12:53
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 19, 2026
Keep configured model refs owned by model visibility policy after #177294 removed the separate metadata fingerprint. Keep the internal Doctor advisory fixture and Telegram assertions private, and remove the orphaned inspection table from #177279. Production advisory publication and display remain intact.
steipete added a commit that referenced this pull request Oct 19, 2026
Follow the best-effort metadata contract from #177294 while retaining exact request-sharing, completion-order, follower-publication, and subsequent-refresh assertions.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
* refactor: remove inert lifetime and metadata plumbing

* test(ui): await search config fixture readiness
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
Keep configured model refs owned by model visibility policy after openclaw#177294 removed the separate metadata fingerprint. Keep the internal Doctor advisory fixture and Telegram assertions private, and remove the orphaned inspection table from openclaw#177279. Production advisory publication and display remain intact.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
Follow the best-effort metadata contract from openclaw#177294 while retaining exact request-sharing, completion-order, follower-publication, and subsequent-refresh assertions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui channel: discord Channel integration: discord channel: nextcloud-talk Channel integration: nextcloud-talk extensions: browser extensions: copilot extensions: google gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: session-share plugin: team-reports rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL 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