Repository navigation
refactor(plugins): deslop browser and memory-core second pass - #158172
Conversation
Share browser registration, route orchestration, and documented SDK owners. Consolidate memory queue state, search preparation, and ingestion checkpoints. Preserve browser safety and tool definitions, memory schema and ordering, and existing dreaming and compaction output. Remove 1,344 net production lines.
|
🦞👀 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: blocked before merge. Reviewed September 25, 2026, 12:44 PM ET / 16:44 UTC (Revision 4). ClawSweeper reviewWhat this changesThe branch consolidates Browser plugin registration, guarded actions, and CLI wiring, and moves Memory Core queue and checkpoint logic to shared owners. Warning SQLite table change This PR modifies persisted SQLite tables in Merge readiness⛔ Blocked before merge - 1 item remains The cleanup remains useful: current main lacks its shared Browser tool definition and Memory Core checkpoint writers. The earlier config compatibility concern is resolved by the source comparison and recorded upgrade proof; this review found no blocking defect. Priority: P3 Review scores
Verification
How this fits togetherThe Browser plugin receives agent and CLI requests, checks profiles and navigation policy, then controls Chromium. Memory Core ingests workspace and conversation data into local state and an index used for recall. flowchart LR
A[Agent or CLI request] --> B[Browser plugin]
B --> C[Profile and navigation checks]
C --> D[Browser action and result]
E[Workspace and conversation data] --> F[Memory Core]
F --> G[SQLite checkpoints and index]
G --> H[Recall result]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep the verified browser safety, configuration, and stored-state contracts intact when this owner-level cleanup is merged. Do we have a high-confidence way to reproduce the issue? Not applicable: the PR claims behavior-preserving cleanup rather than a reported bug; its Browser and Memory Core validation checks parity. Is this the best way to solve the issue? Yes. The inspected changes remove forwarding and duplicate ownership while keeping the relevant Browser guards, config values, and checkpoint format. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 478cb42bf138. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Move the unchanged headless-source union to the existing profile contract and migrate config, Chrome, and client types directly to that leaf owner. This removes the type-only cycle caught by the architecture gate.
|
@clawsweeper re-review Config compatibility review is complete for
The SQLite warning is also a path-based classification: no table definition, SQL schema, state version, retention policy, or transaction contract changes. The PR body's Compatibility review and Evidence sections contain the completed proof. Please assess the remaining config checklist item against this source comparison and compatibility confirmation. |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…aw#158172) * refactor(plugins): deslop browser and memory-core second pass Share browser registration, route orchestration, and documented SDK owners. Consolidate memory queue state, search preparation, and ingestion checkpoints. Preserve browser safety and tool definitions, memory schema and ordering, and existing dreaming and compaction output. Remove 1,344 net production lines. * fix(browser): break headless source type import cycle Move the unchanged headless-source union to the existing profile contract and migrate config, Chrome, and client types directly to that leaf owner. This removes the type-only cycle caught by the architecture gate.
What Problem This Solves
Second-pass cleanup of repeated browser and memory-core orchestration and internal forwarding layers, following #156742 and #156867.
User Impact
No intended user-visible change. Browser launch/attach, profile isolation, navigation/SSRF and transfer-path checks, screenshot/snapshot shapes, and model-facing tool definitions are preserved. Memory schemas, persistence, retention, provider selection, indexing/recall order, and bounded dreaming/compaction output are unchanged. This refactor adds no migration or operator action.
Why This Change Was Made
Production reduction: 1,344 net lines (+1,406 / -2,750): 911 in browser and 433 in memory-core. Tests and test support: 189 net lines removed. All 187 production files over 200 lines were read largest-first and recorded with changes or reasons for retention; smaller production files and callers were also read. No SDK exports changed. The model-facing schema source files are unchanged.
Compatibility review
The config and stored-data flags are path-based detections, not contract changes. Browser config keys and defaults are unchanged; the shared headless-source type retains the same six values. Memory Core still writes the same daily/session ingestion namespaces, state versions, key formats, hash chunks, and ordering. No SQL schema, table, retention, or transaction contract changes. The published
2026.9.6updater → candidate Doctor proof below verifies migration, backup, idempotence, and installed Gateway convergence against existing synthetic state.Fixes found along the way
No independent product bug or flaky test was established. Initial proof caught refactor-related mock bindings, an obsolete duplicate page-initialization assertion, dependency type mismatches, and lint issues; those were corrected at their owners without weakening safety or lifecycle assertions. The initial hosted CI run found a type-only dependency cycle introduced by importing the shared headless-source type from runtime config. Moving the unchanged type to the existing profile-types leaf and migrating all three consumers fixed the cycle. Fail-fast cancelled the other CI jobs; they were not independent Windows or build failures.
Evidence
Task-run validation used Linux Blacksmith Testbox. Browser behavior, live smoke, and memory proof were retained across the final type-only relocation; architecture, changed-file checks, and the full build cover the repaired type graph. The final staged Git tree (
5fa520d8cb8ec2c3b4de0d4ec273290ace560fa4) exactly matches the hash-verified Testbox source.Completed proof:
db716b408fb: passed. Architecture 337s; build 375s; selected changed-extension test jobs 160–308s; Windows test shards 308–505s (job wall time, including setup and uploads). The aggregate passed after an approximately nine-minute Blacksmith runner-assignment wait; no tests were rerun for that wait.node scripts/check-changed.mjs --base 21ce88bcff93f243b9d3ffe90a38a045295dc55d: passed (618s), including formatting, type lanes, plugin boundaries, all three dead-export scans, lint, storage and runtime guards.node scripts/check-changed.mjsfor the four repaired browser files: passed (722s) on the final tree. Explicit file selection avoids the Testbox clone's missing published-branch history; all selected type, lint, export, storage, and runtime guards ran.pnpm test:extensions:batch browser: 4,840 passed, 116 existing skips; 97s; retained across the final type-only relocation.pnpm build: passed (637s on the final clean build), including declaration emission, SDK exports, and CLI bootstrap validation.pnpm test:extensions:batch memory-core: 2,079 passed, 4 existing skips; 433s.pnpm test:docker:dreaming-cron-doctor: passed (965s), using the published[email protected]updater and a hash-verified candidate. Verified the updater-owned Doctor child, backup, idempotence, and installed Gateway convergence without changing authored or inactive cron rows.GOGC=30 GOMEMLIMIT=3GiB pnpm check:architecture: passed (278s), including zero Madge cycles, wrapper ownership, Kysely, and storage guards.Validation used
blacksmith-testboxleasestbx_01m3c42f9n9mz6deamnrbpxjxs(initial run) andtbx_01m3c9zn5wpfmxx8ezexd4ndq9(completion run). The first job was cancelled during upgrade-package preparation after the completed checks above; its cancellation cause was not established. Missing checks were resumed on the second lease. Both initial leases are stopped. The type-only CI repair usedtbx_01m3chfhkgv6cxav7jks0ajkjq(repair proof run); its final wrapper command exited 0. That lease is also stopped.Changed-test command costs
Measured on Linux Testbox with
pnpm test <file> --maxWorkers=1; wall time includes process startup. No test cases were added.extensions/browser/src/browser/bounded-utf8-tail.test.tsextensions/browser/src/browser/chrome-mcp.test.tsextensions/browser/src/browser/control-auth.auto-token.test.tsextensions/browser/src/browser/pw-tools-core.browser-ssrf-guard.test.tsextensions/browser/src/browser/routes/agent.existing-session.test.tsextensions/browser/src/browser/routes/agent.shared.test.tsextensions/browser/src/browser/routes/agent.snapshot.local-managed.test.tsextensions/browser/src/browser/routes/agent.snapshot.timeout.test.tsextensions/browser/src/browser/server.agent-contract-core.test.tsextensions/browser/src/cli/browser-cli-actions-input/register.batch.test.tsextensions/browser/src/cli/browser-cli-actions-input/register.element.test.tsextensions/browser/src/cli/browser-cli-actions-input/register.files-downloads.test.tsextensions/browser/src/cli/browser-cli-actions-input/register.form-wait-eval.test.tsextensions/browser/src/cli/browser-cli-actions-input/register.navigation.test.tsextensions/browser/src/cli/browser-cli-actions-observe.test.tsextensions/browser/src/cli/browser-cli-cookie-sync.test.tsextensions/browser/src/cli/browser-cli-debug.test.tsextensions/browser/src/cli/browser-cli-extension.posix-upgrade.test.tsextensions/browser/src/cli/browser-cli-extension.test.tsextensions/browser/src/cli/browser-cli-extension.windows-setup.test.tsextensions/browser/src/cli/browser-cli-inspect.test.tsextensions/browser/src/cli/browser-cli-shared.test.tsextensions/browser/src/cli/browser-cli-state.option-collisions.test.tsextensions/browser/src/cli/browser-cli.lazy.test.tsextensions/browser/src/gateway/browser-request.profile-from-body.test.tsextensions/browser/src/gateway/browser-request.timeout.test.tsextensions/browser/src/gateway/session-browser-request.test.tsextensions/browser/src/plugin-service.test.tsextensions/memory-core/src/cli.test.tsextensions/memory-core/src/dreaming-phases.test.tsextensions/memory-core/src/memory-forget.test.tsextensions/memory-core/src/memory/index.test.tsextensions/memory-core/src/memory/manager-provider-state.test.tsextensions/memory-core/src/memory/manager-session-update-race.test.tsextensions/memory-core/src/memory/manager-sync-control.test.tsextensions/memory-core/src/session-backfill.test.tstest/scripts/lint-suppressions.test.tsCross-shard consumer proof