Repository navigation
refactor: localize single-consumer internal preparation - #180329
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
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. |
|
|
Codex review: needs changes before merge. What this changesThis PR moves private preparation logic into its existing consumers and consolidates OpenCode Go sanitizer coverage. Example: OpenCode Go handles a kimi-k2.6 request containing replayed reasoning fields.
Review scores
ProductKind: Refactor · Worth it: Yes Merge readiness⛔ Needs changes before merge - 1 item remains Keep this maintainer-authored refactor open; the pinned diff preserves the inspected contracts, and no actionable introduced defect was found. Priority: P3 Before merge
FindingsNone. Agent review detailsHow this fits togetherCLI, Gateway, agent, and plugin operations consume configuration and prepared runtime facts, enforce existing boundaries, and produce requests, filesystem effects, diagnostics, or command results. flowchart TD
A[CLI and Gateway entry points] --> B[Existing operation owners]
C[Configuration and prepared facts] --> B
B --> D[Authority and validation checks]
D --> E[Provider and filesystem operations]
E --> F[Results and diagnostics]
Technical reviewBest possible solution: Retain the existing owners and preserved contracts while removing their private forwarding and preparation frames. Do we have a high-confidence way to reproduce the issue? This is a behavior-preserving refactor, so there is no reported product defect to reproduce; review used source, retained tests, history, and hosted check annotations without executing target code. Is this the best way to solve the issue? The change follows existing ownership boundaries, removes the replaced private paths, and preserves distinct validation, cancellation, authority, and cleanup behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c439431bb101. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -522, Tests -36, Other 0. Total -558 across 40 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 22, 2026, 1:30 AM ET / 05:30 UTC. |
|
Merged via squash.
|
) * refactor(core): inline private skill and MCP loading frames * refactor(gateway): inline sole-use provider and publication frames * refactor(workspace): inline sole-use preflight and provisioning frames * refactor(plugins): inline generic embedding request frames * refactor(providers): fold single-consumer stream frames into owners * refactor(matrix): fold single-consumer mention frames into owner * refactor(core): fold private usage and activation frames into callers * refactor(runtime): fold sole-use identity and lifecycle frames into owners * refactor(plugins): localize prepared setup and rendering context * refactor(cli): localize single-consumer command preparation * refactor(plugins): localize attendance and resolver preparation * test: tighten assertion and suppression ratchets * refactor: isolate cleanup from inconclusive backup failure
What Problem This Solves
Internal command, Gateway, and plugin operations still route through private single-consumer preparation frames and an unnecessary provider module.
User Impact
No intended user-visible change, migration, or operator action. Public SDK, CLI, configuration, protocol, and persisted-data contracts stay unchanged.
Why This Change Was Made
Keep preparation in its existing consumer: Gateway publication and embedding operations, CLI registration/output and asset publication, attendance/resolver work, and plugin setup/formatting. Shared helpers and lazy module boundaries remain. OpenCode Go replay sanitization moves into its existing stream owner; its retained behavioral assertions move to the public plugin path instead of keeping a test-only production export.
Net production LOC: 274 removed across 20 production files; 24 files total including two shrink-only ratchets. Tests shrink by 36 net lines as the sanitizer coverage moves into the existing public-path fixture and one obsolete suppression entry disappears. Moved implementation bodies receive no deletion credit. The assertion baseline tightens from nine to seven for the sessions registrar's two removed casts; the suppression allowlist drops a stale Gateway test-helper entry already removed on main by #180176. This is the reduced area slice of the original 522-line family after the import-graph-scoped CI rollback below.
Security and authority checks, cancellation and lease cleanup, native runtime/model consent and verification, Matrix visible-mention spoof protection, durable user writes, exact diagnostics and trust notices, cache identity inputs, and provider request behavior remain. The standalone session memory backend and all Phase E machinery/tests are untouched.
Best-effort tradeoffs accepted
None added. This cut removes internal frames, parameter plumbing, and redundant parsing of already-prepared pure timestamp facts, not security, durability, realistic-concurrency, integrity, or failure-handling guards. Existing best-effort policies remain unchanged.
Evidence
Focused owner and consumer tests passed serially with one worker and isolated HOME/OpenClaw/XDG state. Retained changes cover Gateway embedding/publication, stream providers, Matrix mention handling, llama.cpp setup, memory-wiki import, Zalo formatting, CLI registration/output and asset publication. Original CLI proof passed 246 cases across 13 files; final Meet/Twitch proof passed seven selected cases across two files, including the registered attendance tool and cancellation/timeout continuation. The other 56 Meet cases were deliberately unselected, not newly skipped.
Targeted native typechecks, typed lint, formatting, line-cap checks, and independent Codex review through P2 passed for each packet. Final pre-push checks cover the suppression/assertion ratchets, PR-wrapper/eager-import closure, and runtime/static cycles. Hosted CI on the pushed exact head is the broad proof; no local build, broad suite, whole-graph typecheck, live provider/service, Windows execution, or new performance measurement is claimed. Existing public-path sanitizer coverage was extended rather than adding another fixture; hosted CI supplies its CI-time measurement.
No intended visual change: plugin asset publication mechanics and output bytes are preserved; no browser UI, styling, or markup is changed.
CI attribution and scoped rollback
Initial exact-head run 39726615349 failed three leaves. Both daemon suites reproduce with the same signatures on clean actual CI main parent 67b60de: three node-daemon-runtime cases reject the stale Node 26.8.1 probe fixture, and eleven node-cli/daemon cases reject the same fixture against the new 26.12.1 security floor. Neither suite, runtime guard, nor determining runtime-selection owner was changed by this PR. They are inherited, not claimed fixed.
The global competing-WAL ownership case expected an ambiguous-hardlink refusal but CI received
database is locked. One serial isolated head/main-parent replay passed on both sides, so attribution remains inconclusive. Per campaign rule 8, all 16 changed files reachable from that test's complete runtime import closure (including dynamic imports) were restored to fetched main; the other 24 PR paths are outside that closure. The dropped 248-line slice is retained ondeslop/z25-parked-backup-import-closure-20261015, without a PR. No SQLite policy, assertion, timeout, retry, or skip was changed, and the passing replay is not represented as a fix. Rollback proof passed 524 focused tests across 33 files, six targeted native typechecks, and independent review through P2. The repair receives one push and fresh exact-head CI; prior-head results remain prior-head evidence.The final initial-run leaf also timed out four Memory Core background-reload cases. The reduced PR changes none of the 11,078 files in that test's runtime import closure, including dynamic imports and its explicit native-host/Memory Core module-loader roots. This is inherited-by-import-graph attribution, not a claim that the timeout is fixed; the memory test and all backend machinery are unchanged.