Skip to content

refactor(agents): deslop tools, auth profiles, sandbox and failover - #161122

Merged
steipete merged 4 commits into
mainfrom
deslop/l159-agents-tools-auth
Sep 29, 2026
Merged

steipete merged 4 commits into
mainfrom
deslop/l159-agents-tools-auth

Conversation

@steipete

@steipete steipete commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The fourth tools pass and accompanying agent-subsystem sweep remove duplicate projection, parsing, and forwarding code left after the previous cleanups.

User Impact

The cleanup preserves tool names, registered descriptors, schemas and prompts, credential selection and cooldowns, OAuth fencing, sandbox path/isolation policy, failover ordering, and persisted state. Canceled OAuth lookups now honor cancellation at their final return boundary, including legacy-profile fallback.

Why This Change Was Made

The combined sweep removes 919 net production lines (722 added, 1,641 removed). The coverage log below records all 158 production files over 200 lines after the complete file-by-file pass, with retained authority and compatibility boundaries called out. The prior third tools pass (#159639) and subsequent merged fixes were inspected before editing. The integration preserves main's canonical replay-ID owner (#134425) and worker-owned subagent Stop persistence (#160203); the reduction is measured against d3008b2d5ee.

  • Auth resolution and refresh-peer rediscovery share their existing owners; cooldown scope and metadata projections lose redundant branches without changing priority or credential handling.
  • Media tools share one lifecycle constructor and reference-result projection; video reference/role parsing retains positional validation and its original order.
  • Replay normalization shares copy-on-change traversal and one future-result scan, retaining separate trusted signed-thinking matches and legacy ID handling.
  • Sandbox allocation reuses registry facts and shell command assembly; retained boundary tests call the canonical filesystem owner instead of a test-only forwarding module.
  • Tool helpers reuse canonical numeric coercion, remove one-use forwarding, and share route, schedule-alias, and operation projections.
  • Compaction reuses cancellation and ordered-section owners; runtime auth plans share projection while preserving their distinct route-selection decisions.
  • Helper-tool installation uses the canonical in-flight promise cache with eviction on either settlement.

Fixes found along the way

An OAuth lookup could return credentials when cancellation arrived between an inner lookup finishing and its public continuation resuming. The selected-profile and legacy-fallback paths now recheck the caller signal after their final awaits. Started refresh settlement remains independent. A timer-free public-resolver regression permits earlier successful completion and rejects credential returns when cancellation wins; the legacy case uses a concurrent peer lookup to expose the outer boundary.

The refactor also exposed an incomplete no-external-credentials fixture. Its mock now supplies the missing null bootstrap result; existing assertions are unchanged.

Evidence

CI failure repair (500deef514d)

The repair restores main's lazy readBootstrapCredential callback in src/agents/auth-profiles/oauth.ts. Replacing it with an eager imported function read caused prepared-model and Gateway suites to throw during module initialization, before their test cases ran. VisibleSessionsSpawnDeps is now file-private, removing the sole Knip unused-export finding. No test assertions, ignores, or changelog entries changed; the rest of the reduction remains intact.

Fresh isolated Codex review is clean through P2. Repair validation runs on Blacksmith Testbox tbx_01m3pcf7n8gcq90jfpaq9km8st (lease workflow). The wrapper allocated the lease; after local source-capsule preparation stalled on the overloaded host, the installed Crabbox CLI used the same provider and lease. Both baselines were fetched into separate clean remote worktrees at full pinned SHAs. The candidate patch and file hashes were verified, and its index tree is 41f2e00bd103f2dbbfc859ccd487943ef35de3ec.

The repaired candidate passes the five requested files (62 tests, 94s), owning suites (127 files, 1,419 tests, 266s), and import boundaries (18 selected files, 87 cases, 78s). All dependency, unused-file, and unused-export checks pass with zero entries (93s, 54s, 61s); Madge reports zero cycles (40s). The complete staged check-changed gate passes in 37m52s, including core and all 27 test-type shards, lint, formatting, and storage/import guards. The final source hashes and index tree remain unchanged.

Baseline file Main f8f3bd54684 Raw PR 4208c175496 Repaired candidate
src/boards/board-store.parity.test.ts 20 pass; 1 shared-state ownership failure 21 pass 21 pass
src/gateway/server-chat-metadata-lifecycle.integration.test.ts 20 pass eager bootstrap export fails suite loading 20 pass
src/agents/prepared-model-runtime.auth-recovery.test.ts 7 pass eager bootstrap export fails suite loading 7 pass
src/agents/prepared-model-runtime.reload-auth.test.ts 13 pass eager bootstrap export fails suite loading 13 pass
extensions/discord/src/monitor/listeners.thread-delete.session-store.integration.test.ts 1 pass 1 pass 1 pass

The original failed CI run tested merge c0bccdad90b8985be053225a8d800dbdddd80e6c, incorporating newer main code than the raw PR head. Main commit 26dffe7468cdf23b5d99b183d025e49198e39cea introduced execution capture into session deletion. The board fixture opens under a custom state environment and deletes without that environment, so the existing ownership guard rejects the mismatched shared database. The same commit adds an incognito post-deletion identity check that can observe the row it just deleted and roll the transaction back. Main repair remains with its coordinator. Discord's separate worker-pool routing issue was already repaired on main by 5d6f464a1cb3345a112707b53ce0ee2818bb0c9d.

Scheduled main CI 36556391603, at 3baf08ac9b1af2bb180c771104a8d2d0764e4848, repeats all 19 inherited non-Discord cases with the same test names and errors as the original PR CI run. The preceding scheduled run 36550256341 also reproduces them. These causal test/implementation paths are unchanged by this PR:

Main job Test file(s) Observed failure
checks-node-compact-small-26 / 109367122379 src/boards/board-store.parity.test.ts Agent execution belongs to another shared-state database
checks-node-compact-large-24 / 109367122486 src/gateway/server.incognito-lifetime.test.ts Deletion returns ok:false; rows remain (7 cases)
checks-node-compact-large-13 / 109367121965 src/config/sessions/session-history-budget-owner-parity.test.ts SQLite worker exits with code 1
checks-node-compact-small-4 / 109367121998 src/agents/subagents/registry/subagent-control.publication.test.ts Session delivery generation unavailable during retirement
checks-node-compact-small-8 / 109367122002 src/config/sessions/cleanup-service.applied-summary.test.ts; src/config/sessions/session-accessor.sqlite-prepared-admission.test.ts Expected local abort/child-worker admission not observed
checks-node-compact-large-18 / 109367121857 src/config/sessions/cleanup-service.fix-missing.test.ts; src/config/sessions/session-accessor.sqlite-cleanup-race.test.ts Expected rollback rejection resolves; canonical-key migration required
checks-node-compact-large-8 / 109367122022 src/infra/session-cost-usage.archive-identity.test.ts Expected usage archive entry absent

Repair head: 500deef514d77cdd4b8887086a2a3ca1c8ea4251; its committed tree is the tested candidate tree above. Exact-head CI 36567887239 completed with four failing test shards; check-dependencies and the original eager-bootstrap suites pass. Three failures have exact case/error matches in scheduled main CI 36562252809 at a15f3f72a6aabe4d51ce53426d717b4c65a4589e:

Repair-head job Main job Matching failure
checks-node-changed-compact-large-27 / 109404811225 109385864663 subagent-registry-queued-registration.test.ts: missing captureOpenClawStateReadContext mock export and its 58-case cascade
checks-node-changed-compact-large-20 / 109404811326 109385864569 chat.reset-visible-yield.test.ts: both cases fail to emit a real yield event; preceding registry persistence reports an ended turn
checks-node-changed-compact-large-15 / 109404811458 109385864571 session-accessor.sqlite-prepared-admission.test.ts: five child/worker admission expectations fail

The first two trace to main 437572e2e90be2f0bead9835814fbb06c0c758e5. Their causal source/test files are unchanged by this PR. The remaining checks-node-changed-compact-small-18 / 109404811337 failure is not qualified for an exception: server.heartbeat-store-lifecycle.product-proof.test.ts receives agent.wait status error instead of ok on a child followup, before the store switch. Main CI passes that case. The exact eight-file shard selection passes all 30 cases on both CI main base 149a41c5a91f1dd27e69f2b12011d7a9ccfab63f and CI merge 230e9177e56ac1d1ffd9c9c81345c8974abd3056, with one worker and again with CI's eight-worker setting. Those passing replays do not prove a fix. The bounded diagnostic reproduced the first different-store case on main: agent.wait returned replacement subagent source changed before commit, before provider dispatch (four provider requests, no provider errors). Main's ten-case diagnostic finished with one failure and nine passes; the CI merge passed all ten. The failing CAS owner is src/agents/subagents/registry/subagent-registry-replacement-store.ts:37, reached through Gateway child reactivation. Direct main-parent/CI-merge comparison verifies identical Gateway agent-turn, reactivation, heartbeat-test, and subagent-registry blobs. This is a main-owned stale-source replacement race; the exact regression-introducing commit is not established, and no main fix was made.

This evidence used Blacksmith Testbox tbx_01m3pk95c6y5rtjs4vzs4nkj6d; both task leases were stopped after their commands completed. Temporary diagnostic changes kept the original assertions and were restored; the PR contains no diagnostic/test changes. Scheduled main 36562252809 passes the heartbeat case, and newer scheduled main 36570405582 has no matching completed failed Node-job annotation. The requested exception requires a matching main/unrelated-PR CI failure, so the Testbox reproduction alone does not authorize an admin merge. Landing remains blocked on this heartbeat CI witness or the coordinator's repair. The pushed repair and all its passing proof remain valid; no CI rerun was requested. An additional attempt to expose the Incognito error payload was blocked by Testbox sync/command support; its pre-existence is established by the matching scheduled-main cases, and the post-deletion guard cause is source-attributed.

Fresh isolated Codex review is clean through P2, including the cancellation regression and final lint corrections. The patch retains sandbox checks across awaited work, auth settlement ownership, loss ordering, and replay early-exit guards. The assertion baseline only shrinks for removed lane-owned assertions.

The original implementation validation ran remotely through node scripts/crabbox-wrapper.mjs on Blacksmith Testbox. Full node scripts/run-vitest.mjs selections passed for tools, auth profiles, sandbox (including the real local-shell backend E2E), embedded-agent helpers, agent hooks, runtime plans, utilities, and failover. The 17 import-boundary files, including src/infra/fs-safe-import-boundary.test.ts and its siblings, and 17 caller files passed. Existing conditional skips remain unchanged. Tools and auth profiles were run again after the final fixes; unchanged suites retain their integrated-base proof.

The registered tool descriptor/schema/prompt capture is byte-identical to the pinned base: 1,058 cases covering 53 tool names and 76 system-prompt cases, 10,591,556 bytes, SHA-256 321367faa4a97a56655ca95eb50af0bc6436d38b24233fec55a36bce51332fe3.

Cancellation controls exercise the public resolver with synthetic credentials and the real legacy fallback chooser. On the original base, the primary case passes and the legacy fallback returns credentials after cancellation. Both repaired cases pass. Removing only the public fallback check makes the fallback case fail again; the intermediate refactor without final-boundary checks fails both cases. The test permits success that completes before cancellation and uses explicit promise settlement, with no timers, sleeps, polling, or retries. No live provider calls or production credentials were used.

Final committed validation passed on Blacksmith Testbox tbx_01m3p53yk5m18zdw26x8rpxy1w (lease workflow): full node scripts/check-changed.mjs (34m23s), pnpm build (5m43s), descriptor/prompt comparison, full tools and auth-profile suites, and all 17 import-boundary files. The wrapper verified source commit 63650d68ff877e0f65acb6cf5c461056e4847c62 and tree ea5de25de13134e0b56589682a5a08ffc09c683c; source hashes remained unchanged before and after every phase.

The cancellation negative controls passed on tbx_01m3nstgff8933z4kadrph0mzd (lease workflow). The unchanged integrated-base suites used tbx_01m3nh1w6fgb58640xpe6yt978 (lease workflow). Earlier validation caught two refactor lint errors (a shadowed projection name and an extracted response method), which are corrected and reviewed. An earlier lease expired during a gate; that interrupted run is not counted as passing. These workflow links identify the leases; stopping a completed lease can cancel its waiting Actions job without changing the recorded command results.

Measured Linux wall time for pnpm test <file> --maxWorkers=1: OAuth cancellation 27s (two cases), media retention 36s, media shared lifecycle 27s, model-config helpers 28s, and restart-sentinel media binding 47s. These include cold source loading. The new cancellation regression must reach the public async return boundary: testing only the manager/helper misses the extra continuation that caused the defect. Hosted per-file CI timing is not yet available.

Coverage: every production file over 200 lines

All listed files were read in full, largest first; all smaller production files in the assigned subtrees were also read. Sizes are from the pinned starting main revision. No top-level src/agents/*.ts files or reserved lane directories were changed.

Original lines File Disposition
2081 src/agents/auth-profiles/store.ts READ — Replaced duplicate guarded flatMap revision projections with typed map projections; preserved CAS/publication edges.
1463 src/agents/agent-hooks/compaction-safeguard.ts READ — consolidated cancellation recording plus return; removed duplicate callback-based split-turn truncation reporting because the context section already carries truncatedLoss; removed a repeated missing-model condition inside the same established branch. Prompt strings, boundaries, loss ordering, cancellation reasons, error retention, model/auth ownership, and finalization remain unchanged.
1291 src/agents/auth-profiles/oauth-manager.ts READ — Unified peer rediscovery and partial-claim retention during success/failure settlement; preserved lock and durable cleanup ownership.
977 src/agents/tools/sessions-send-tool.ts READ — Retain exact-incarnation access, legacy route custody, followup result ownership, and mode-specific dispatch; recent #160018/#160490 ownership repairs leave no safe broad consolidation.
947 src/agents/auth-profiles/usage.ts READ — WHAM probes, half-open claims, and persisted health writes have distinct ownership/generation requirements; no sound further consolidation.
940 src/agents/tools/web-fetch.ts READ: reused canonical numeric clamps for response metadata; simplified raw content-type normalization and removed one-use locals. Retained fetch fallback ordering, URL policy, cancellation, spilling, cache identity, and untrusted framing.
919 src/agents/tools/session-status-tool.ts READ — Consolidate origin, persisted, and active route compaction; reuse one origin read; simplify main visibility normalization and remove redundant status text alias.
884 src/agents/auth-profiles/persisted.ts READ — Legacy normalization, override insertion order, SecretRef stripping and OAuth drift reconciliation protect separate persisted contracts.
760 src/agents/tools/gateway.ts READ: reused canonical timeout clamp and removed narrating comments. Retained every identity/scoping/approval/remote-compatibility guard; these distinguish admitted authority from optional provenance.
759 src/agents/auth-profiles/runtime-snapshots.ts READ — Per-owner publication, credentials/metadata revisions, rollback and read invalidation differ intentionally; no safe owner cutover within scope.
740 src/agents/tools/message-tool-execution.ts READ: routing, scoped credential preparation, idempotency, source completion, and revocation checks have distinct contracts; no sound additional restructuring found.
714 src/agents/tools/sessions-list-tool.ts READ — Remove the one-use status schema-check wrapper; retain page validation, per-field projections, title/history admission, and exact byte budgeting.
708 src/agents/tools/ask-user-tool.ts READ: consolidate duplicate prompt-ready transition while preserving reservation precedence and own delivery.
707 src/agents/sandbox/docker.ts READ: share ready registry publication facts; inline the one-use image-state forwarding layer; remove unused skills-directory forwarding.
705 src/agents/sandbox/remote-fs-bridge.ts READ: remove the unused resolved-path source projection; preserve all remote canonicalization, mount policy, mutation pinning, and hardlink checks.
703 src/agents/tools/computer-tool-node.ts READ: no sound structural deletion. Target binding, observation/frame ownership, held-button recovery, attached cleanup, and stale Gateway recapture have distinct effects and fresh regression history.
694 src/agents/runtime-plan/prepare-auth.ts READ — generic and routed physical attempts now share auth-plan projection, while their candidate derivation, route selection, cooldown, binding priority, deferred native auth, and forwarding rejection remain separate and unchanged.
689 src/agents/auth-profiles/session-override.ts READ — User/personal/automatic pin decisions and CAS persistence are distinct; recent account recovery fixes preserved.
688 src/agents/tools/media-generate-background-shared.ts READ: one kind-based lifecycle owner consumes the canonical task-kind constants instead of a generic descriptor factory; removed unused label/eventSummary metadata. Admission, settlement, retries, retention and cleanup unchanged.
686 src/agents/tools/pdf-tool.ts READ: normalized loaded reference projection onto the shared resolvedInput contract. Model authority, native/extracted fallback and sequential cancellation remain unchanged.
676 src/agents/tools/cron-tool.ts READ: l121 already consolidated job recovery; remaining action branches enforce distinct management, creator, delivery, and scheduler boundaries.
674 src/agents/tools/sessions-spawn-tool.ts READ — Export the existing spawn option type so the visible flow consumes its owner instead of copying it; keep the l121 inherited-context simplification.
674 src/agents/tools/sessions-spawn-visible.ts READ — Replace duplicated spawn option declarations with the constructor-owned type; reuse the already-selected active guard for cloud launch.
668 src/agents/tools/sessions-tool.ts READ — Retain independent stop/reset/delete/patch paths and deferred archive custody; their lifecycle and owner boundaries differ materially.
662 src/agents/tools/image-tool.ts READ: use shared media reference projection and canonical loaded-reference property; descriptors and image transport unchanged.
662 src/agents/tools/web-fetch-visibility.ts READ: no sound deletion. Attribute grammar and HTML namespace/scope recovery differ intentionally from display extraction; merging them would change hidden-content handling.
657 src/agents/tools/media-tool-shared.ts READ: one concrete media reference projector replaces callbacks/key descriptors and native-image duplicate; existing uniqueStrings owns candidate deduplication.
644 src/agents/failover/user-copy.ts READ. Retained distinct public copy surfaces and ordered redaction/classification. Prior passes already unified base rendering and removed redundant replacement branches; remaining duplication is intentionally different user wording.
634 src/agents/tools/system-agent-tool.ts READ: one optional string projection replaces repeated per-action normalization and absent-property omission; exact approval hashing and secret handling remain unchanged.
622 src/agents/auth-profiles/profiles.ts READ — Selection, profile removal, peer reconciliation and success bookkeeping retain separate locks and conditional compensation.
615 src/agents/modes/interactive/theme/theme.ts READ — retained theme schema, palette conversion, proxy identity and distinct foreground/background public methods; no behavior-neutral structural reduction beyond previously merged consolidation.
610 src/agents/tools/sessions-search-tool.ts READ — Derive incoming hit field names from the result schema and the visibility checker parameter from its canonical owner; preserve ordering and access policy.
604 src/agents/auth-profiles/oauth.ts READ — Unified OAuth access result projection across selected/fallback paths; removed duplicate result shape and trivial bootstrap/test forwarding.
602 src/agents/tools/video-generate-tool.ts READ: one positional reference/role parser serves image/video/audio cases in the same validation order; shared result projection replaces repeated descriptor objects.
594 src/agents/sandbox/browser.ts READ: share registry allocation facts between early managed-workspace reservation and final port publication; preserve bridge lifetime and restart authority.
578 src/agents/runtime/proxy.ts READ — proxy SSE transport carries distinct timeout/error/cancellation ownership; canonical assistant stream has additional thinking-state semantics, so retained local stream class.
577 src/agents/auth-profiles/runtime-read.ts READ — Synchronous SDK compatibility and async admitted worker reads are named contracts; snapshot and settlement authority retained.
568 src/agents/tools/skill-workshop-tool.ts READ: action branches encode distinct read/patch/revision authority and mutation budgets; l121 already removed duplicate patch composition.
565 src/agents/tools/sessions-history-tool.ts READ — l121 already consolidated message sanitation; anchor-aware hard caps, pending-input caps, and pagination have different contracts and remain separate.
545 src/agents/tools/mobile-ui-tool.ts READ: reused canonical safe-integer range validation while preserving all tool-specific errors. Kept payload validation because node.list only casts rows; confirmation and snapshot invalidation are live action boundaries.
542 src/agents/auth-profiles/oauth-refresh-failure.ts READ — Prior #159346 already consolidated classification; error redaction and durable-settlement provenance remain necessary.
531 src/agents/tools/image-generate-tool.ts READ: shared concrete media reference projection. Existing provider selection and count/resolution policy retained.
530 src/agents/agent-hooks/compaction-safeguard-quality.ts READ — fallback summary validation now uses the existing ordered-section parser, removing a second required-heading order scanner. Existing headings, summary text, quality rules, retention allocation, and prompt instructions remain unchanged.
529 src/agents/tools/message-tool-schema.ts READ: static field groups are the existing descriptor owner; further collapsing risks schema drift for little simplification.
512 src/agents/tools/common.ts READ: positive integers reuse nonnegative integer validation; inline one-use progress and file-image forwarding helpers. Keep public failedTextResult/asToolParamsRecord contracts after caller and SDK searches.
511 src/agents/sandbox/context.ts READ: no further sound consolidation; session selection, managed workspace custody, skill projection, and backend/browser provisioning have distinct ordering and authority requirements.
510 src/agents/sandbox/remote-shell-backend.ts READ: bootstrap, one-shot skills refresh, staged exec cleanup, and session disposal each own different lifecycle transitions; no safe deletion identified.
501 src/agents/tools/in-process-gateway.ts READ: derived creation options from the existing in-process options contract instead of redeclaring fields. Retained signed transport vs admitted in-process routing and completion/cleanup lifetime distinctions.
500 src/agents/tools/sessions-resolution.ts READ — Retain session-key/session-id resolution, post-await incognito rejection, and named protocol-v4 mixed-version fallback.
499 src/agents/tools/model-config.helpers.ts READ: reuse the auth owner parameter type and remove naming-only model-ref/auth-signal wrappers and redundant forwarding. Credential selection and direct API versus subscription decisions unchanged.
494 src/agents/tools/gateway-caller-context.ts READ: no sound deletion. Field-specific inheritance precedence and restrict-only authority composition cannot become a generic object merge without changing security semantics.
492 src/agents/sandbox/remote-shell-command.ts READ: heredoc, quote, substitution, and directory-validation parser branches carry different shell contracts; previous shared directory-script owner remains intact.
492 src/agents/tools/computer-tool-request.ts READ: removed one-use coordinate/modifier wrappers and directly assigned parsed key input. Kept action-specific parsing order and released-node includeScreenshot omission.
490 src/agents/sandbox/fs-bridge-path-safety.ts READ: use the real boundary-file owner instead of the test-only facade; retain the post-await mount recheck because container-only mount masks can be aliased.
481 src/agents/auth-profiles/sqlite.ts READ — Distinct admission, raw versus tolerant reads and synchronous SDK writes; further cleanup would require a broader storage cutover.
480 src/agents/auth-profiles/oauth-refresh-peers.ts READ — Rollback, terminal fencing, settlement and removal have different cleanup/state retention semantics; retained exact-generation guards.
476 src/agents/embedded-agent-helpers/openai.ts READ. Shared unchanged-message/content projection, replaced unused parsed-signature object with predicate, inlined the one-use timestamp wrapper and retained main's canonical replay-ID helpers, unified independent legacy result-field updates and stale-block retention.
473 src/agents/embedded-agent-helpers/bootstrap.ts READ. Inlined one-use filename predicates and marker-template closure; retained every marker, budget, rounding rule, and signature contract.
461 src/agents/tools/cron-tool-schema.ts READ: shared job schema already unifies create/update; trigger and management projections intentionally differ.
458 src/agents/sandbox/fs-bridge.ts READ: host-FD reads, mutation checks, and canonical pins cannot safely collapse into the remote bridge, which has no host descriptors.
454 src/agents/failover/classify-core.ts READ. Retained exact provider, status, message/detail, and semantic-code precedence; previous cleanups already consolidated the safe shared predicates.
454 src/agents/tools/cron-tool-creator-cap.ts READ: normalization, duplicate grant intersection, current-job inference, and creator authority gates are distinct security contracts.
449 src/agents/embedded-agent-helpers/turns.ts READ. One future-span collector now derives broad legacy result IDs and trusted named result matches together; one omission-content projection. Signed thinking still cannot trust embedded user content.
441 src/agents/auth-profiles/upsert-with-lock.ts READ — Batch rollback, OAuth generation admission and single upsert differ intentionally; preserved durable-owner checks.
437 src/agents/auth-profiles/order.ts READ — Removed private provider-mode forwarding layers; explicit order, pending refresh and cooldown selection unchanged.
436 src/agents/tools/nodes-tool-media.ts READ: replaced the throwing facing ternary/IIFE with a typed guard; node resolution, payload checks, paths and media writes unchanged.
434 src/agents/sandbox/podman-runtime.ts READ: connection precedence, machine identity, version gates, and bind ownership cover different Podman contracts and are retained.
430 src/agents/failover/classification-rules.ts READ. Retained HTTP 401/403/402/429/410/404/5xx-specific precedence and provider billing contracts; shared projection owner reused by embedded consumers.
425 src/agents/utils/tools-manager.ts READ — replace duplicated in-flight promise-map lifecycle with getOrCreatePromise(evictOnSettled), inline offline flag forwarder, remove narrating comments.
416 src/agents/tools/message-tool-discovery.ts READ: prepared metadata, current source recovery, and scheduled-account projections serve distinct contexts; no sound additional simplification.
412 src/agents/tools/transcripts-tool.ts READ: canonical capture/service owners already handle lifecycle; local authorization and result projection remain necessary. Shared result construction simplified in transcripts-tool-result.ts.
412 src/agents/tools/web-search-provider-common.ts READ: passed date-filter input directly to its canonical range parser instead of rebuilding an identical object. Retained exported SDK wrappers and provider-specific date/freshness behavior.
411 src/agents/auth-profiles/runtime-snapshot-owner.ts READ — Canonical pure owner composition and metadata retention already shared; preserved SecretRef ownership and clone boundaries.
410 src/agents/sandbox/docker-backend.ts READ: one handle-local command adapter supplies both ordinary exec and termination cleanup while each caller retains its own authority callback.
410 src/agents/tools/secrets-tool.ts READ: masked entry, admin-scoped registration, cancellation recovery, and metadata-only output are necessary; do not merge with plaintext ask_user lifecycle.
406 src/agents/sandbox/runtime-status.ts READ: preserve immutable creator isolation, captured worker reads, and byte-identical tool-policy denial descriptions.
405 src/agents/sandbox/validate-sandbox-security.ts READ: lexical/canonical bind validation and reserved-target checks are policy boundaries; no checks removed or reordered.
402 src/agents/auth-profiles/external-cli-sync.ts READ — Reused canonical bootstrap identity policy, deleting its duplicate local implementation and unreachable second rejection.
399 src/agents/auth-profiles/oauth-refresh-fence.ts READ — Serialized backend and native store protocols have distinct transport/cleanup owners; preserved native custody and timeout observation.
392 src/agents/tools/web-fetch-utils.ts READ: no sound deletion. Its display attribute grammar, entity handling, anchor unwinding, and markdown fence behavior differ from visibility sanitization. Shared scanner already owns tokenization.
391 src/agents/tools/dashboard-tool.ts READ: distinct board mutation, transient command, and persisted presentation paths; required/optional tab validation differs.
389 src/agents/tools/media-generate-background.ts READ: removed the outer lifecycle descriptor factory; three kinds use the single shared factory.
388 src/agents/auth-profiles/usage-state.ts READ — Prior #159346 already simplified expiry clearing; score ordering and model/global scope handling remain required.
388 src/agents/tools/sessions-access.ts READ — Inline the denial-only receipt forwarding layer into the existing deny closure and simplify equivalent owned-access return branches.
385 src/agents/auth-profiles/legacy-source-diagnostic.ts READ — Legacy files and recorded refusal lifetime must fail closed; no safe simplification without changing migration diagnostics.
379 src/agents/tools/sessions-send-tool.a2a.ts READ — Retain same-session exact-generation delivery, one-way child completion, internal requester handling, and peer ping-pong; no prompt strings change.
379 src/agents/tools/subagents-tool.ts READ — Remove the redundant unsubscribe forwarder and unused runs projection; preserve registry preparation and cancellation custody.
374 src/agents/tools/pdf-tool.model-config.ts READ: no further sound simplification; explicit/native/image/text candidate ordering and newly landed active-model fallback each own distinct selection behavior.
366 src/agents/tools/video-generate-tool.execution.ts READ: removed standalone role parser after moving validation to reference parsing; shared result projection. Ordered persistence, rollback, URL fallback and metadata probes retained.
358 src/agents/sandbox/registry.ts READ: persisted reservation/removal states and exact-generation custody are retained; moving synchronous legacy paths requires a separate storage-owner cutover.
357 src/agents/sandbox/fs-paths.ts READ: host aliases, container-visible mounts, and canonical host resolution intentionally have different precedence; no safe deletion identified.
354 src/agents/runtime-plan/resolve-auth.ts READ — retained the distinct direct, pinned, and automatic resolution paths; their fallback admission, cooldown recheck, OAuth terminal-error priority, and narrowed store provenance represent different contracts. No further sound simplification identified.
354 src/agents/tools/web-search-output.ts READ: no sound deletion. Separate raw/results/answer/error contracts preserve external SDK compatibility, budget ordering, URL/date validation, and untrusted envelopes.
351 src/agents/tools/cron-tool-canonicalize.ts READ: consolidate ordered schedule aliases with first-match short circuit; preserve untouched conflicts for Gateway rejection and all inference precedence.
349 src/agents/failover/message-patterns.ts READ. Pattern tables are concrete provider compatibility contracts. l121 already simplified billing hints; no safe table deletion or semantic combination found.
345 src/agents/sandbox/remote-shell-transport.ts READ: staged environment secrecy, tar/transport settlement, and upload symlink enforcement are distinct contracts; retained.
340 src/agents/tools/agents-wait-tool.ts READ — Collector waits have different ownership, abort, and completion-consumption rules from native subagent waits; unifying them would obscure those invariants.
332 src/agents/tools/image-tool.model-execution.ts READ: no further sound simplification; timeout matching, compression selection, operator authority and single/multi-image provider dispatch have distinct contracts.
331 src/agents/runtime-plan/types.ts READ — retained the structural leaf contracts: types.test.ts explicitly enforces independence from concrete config/provider/transcript/prompt policy modules. Removing these copies would violate the established import boundary.
331 src/agents/tools/computer-tool.ts READ: no sound deletion. Per-instance action serialization owns frame/button ordering and feeds cleanup drain; existing bounded queues have different admission behavior.
328 src/agents/embedded-agent-helpers/error-text.ts READ. Reused canonical failoverReasonFromClassification instead of redeclaring context-overflow projection. Kept copy priority and provider-owner handling intact.
327 src/agents/sandbox/container-lifecycle.ts READ: allocation provenance, multiple retained sources, revocation, and exact-generation retirement are distinct custody transitions; retained.
324 src/agents/sandbox/registry.kernel.ts READ: row projections preserve persisted fallback and generation semantics; no storage behavior changes.
323 src/agents/tools/music-generate-tool.ts READ: shared result projection; provider lookup remains intentionally lazy and differs from image acquisition.
311 src/agents/tools/embedded-gateway-stub.ts READ: inferred the private history result from the owner instead of redeclaring its 13-field shape; removed narrating header. Kept lazy runtime seam and shared history pagination/capping owners.
310 src/agents/tools/nodes-tool.ts READ: no further sound simplification; action dispatch already delegates media and command owners, while pairing scopes and contextual errors are tool-specific.
296 src/agents/runtime-plan/build.ts READ — observability reuses the already prepared resolvedRef fields instead of reconstructing them. Kept lazy policy/extra-param getters and exact override semantics.
293 src/agents/auth-profiles/external-auth.ts READ — Scoped CLI refresh and authoritative plugin refresh differ intentionally; preserved pin and external-state projection semantics.
293 src/agents/embedded-agent-helpers/sanitize-user-facing-text.ts READ. Retained owner-bound prompt stripping and streaming-prefix state; existing shared filter descriptors already own projections, and further merging risks private-suffix release behavior.
288 src/agents/sandbox/backend.ts READ: public registration generations, reserved factories, and builtin authority dispatch are required contracts; retained.
288 src/agents/sandbox/mount-plan.ts READ: source translation and mountinfo visibility/backing proof prevent hidden-host-file reads; no guards simplified.
286 src/agents/tools/media-generate-background-completion.ts READ: no further sound simplification; pinned requester admission, transcript retention and ambiguous-delivery settlement are distinct durability/authority responsibilities.
284 src/agents/tools/message-tool-visible-content.ts READ: URL/control sanitization has different deletion/fallback semantics; eager attachment alias reads intentionally retain accessor failures.
281 src/agents/session-maintenance/run.ts READ — explicit field projection prevents foreground authority from entering optional maintenance; revalidation/admission/settlement boundaries retained.
276 src/agents/tools/web-shared.ts READ: reused canonical finite/positive/clamped numeric helpers; removed narrowed Response casts while retaining mock-compatible capability probes, bounded reads, charset fallback, cancellation, and partial-body semantics.
273 src/agents/tools/sessions-send-followup.ts READ — Preserve the recently repaired shared observation/parent custody release and lost-ACK reconciliation; neither path is redundant.
272 src/agents/tools/sessions-send-tool.delivery.ts READ — Preserve steering admission, transcript-commit fallback, exact-incarnation checks, and Cron parent fallback restrictions.
271 src/agents/runtime-plan/credential-scoped-model.ts READ — l157505 already removed the redundant materialization wrapper; retained generation memo ownership, native model ownership, rejection eviction, FIFO cap, and run-local caching. No further sound simplification identified.
270 src/agents/sandbox/config.ts READ: replace an unnecessary object assertion with its actual optional-properties type; preserve all configuration precedence.
269 src/agents/embedded-agent-helpers/provider-runtime-failure.ts READ. Replaced five one-use regex-only predicate wrappers with existing/new named regex constants; simplified terminal boolean result without changing failure order.
265 src/agents/sandbox/docker-mount-source.ts READ: daemon/self namespace proof, nested mount translation, and cache identity are different safety boundaries; retained.
263 src/agents/tools/computer-tool-result.ts READ: one projection loop now caps observation and detail element arrays identically without mutating provider input; retained frame image identity and scaled observation-coordinate ownership.
262 src/agents/auth-profiles/sqlite-json.ts READ — Table-specific typed Kysely operations and admission distinctions remain; no schema/persistence changes made.
261 src/agents/tools/image-tool.helpers.ts READ: no further sound simplification; reasoning fallback limits, data URL bounds and providerless model matching protect separate contracts.
261 src/agents/tools/manifest-capability-availability.ts READ: eliminate duplicate manifest capability metadata lookup and one-use auth signal wrapper; retain explicit binding, mode, base URL, and env ordering.
261 src/agents/tools/terminal-tool.ts READ: no sound deletion. Approval lifecycle, exact session identity, policy lookup, and post-await authority/Gateway revalidation are distinct boundaries.
257 src/agents/sandbox/ssh.ts READ: inline key material normalization and secure temporary files preserve SSH/public SDK contracts; prior transport consolidation retained.
255 src/agents/auth-profiles/mutation-lineage.ts READ — Bounded lineage floors and separate credential/state tokens intentionally preserve rollback conservatism.
254 src/agents/sandbox/workspace-mounts.ts READ: exact-target precedence, protected skill roots, and caller bind bytes each have explicit contracts; retained.
252 src/agents/tools/pdf-native-providers.ts READ: no further sound simplification; common HTTP/secret-redaction lifecycle already shared, vendor payload and extraction differ.
248 src/agents/tools/computer-tool-bindings.ts READ: no sound deletion. Attached environments, session transports, Gateway desktop, and paired nodes have different preparation/cleanup/authority owners.
247 src/agents/auth-profiles/inline-usage.ts READ — Durable receipt handling and multi-layer release failures prevent replay; no safe simplification without lifecycle changes.
245 src/agents/auth-profiles/shared-store-bootstrap.ts READ — Migration/bootstrap inspection is a named legacy-store contract; preserved ownership and Linux handle safety.
242 src/agents/tools/music-generate-tool.execution.ts READ: shared reference projection; timing normalization, lyrics sanitization, concurrency and probe metadata retained.
240 src/agents/auth-profiles/sqlite-read.ts READ — Revocable worker read authority, cleanup, and missing/unreadable distinctions are required; no further simplification.
239 src/agents/sandbox/workspace-authority.ts READ: ordered confinement diagnostics and combined tool policies retain their current behavior; no new abstraction justified.
236 src/agents/tools/image-generate-tool.execution.ts READ: shared reference projection; image geometry and persistence behavior retained.
236 src/agents/tools/plugins-tool.ts READ: bounded output, committed-error refresh, and selected-entry guidance are distinct contracts; no sound additional simplification.
235 src/agents/tools/nodes-tool-commands.ts READ: no further sound simplification; existing shared invocation tail preserves action-specific parse ordering and generic-invoke policy.
231 src/agents/tools/gateway-tool.ts READ: inlined the one-use config path splitter into the path resolver. Retained config projection bounds and owner/operator-schedule update admission.
226 src/agents/sandbox/manage.ts READ: provider probes remain scope-filtered and retirement revalidates exact IDs/bridges around awaits; retained.
226 src/agents/sandbox/tool-policy.ts READ: explicit allow/deny semantics and legacy image deny security contract must remain unchanged; previous canonical glob helpers retained.
224 src/agents/failover/assistant-request-failure-copy.ts READ. Distinct bounded schema facts, saved failures, and generic failure rendering already share their owners; retained public wording and status validation.
224 src/agents/session-maintenance/coordinator.ts READ — dependency-order and writer/foreground settlement decisions differ intentionally; canonical deferred/abort owners already used.
219 src/agents/failover/retry-evidence.ts READ. Retained retry-after unit aliases, HTTP-date floor, long/short window priority, and rejected-4xx handling from recent fixes. No behavior-neutral structural deletion remains.
219 src/agents/tools/computer-tool-schema.ts READ: no sound deletion. Model-facing schema and dynamic capability descriptions are hard byte-preservation contracts.
216 src/agents/tools/message-tool-source-policy.ts READ: visible text/directive checks and exact source channel/account/thread/message validation are necessary authority boundaries.
216 src/agents/tools/session-status-model.ts READ — Gateway and standalone mutation owners intentionally differ; preserve operator gating, model visibility, auth-profile compatibility, and storage behavior.
212 src/agents/sandbox/local-workspace-quiescence.ts READ: pause/resume receipts and stopped allocation retirement retain exact-generation custody and settlement order.
212 src/agents/utils/syntax-highlight.ts READ — preserve explicit no-DOM dependency loader and nested-scope rendering/precedence contracts.
211 src/agents/tools/media-generate-tool-actions-shared.ts READ: no further sound simplification; list/status/duplicate output already shares canonical owners, catalog/model capability projection differs deliberately.
207 src/agents/auth-profiles/external-cli-auth-selection.ts READ — Explicit pin/order and ambiguous implicit selection have intentional priority differences.
207 src/agents/auth-profiles/types.ts READ — Persisted, runtime-only and public types retain distinct contracts; no type/API changes needed.
207 src/agents/tools/message-tool-schema-scoping.ts READ: static action groups define the current byte-identical schema projection; existing ownership already consolidated.
207 src/agents/tools/sessions-control-authority.ts READ — Preserve all authority sources, post-await revalidation, target incarnation checks, and irreversible revocation watcher behavior.
205 src/agents/auth-profiles/usage-failure-state.ts READ — Collapsed repeated cooldown model-scope branches while retaining active-window widening and expiry behavior.
204 src/agents/tools/cron-tool-write.ts READ: optimistic revision retry, creator-authority admission, and inherited shell protection are necessary lifecycle boundaries.
202 src/agents/auth-profiles/path-resolve.ts READ — Sync/async ownership cache order and lock digest bytes are contractual; no safe further simplification.

Keep abort checks at the final public return boundaries, including legacy fallback. Complete the cleanup with canonical literal task kinds, bound response reads, unshadowed projections, and a shrinking assertion baseline.
@clawsweeper

clawsweeper Bot commented Sep 29, 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.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: XL labels Sep 29, 2026
@steipete
steipete marked this pull request as ready for review September 29, 2026 09:49
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: 500deef514d77cdd4b8887086a2a3ca1c8ea4251
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/auth-profiles/display.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/auth-profiles/external-cli-sync.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/auth-profiles/identity.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/auth-profiles/oauth-manager.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/auth-profiles/oauth.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/auth-profiles/order.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/auth-profiles/store.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/auth-profiles/usage-failure-state.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/runtime-plan/prepare-auth.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/sandbox/browser.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/sandbox/config-hash.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/sandbox/config.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/sandbox/docker-backend.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/sandbox/docker.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/sandbox/fs-bridge-path-safety.runtime.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/sandbox/fs-bridge-path-safety.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/sandbox/prune.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/sandbox/remote-fs-bridge-paths.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/sandbox/remote-fs-bridge.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/sandbox/remote-fs-bridge.types.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

Carefully review these changes before merging.

@steipete
steipete enabled auto-merge (squash) September 29, 2026 09:55
@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 29, 2026, 9:14 AM ET / 13:14 UTC (Revision 4).

ClawSweeper review

What this changes

The branch consolidates agent tool, credential, sandbox, replay, compaction, and media helpers and adds final cancellation checks to OAuth credential resolution.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep this PR open. Current main retains code that this branch consolidates, so the earlier merged cleanups do not supersede it. No discrete introduced defect is established, but one exact-head child-followup CI failure remains unqualified.

Priority: P2
Reviewed head: 500deef514d77cdd4b8887086a2a3ca1c8ea4251

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has focused boundary evidence and substantial validation, with merge confidence limited by one unexplained exact-head CI failure.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The maintainer-author proof gate does not apply. At the matching PR-body revision, the reported after-change evidence includes real local-shell sandbox execution and tool-surface captures; the OAuth cancellation regression exercises the public resolver with a mocked manager. The refactor changes no identified stored-data format or migration contract.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-author proof gate does not apply. At the matching PR-body revision, the reported after-change evidence includes real local-shell sandbox execution and tool-surface captures; the OAuth cancellation regression exercises the public resolver with a mocked manager. The refactor changes no identified stored-data format or migration contract.
Evidence reviewed 9 items OAuth cancellation change: The introduced patch checks the caller's abort signal after the awaited legacy-profile fallback and before returning its credentials.
Current-main behavior: The pinned current main returns a resolved legacy fallback without that final abort check, establishing distinct work still present in this PR.
Credential identity boundary: The external CLI path now calls the existing shared bootstrap identity policy; the shared policy still checks provider and OAuth identity before adoption.
Findings None None.
Security None None.

How this fits together

OpenClaw's agent runtime receives user requests and model tool calls, selects credentials, and executes tools through Gateway and sandbox boundaries. Replay and compaction then shape the context available to later model turns.

flowchart LR
  A[User request] --> B[Agent runtime]
  C[Stored credentials] --> D[Auth selection]
  D --> B
  B --> E[Tool and sandbox execution]
  B --> F[Replay and compaction]
  E --> G[Gateway actions and artifacts]
  F --> B
Loading

Before merge

  • Resolve merge risk (P1) - The exact-head heartbeat child-followup CI case fails while the corresponding main case passes; bounded passing replays have not established whether the hosted failure comes from this patch, shared test state, or infrastructure.
  • Complete next step (P2) - Complete the bounded diagnosis of the unqualified heartbeat child-followup failure and resolve its CI gate before merge.
Agent review details

Security

None.

PR surface

Source -919, Tests +53, Other -3. Total -869 across 79 files.

View PR surface stats
Area Files Added Removed Net
Source 71 714 1633 -919
Tests 7 106 53 +53
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 5 -3
Total 79 822 1691 -869

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep one owner for each agent contract while preserving credential scope, sandbox containment, replay pairing, and tool output; credential lookup should reject cancellation at its final public return.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep one owner for each agent contract while preserving credential scope, sandbox containment, replay pairing, and tool output; credential lookup should reject cancellation at its final public return.

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

Yes for the incidental OAuth defect: pinned main can return a legacy fallback after cancellation, and the new public-resolver test stages that continuation. I did not execute the test.

Is this the best way to solve the issue?

Yes for the identified cancellation gap: checking the signal after the final awaited fallback is a narrow repair, and the surrounding consolidation reuses existing owners. The heartbeat CI failure still needs attribution.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against aa56d37f1c81.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a broad but largely behavior-preserving agent cleanup with a focused OAuth cancellation repair and no established urgent regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-author proof gate does not apply. At the matching PR-body revision, the reported after-change evidence includes real local-shell sandbox execution and tool-surface captures; the OAuth cancellation regression exercises the public resolver with a mocked manager. The refactor changes no identified stored-data format or migration contract.

Evidence

What I checked:

  • OAuth cancellation change: The introduced patch checks the caller's abort signal after the awaited legacy-profile fallback and before returning its credentials. (src/agents/auth-profiles/oauth.ts:552, 500deef514d7)
  • Current-main behavior: The pinned current main returns a resolved legacy fallback without that final abort check, establishing distinct work still present in this PR. (src/agents/auth-profiles/oauth.ts:574, aa56d37f1c81)
  • Credential identity boundary: The external CLI path now calls the existing shared bootstrap identity policy; the shared policy still checks provider and OAuth identity before adoption. (src/agents/auth-profiles/oauth-shared.ts:78, 500deef514d7)
  • Sandbox boundary: The filesystem bridge now imports the same canonical boundary-file reader directly after removing a test-only forwarding module. (src/agents/sandbox/fs-bridge-path-safety.ts:4, 500deef514d7)
  • Distinct cleanup on main: Current main still has the separate media lifecycle forwarding constructor that the PR removes; the latest release predates this PR. (src/agents/tools/media-generate-background.ts:365, aa56d37f1c81)
  • Pinned PR evidence: The live PR body matches the captured 46,698-UTF-16-unit source hash. It reports real local-shell sandbox validation, byte-identical tool descriptor and prompt captures, and a public OAuth resolver regression using a mocked credential manager. These are contributor-reported results, not tests executed in this review. (500deef514d7)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • hartmark: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Attribute the heartbeat child-followup failure to its owning runtime or fixture, or establish a qualifying main-branch match.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-29T09:58:53.840Z sha 63650d6 :: blocked before merge. :: none
  • reviewed 2026-09-29T10:22:45.596Z sha 4208c17 :: blocked before merge. :: none
  • reviewed 2026-09-29T12:34:12.555Z sha 500deef :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 29, 2026
Restore the existing callback lookup boundary for prepared runtimes and keep the visible-spawn dependency type private. Preserve the remaining cleanup and existing test assertions.
@steipete

Copy link
Copy Markdown
Contributor Author

Coordinator landing note: pre-existing main failures

Exact-head CI on 500deef514d finished with four failing shards, all proven to originate on main (full evidence already in the PR body under ## Evidence):

The PR-owned defect (eager bootstrap-reader access at src/agents/auth-profiles/oauth.ts:232, which broke module load for three suites) was fixed by restoring main's lazy callback; those suites pass on this head. Merged by squash pinned to the exact head under the maintainer's pre-existing-failure rule; main repairs are tracked separately.

@steipete
steipete merged commit dc6e5cd into main Sep 29, 2026
224 of 230 checks passed
@steipete
steipete deleted the deslop/l159-agents-tools-auth branch September 29, 2026 13:23
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
…penclaw#161122)

* refactor(agents): deslop tools, auth profiles, sandbox and failover

* fix(agents): preserve cancellation across profile resolution

Keep abort checks at the final public return boundaries, including legacy fallback. Complete the cleanup with canonical literal task kinds, bound response reads, unshadowed projections, and a shrinking assertion baseline.

* fix(agents): define spawn tool options with the visible spawn owner to break import cycle

* fix(agents): preserve lazy OAuth bootstrap initialization

Restore the existing callback lookup boundary for prepared runtimes and keep the visible-spawn dependency type private. Preserve the remaining cleanup and existing test 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 gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security-sensitive-changed size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant