Repository navigation
refactor: deslop agent tools and macOS leftovers - #168168
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: needs changes before merge. What this changesThis PR consolidates agent-tool and macOS implementation paths and repairs native approval fixture cleanup. Example: A native approval test reaches its existing 60-second timeout before cleanup finishes.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this maintainer-authored PR provides useful consolidation with no actionable introduced defect found, but a current-head dashboard E2E failure still needs attribution. Priority: P3 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherAgent-tool owners translate model requests into Gateway calls and media results, while macOS owners handle native execution, capture, process identity, and service lifecycle. flowchart TD
A[Agent requests] --> B[Tool schemas and execution]
B --> C[Gateway dispatch]
B --> D[Media persistence and results]
C --> E[macOS native services]
E --> F[Processes and capture devices]
Technical reviewBest possible solution: Retain the consolidation and fixture repair, resolve CI attribution, and land through the normal required gates. Do we have a high-confidence way to reproduce the issue? The principal change is a refactor; the fixture race has a reported timeout control and a source-visible cleanup mechanism, but no target code was executed during this review. Is this the best way to solve the issue? The extraction reuses existing owners while retaining action-specific defaults, parser policies, media rollback, and Gateway authority handling. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e86845769895. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -531, Tests +7. Total -524 across 38 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label 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 HistoryReviewed October 10, 2026, 4:00 AM ET / 08:00 UTC (Revision 3). |
Combine the reviewed d39 native primitives and d41 tool/harness consolidations. Preserve serialized schemas, result text, authority, media rollback, and native parsing contracts. Production delta: -542 LOC across 37 files; tests unchanged.
A timed-out approval test continued restoring its state-directory environment while the next case was running, causing a database execution identity mismatch. Track the whole state scope and native run, propagate test cancellation, and join them through the existing fixture lifetime before restoring registry and mocks. Keep the existing assertions and 60-second deadline.
51914e9 to
a427cb4
Compare
|
The dashboard-pin CI failure on head The complete paginated check-run census contains 126 terminal checks: 74 successful, 49 skipped, 1 neutral, and the 2 failures listed below. No check remains pending or cancelled. This records an inherited-failure exception; it does not claim that all CI passed.
The independent reproduction belongs to PR #138087, whose changed-file list contains no UI files. The dashboard test has Git blob These cases inject fixed Canvas/MCP history and responses through The earlier cancelled PR-context job was treated as missing proof and rerun. Run The changed native-approval fixture passed its four hosted cases in job The separate dependency-review and security-sensitive-review statuses are successful. The combined |
Combine the macOS and agent-tool cleanup lanes around their existing schema, media dispatch/result, harness lifecycle, native parsing, capture, worker, and process-identity owners. Preserve validation, authority, and rollback. Remove 531 net production lines across 36 files. Drop the entire sessions-list cleanup during the conflict-only rebase so main's sidebarRoot behavior wins. Join native approval execution and its state scope through the existing fixture lifetime before restoring shared state. Preserve assertions and deadlines; the repair adds seven net test/support lines, for 524 total lines removed. Validation: full ordinary tools/harness coverage, reviewed fixture timeout control, 322 post-rebase focused tests, rebuilt macOS product/test targets and 429 native tests, unchanged full SDK API, zero cycles, and touched type graphs. Full evidence, coverage log, local limitations, and the independently reproduced UI dashboard-pin CI failure are recorded in PR openclaw#168168. Landed under the coordinator-authorized inherited-failure exception pinned to a427cb4.
What Problem This Solves
Consolidates repeated agent-tool and macOS implementation paths while preserving tool schemas and result text, execution authority, media rollback, native parsing, and service identity. No user-visible behavior change, migration, or operator action is intended.
Existing owners now share schema primitives, node photo/recording dispatch, media result projection, harness diagnostics, and Gateway fallback transport. The macOS changes share shell parsing, worker continuations, capture geometry, UVC controls, process identity, and existing installation/path helpers.
Applied d39 (
5dc0b733bb111d16435113fd70816617012b6cb8) before the complete d41 branch (8cbb47a5b004cdef035b4d844834041839bce654). After one conflict-only rebase, main wins: the entiresrc/agents/tools/sessions-list-tool.tscleanup was dropped because main addedsidebarRootto the rewritten row. This drops 11 net cleanup lines and preserves main's exact file. No other cleanup hunk was dropped.Production delta: +1,089 / −1,620 = 531 net lines removed across 36 files. A proven adjacent fixture repair adds 7 net test/support lines, making the complete diff 524 net lines removed across 38 files. This uses the coordinator-approved 500–999 production LOC exception; coverage log below. No authored configuration, schema, protocol, dependency, changelog, timeout, retry, skip, assertion, baseline, or lint-suppression change.
Fixture Repair
The full directory run exposed a timed-out approval test continuing to restore
OPENCLAW_STATE_DIRwhile its following deny case was running. The deny case then failed the database execution identity guard. The repair uses the existing fixture-lifetime owner to join the complete state scope and native execution before restoring registry/mocks, and composes test cancellation with the existing local abort signal.The original 60-second deadline remains. A diagnostic control intentionally hit that deadline: allow failed as expected, cleanup finished at 61.553 seconds, and deny began 73 ms afterward and passed. This proves isolation under timeout; it does not claim the separate cold-start timeout is fixed. The clean repair passed all four existing cases (362.580 seconds wall, 126.694 seconds test time); sibling stream/revocation cases passed 2/2 (345.546 seconds wall). Commands used
node scripts/run-vitest.mjs <file> --maxWorkers=1; no new test cases or production seams were added. The post-rebase approval replay also passed 4/4 with unchanged deadlines (allow 33.424 seconds; all four cases 80.869 seconds). Exact-head hosted CI also passed all four cases inchecks-node-changed-compact-large-2(job114166367618): 4.325 / 2.392 / 2.397 / 2.411 seconds, totaling 11.525 seconds of case time. The shared shard test step took 158 seconds; neither value is an isolated file wall time.Evidence and Limits
Current candidate:
a427cb46f3d00a5c3d00630af38d06d9666ae5de; base:b19bfee65b2ade17a5ce4838e9bef3855446d40a.b19bfee65b2a→a427cb46f3d0: no API changes, digestff7b090f43d2d90e4cd883d95840d6b752475a7a1769e295fb4cbb558a6ffb64. Both revisions received frozen installs; full base/head renders passed in 1,073.938 / 1,070.881 seconds. The earlier comparison also found no changes; the new run covers the changed upstream SDK/dependency inputs.check-changedpassed its initial guards, core production types and all 27 core-test graphs, then the aggregate exited 137 for an unknown reason. The canonical finalization replay passed. Manual continuation passed all remaining guards, Swift lint (481 files), and fullpnpm test:macos:ci(1,537.10 seconds), except full Knip scans reached their unchanged 600-second limit and full core lint reached its unchanged 900-second limit. Correctly configured focused lint passed all changed TS files (95.37 seconds). An earlier wrong-tsconfig lint invocation triggered unnecessary SDK declaration preparation and timed out; this was an invocation failure. No aggregate-green claim. After the rebase, serial execution completed all three unchanged-limit Knip scans: production 560.9 seconds, full-tree 539.8 seconds, scripts 270.1 seconds. Scripts passed. Production reported unchangedisPollVoteEchoTextandPUBLIC_SESSION_ENTRY_SCRIPT; full-tree reported unchangedisClaudeLikeLiveAgent. Owners, remaining callers, all Knip configs, runner, and lockfile are identical on base/head/observed main. The poll helper’s last production external import was removed by main commit988c6ee6d7b; the live-agent helper’s last external test caller was removed by main commitf659a3576b1; the public-script export has only an external test consumer. This bundle removed none of these consumers. This is source-qualified attribution, not a claimed baseline Knip execution.session-transcript-reconcile.close-failure.test-support.mjshas twotypescript/unbound-methodsuppressions, while its allowlist expects one. Clean baseb19bfee…reproduced the exact failure (2 passed / 1 failed, 55.765 seconds wall). The helper, allowlist, and collector are byte-identical on base, this head, and observedorigin/main5861fe7…; upstream commitbb7d32e55d48introduced the extra directive. This PR adds no suppressions and does not expand the allowlist.Timeout attribution
Each original case ran sequentially five times per revision on the same Mac/Node version, in balanced base/head order. All passed on both revisions. Medians below are complete case durations; they are not the narrower subprocess timeout regions.
Retained reverse-order runs and a same-physical-checkout/install crossover followed. The crossover ran 10 times per revision: directory cycle 7.145/6.984 seconds (−2.25%), equal passes, meeting parity; thin Bun 6.387/7.155 seconds (+12.02%), equal passes, still inconclusive under the required rule. All prior measurements remain part of the evidence; thin Bun is not labeled inherited.
Thin-Bun source tracing shows no changed-file overlap in the 252-file eager closure or 188 retained transforms. The test compiles inert C fixtures and invokes a copied verifier with synthetic metadata/mocked signing tools; it executes no app Swift, Bun, or OpenClaw runtime. Its case includes 23 cold native preparation commands and five other launches. The original failure was the final Bash verifier's existing 20-second deadline. Static input equality is evidence against direct causation, but does not waive timing parity or identify that original stall. A final bounded, supported Vitest worker-preload diagnostic retained the original TSX/jsdom preloads and all budgets. Three alternating runs per revision all passed and captured the 28 fixture commands: complete-case medians 8.360/9.889 seconds (+18.29%); verifier-region medians 4.243/5.279 seconds (+24.42%). These narrower measurements also fail parity and do not reproduce the original 20-second stall. No further replay is used to obtain a favorable classification.
Hosted CI
Exact current-head census: 126 terminal checks: 74 success, 49 skipped, 1 neutral, 2 failures, with no remaining cancelled or pending check. All native Periphery checks passed. The cancelled PR-context run was explicitly rerun and passed. The remaining failure is
checks-ui-e2e (1/2)plus downstreamopenclaw/ci-gate: twosession-dashboard.e2e.test.tscases cannot click “Pin to dashboard” because.chat-gutter-stack--detailsintercepts pointer events. The failing UI job is independently reproduced by unrelated PR #138087’s job, headb5fe2875852563770939572f01ab27acbce3eb7d: both exact cases fail at the same 30-second click boundary with the same details-gutter SVG/span interception. That PR changes 160 files and no UI paths; its test/layout blobs match this base/head. The entire UI tree is identical between this base and head. The mock-Gateway fixture fails beforeboard.widget.put, without reaching this bundle’s tools/harness/native code. The downstream gate job114167250118fails solely because that selected UI shard failed. Both failures qualify for the coordinator-authorized pinned inherited-failure exception. The fresh SDK comparison and all affected post-rebase tests passed as recorded above. Posted CI attribution addresses the exact-head review’s sole before-merge request.The previous head’s independently proven shared-kit Periphery failure is historical only; main removed those DEBUG helpers before this rebase. Hosted native Swift/Node skips are not substituted for the local rebuilt native proof above.
Coverage log for the 500–999 LOC exception
The original d39 inventory records 102 inspected production files (21 implemented, 81 retained), 295 pending, and 11 excluded/generated files; pending files are not claimed as inspected. The d41 handoff records complete owner reads across tools/harness with explicit exclusions. Every one of the 36 retained changed production modules was reviewed again after integration. The retained coverage below records the consolidation and the contracts exercised; it does not claim live hardware/provider proof.
tools/computer-tool-schema.ts,tools/message-tool-schema.tstools/nodes-tool-media.tstools/image-generate-tool.execution.ts,tools/music-generate-tool.execution.ts,tools/video-generate-tool.execution.ts,tools/media-generate-result-shared.tstools/image-tool.helpers.ts,tools/pdf-tool.helpers.ts,tools/media-tool-text.tsharness/lifecycle.tstools/in-process-gateway.tstools/openclaw-delegate-tool.tstools/web-fetch-utils.ts,tools/web-search-provider-config.tsExecCommandResolution.swift,ExecInlineCommandParser.swift,ExecSystemRunCommandValidator.swiftNodeMode/MacNodeHostWorker.swiftCameraPTZNativeController.swiftComputerScreenActionExecutor.swift,ScreenRecordService.swift,ScreenSnapshotService.swiftProcessIdentity.swift,PortGuardian.swift,ExecApprovalsSocket.swift,ExecApprovalsSocketPathGuard.swiftApplicationRelocator.swift,CLIInstaller.swift,CuaDriverHostLifecycle.swift,OpenClawMacCLI/ConnectCommand.swiftExecApprovalsStore.swift,GatewayEndpointStore.swift,GatewayLaunchAgentManager.swift,ManagedNodeGatewayMigration.swift,NodeServiceManager.swiftTS paths above are relative to
src/agents/; Swift paths are relative toapps/macos/Sources/OpenClaw/, except the namedOpenClawMacCLIpath underapps/macos/Sources/.Rejected consolidations remain rejected: subagent waiting changed completion/abort microtask precedence; parser extraction with no net simplification, distinct authority/recovery paths, and media/provider-specific policy remain with their existing owners. No tests were removed or weakened, no timeout/retry/skip/baseline was expanded, and no lint suppression was added.