Repository navigation
refactor: consolidate plugin cache and lifecycle owners - #178018
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review blockedAutomated review did not run, so no review verdict was produced. Reason: The input-safety check rejected material in this revision. No detected value, path, or scanner output is reproduced here. Automatic review is on hold, including after source changes. Request a fresh re-review after resolving the failure; maintainers can also release the hold through an intentional scanner-policy update. Next step: If this is a genuine credential, remove and rotate it. If it is an intentional test fixture, a maintainer must review and qualify it. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ 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".
| }); | ||
| ensureNestedRecord(prefs, "savefile").default_directory = opts.downloadDir; | ||
| } | ||
| saveJsonFile(preferencesPath, prefs); |
There was a problem hiding this comment.
Persist the mock-keychain marker before preferences
On a new headless macOS profile, if writing Default/Preferences fails once but Chrome still launches, this throw prevents openclaw_mock_keychain from being recorded in Local State; the caller catches the error and proceeds. Chrome then creates Local State, so the next launch no longer considers the profile new and omits --use-mock-keychain, making cookies written with the automation keychain unreadable. Persist the key-source marker independently before this fallible preferences write.
Useful? React with 👍 / 👎.
fe9124c to
752719c
Compare
|
Merged via squash.
|
What Problem This Solves
Bundled plugins retain duplicate cache, profile-preparation, shutdown and projection owners even where an existing client or SDK operation already owns the work. Several search caches also omit the resolved credential, allowing one configured account to receive another account's cached answer.
User Impact
Search results remain scoped to the account that requested them, and Discord voice identities observe the canonical client's Gateway invalidation. Other changes remove private duplicate work without removing capabilities or requiring user action. Existing best-effort differences are listed below.
Why This Change Was Made
Reuse Discord's invalidated client entity cache instead of a second speaker cache, and resolve speaker identity once per ingress. Move Slack thread lookup onto the existing credential-scoped SDK cache. Prepare managed Chrome preferences in one pass, writing network-prediction protection before cosmetic Local State; tab readiness uses the existing tab-list operation without count/forwarding wrappers.
Keep Feishu and Teams shutdown in their sole awaited finally path. Remove Ollama's identity sanitizer implementation and its private generic adapter. Teams poll consumers now request metadata or a vote outcome rather than reconstructing unread full-vote maps. Remove unused private projections, options, defensive copies and repeated internal normalization in Discord, Matrix, Signal, Google, QA, memory, Mattermost, voice and Deepgram.
Scope Brave, Perplexity, Kimi, Gemini and Parallel search results to the actual resolved credential using the existing SDK digest helper. Preserve every existing endpoint/model/filter/header cache dimension, TTL, bounds, cancellation and authorization behavior. Firecrawl, MiniMax and Slack's account-lookup consolidation are deferred because active PRs own their exact files.
Production delta against conflict-repair base
4763b77ba572eefaef3bed12c0c17c305cd12738: 333 net lines removed (+221/-554), excluding tests, support, fixtures and generated files. This is a residue under the campaign's >=100-line waiver, not a LARGE PR. No schema, config, protocol, dependency or public SDK change. No Phase E backend changes.Best-effort tradeoffs accepted
6c352f4619606), not an actual-use report. Such mutation is best effort; a later send resolves current config. Live send authority remains checked.3da34a4673d086b99b4990ea299e681a704d0888, not a human incident. An extreme clock may reuse an optional result until normal TTL/restart; credential scope, real TTL, timeout, abort and bounds remain.8864423309d3b), not an independent retry contract. No hypothetical reentrant cleanup entry point remains.7cdd7c5333d4d, without a linked actual-use failure. Cosmetic Local State is rewritten on reuse; a failed write warns and the next launch retries. Network-prediction protection from fix(browser): block interaction-triggered navigation SSRF #104254 is retained and written first.9310586b092d24fc631135a6a4df99ef6ffaaff3); no reader mutates those objects. Future in-place consumer mutation is outside that ownership contract.dns.lookup(..., {all:true})callback returned an array: Node's typed overload owns that shape. The extra check came fromc3c7c2df6f62a4, with no linked human shape-failure report. Real DNS errors, empty results, IPv4 ordering and endpoint SSRF policy remain.d0ce2d1044430) did not establish an invalid-config runtime contract. Bypassing the config boundary is not supported; the normal auto/on/off behavior and default remain.52644b7af6fb5) retained that redundant flag; no additional production close entry point exists. Repeated public close still emits one Finalize, while finalized text, fallback timer, reconnect and bounds remain.Other removals delete unused private values or delegate equivalent arithmetic/collection behavior to existing SDK owners; they do not remove error handling or user-facing features. Human-reported Ollama reasoning-leak protection (#86129/#86515), ordinary concurrency, credential/effect gates, user-data durability, FIFO and resource bounds remain.
Evidence
Local package-boundary typechecking is unqualified without generated SDK declarations; exact-head hosted CI owns broad/type-aware proof. No broad local build, whole-graph typecheck, full suite or E2E was run. Synthetic production-path and installed-SDK loopback evidence is not live channel/provider acceptance. All proof uses isolated HOME/OpenClaw/XDG state, not the operator Gateway or real OpenClaw home.
First exact-head CI repair
Run
39367914071found PR-caused failures, not inherited failures. The production, extension-test, core-5-test and package-boundary type jobs all identified the same Slack loader narrowing error. Capture the already-validated timestamp as a scalar before creating the asynchronous cache loader; no cast or additional validation is needed.The browser shard found two existing oversized-timeout assertions disproving the proposed timer-helper equivalence: the SDK caps at 2,147,000,000ms, while the browser contract is 2,147,483,647ms. The entire timer migration is withdrawn, restoring the original owner byte-for-byte and keeping the assertions unchanged. Both failing browser cases pass after restoration (36 cases across the two owner files).
The ratchet job also requires removal of the obsolete Discord reply-context assertion allowance and export-preserving browser MCP mocks. Those are maintenance of our cut, not exceptions or relaxed budgets. No CI job was rerun.
Repair proof: Slack 10 cases, browser normalization/snapshot 36, and suppression audit 14 passed in a serial 176.64-second wrapper. The changed shutdown mock passed all four cases (27.15 seconds Vitest; 36.93 seconds wrapper). Formatting, focused syntax lint, whitespace, assertion-safety and mock-export ratchets pass; the latter two baseline changes only remove obsolete exceptions. Independent P0-P2 review of the exact five-file repair completed scoped-clean with final source verification. The original scoped runtime-cycle proof remains valid: the only production import change in this repair removes the withdrawn SDK timer edge.
Conflict-only integration
The repaired pre-rebase head
fe9124c5be54228736c7606a06bd4a14199dddc2passed hosted CI run39369763617. Native landing then found a real Gemini runtime conflict and aborted before dispatch. The conflict-only rebase keeps main's newer inline search implementation and preserves cache isolation using the resolved credential and canonical operator headers. It does not replace main's owner or remove any request/cache dimensions.On repaired head
752719c6a0923dcea7a194f12dd546c33c0e67d6, focused Google provider and credential-isolation suites passed all 62 cases across two files; suppression audit passed all 14 cases. Scoped cycles cover 2,708 production files in the same 18 plugins: zero runtime cycles and no new static components. Independent complete-candidate P0-P2 review finished scoped-clean with final source verification. The three-file package typecheck remains unqualified because generated SDK declarations are absent; no broad local generation/build was run. Exact-head hosted CI run39376879254completed successfully, including production/test types, lint, selected owner suites, all three PostgreSQL conformance shards andopenclaw/ci-gate. No CI rerun or extra head push was used.