Skip to content

refactor: deslop old agents and Apple code (round-3 bundle C) - #172002

Merged
steipete merged 6 commits into
mainfrom
deslop/bundle-old-r3c-20261013
Oct 14, 2026
Merged

steipete merged 6 commits into
mainfrom
deslop/bundle-old-r3c-20261013

Conversation

@steipete

@steipete steipete commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Consolidates three reviewed old-code cleanup lanes without carrying changes to recently edited owners.

User Impact

No intended appearance, protocol, configuration, persistence, or permission-prompt change. Two rare presentation/resource invalidation windows are deliberately best effort; current selection and route authority remain enforced.

Why This Change Was Made

The bundle credits source lanes q10, q01, and q02:

  • q10 (2500459d47b): agent presentation settlement, provider-process bookkeeping, sandbox validation, generated-media rollback, JSON-normalized result previews, directory helpers, and identical export-CSS declaration consolidation. Retained production reduction: 115 lines.
  • q01 (8a41b173d67): shared Apple source-resource task cancellation and SDK-owned async microphone permission requests. Production reduction: 26 lines.
  • q02 (5442c78cccd): Watch credential selection and QuickChat popup observation cleanup. Production reduction: 21 lines.

Combined: 162 production lines removed; 40 net lines removed including tests (+286/-326 across 17 files).

The full source commit ranges were assembled on then-current main. Quarantine and Live Activity restoration commits were reconciled by retaining main, not by applying the restoration commits alone. The seven-day rule also excludes the entire recently edited MCP reload test. Its preserved invalidation regression requires retaining the combined-catalog implementation, so that production simplification is dropped too. Non-test cleanup files remain subject to the seven-day rule; the assembly floor is waived. A narrow maintainer-approved exception permits the test-only MCP invalidation fixture repair described below.

Best-effort tradeoffs accepted

  • Source-resource invalidation may admit one favicon request using an already-prepared context snapshot. Owned-task cancellation prevents canceled work being published; the next lookup rediscovers. Live route checks and Gateway disabled-fetch policy remain.
  • An already-open QuickChat menu may retain stale labels until closed. The selection owner still rejects unavailable/revoked choices before dispatch. Watch bootstrap-only 401 fallback, voice-grant restrictions, live generations, and durable consumed-bootstrap handoff remain.
  • A local provider process can exit just after readiness; the following request reports that exit rather than adding another post-start probe. Replacement waits for process-tree cleanup; stop retry and retirement ownership remain.
  • Presentation adapters drain after projection, rather than synchronously draining their own callback invocation. Concurrent callback settlement and failure logging remain covered.
  • Refreshing an expired primary-probe cache key can retain its earlier insertion position and permit an earlier reprobe after capacity eviction. Post-write expiry and capacity bounds remain.
  • Enumerable host-prototype pollution can affect bounded descriptive result samples; retained JSON, reference identity, output budgets, and execution authority do not change. The production caller supplies freshly parsed JSON.

The source-lane provenance identifies synthetic timing regressions/feature work rather than reported human incidents for these removed redundant fences. Sandbox policy and generated-media all-or-nothing results, sibling-write draining, and best-effort rollback are retained.

Evidence

Fresh final-index Codex review through P2 is scoped-clean. Targeted lint/format, lint-suppressions (3/3), runtime import cycles (0), Madge cycles (0), core types, agents-root/tools test types, and extension production/test types passed. Every retained production blob matches its credited source lane.

The isolated single-worker full MCP file replay on bundle head 817ef1039dce9e99c04b248526d276bd617ae6e6 finished 55 passed / 2 failed; freshly fetched main 0a02f880f86ac9b14d1d5058956f979a6a440fca finished 56 passed / 1 failed. Both runs were admitted below five-minute load 60 (head 58.50; main 57.77), with isolated HOME/state/cache and --maxWorkers=1. No assertion, timeout, retry, skip, or suppression was changed.

Required case / observed failure Bundle head Main Attribution
Catalog retry without stalling healthy siblings PASS, 3627 ms PASS, 2891 ms Historical lane failure not reproduced on either head.
Concurrent catalog loading PASS, 1819 ms PASS, 1702 ms Historical lane failure not reproduced on either head.
In-progress connections after invalidation FAIL, 2021 ms; notification log empty PASS, 1597 ms Historical head-only result retained; repaired fixture awaits exact-head CI proof.
Timed-out shared-session retirement FAIL, 2014 ms; initialize PID log empty FAIL, 1381 ms; same empty initialize PID log Inherited matching failure.
Provider health-response socket cleanup FAIL, unchanged 1000 ms socket-close wait FAIL, same case/assertion/line/budget Inherited matching failure.

Additional focused replay: 114 passed, 1 failed (the inherited provider case above), 3 existing platform skips. One bounded exact-case invalidation control passed on each original revision, without code changes; this was attribution evidence, not a claimed repair. No causal retained production hunk has been identified to drop.

The test-only repair in b2f3026a0d029503bea67c628959e514a087d6e9 replaces the startup-dependent 200 ms overlap assumption with explicit fixture releases. It observes the real client's catalog publish and then invalidate while the sibling initialize handshake remains held; only then does it request the second catalog and release that handshake. Every original assertion and deadline is retained. Scenario setup is extracted to a test fixture so the already oversized test file shrinks. Fresh independent review through P2, targeted lint/format/types, and the line-cap ratchet pass. This repairs deterministic scenario ordering; it does not claim the historical empty-child-log startup timeout was causally fixed.

The coordinator withdrew the local load-60 gate and selected exact-head PR CI as the full MCP-file proof. Run 38598135837, on head b2f3026a0d029503bea67c628959e514a087d6e9, passed all 57 MCP runtime cases in the runtime shard: catalog retry 400 ms, concurrent loading 303 ms, connection invalidation 255 ms, and timed-out retirement 1261 ms. No green MCP replay or CI rerun was requested.

The same CI run finished red on two other jobs. Its failure table used scheduled-main run 38590548763; these are not automatically classified as inherited:

Job CI failure / classification Focused investigation
Extension package boundary Full shared SDK declaration emit exceeded unchanged 300000 ms; publication then lacked a current full receipt. New: comparable main job passed, selected scope not compared. Exact failed SDK preparation step timed out at both CI merge and pinned baseline locally. CPU starvation makes these replays inconclusive for causal attribution. A qualified remote comparison has not yet produced a result.
Node shard 23 Gateway sessions-list bulk metadata/backfill case exceeded unchanged 120000 ms. Unknown: no matching main shard. Only that case replayed, isolated state and --maxWorkers=1: CI merge passed 65905 ms; baseline passed 55200 ms. Gateway/session owners are unchanged by this bundle. Passing controls are not claimed as a repair.

CI checked merge 09b2e05f8be3e0d68769c569f94caf30f996d261 over baseline 909445622007513254df125e57026c833df46dec; controls use those exact revisions and frozen dependencies. No timeout, assertion, suppression, skip, or baseline was loosened. The inherited-only landing exception remains unavailable until the outstanding attribution is established; failed CI is not claimed green.

Retained Apple files match the source-lane blobs byte-for-byte. Reused native evidence: q01 macOS/iOS Simulator/watchOS Simulator arm64 builds passed; actual production-package tests passed (17 VoiceNote XCTest cases and 18 resource SwiftTesting declarations, including parameterized cases). q02 macOS product/test compilation passed; iOS/embedded Watch Xcode opaque compile failure class also reproduced on pristine main and is accepted as environmental. This is not a passing iOS/Watch runtime claim. No retained Apple file changed during conflict resolution, so no redundant native rebuild was run.

Source-lane gaps remain explicit: Intel, app-hosted native UI/sandbox tests, and live microphone effects were not run. Earlier broad changed-check attempts had unresolved timeouts in untouched signing/elevation-artifact fixtures; those are not retrospectively classified as inherited CI failures. Export CSS declarations/cascade were compared, with no intended visual change; no rendered screenshot claim. PR CI is the broad proof, with no CI reruns for green.

Use one catalog discovery pass, local-process stop promise, presentation
completion path, diagnostic recovery batch, and generated-media rollback
owner. Reuse directory parameter declarations and keep sandbox validation
at its existing boundary without repeating the same blocked-path checks.
Remove the duplicate full-map primary-probe prune.
Trust JSON-normalized result previews and group identical session-export
style declarations without changing their visibility or cascade rules.

Keep auth/approval/sandbox policy, normal child and write settlement,
transcript/user-data durability, public signatures and Phase E unchanged.
Production reduction: 147 net lines across ten old-only files.

Best-effort tradeoffs accepted

- MCP list_changed during held sibling discovery: #138694 added a synthetic
  forced-overlap replay, not a cited human incident. The next load refreshes
  the catalog instead; retirement and execution authority remain enforced.
- Competing catalog producer finalization: the same private owner forbids a
  replacement while its promise is present, so the identity recheck is an
  internal invariant, not a realistic concurrency boundary.
- Local-service post-readiness exit: #154133 describes synthetic parallel
  qualification, not a human report requiring another health check. The
  following request reports an exit after readiness; normal shutdown still
  joins the child, streams and pending termination work.
- Local-process stop identity: replacement starts only after the retained
  authoritative process finishes stopping. The duplicate process reference
  and identity comparisons cannot observe another production replacement;
  failed-stop retry and the retiring marker remain intact.
- Synchronous presentation self-drain: #156187 extracted this reservation
  without a cited human incident. Production adapters drain after projection;
  callbacks return their own work instead of reserving it before invocation.
- Quarantine recovery overlap: #161579 explicitly introduced per-key and
  generation fencing for synthetic before-dispatch/after-reply controls.
  Same-key overlap can leave a stale or missing status warning until a later
  failing run or existing TTL. Actual tool exclusion, logs/events, accepted
  writes, stored shapes and worker/SQL contracts remain unchanged.
- Primary-probe cache insertion order: #82707 introduced duplicate pruning.
  Post-write expiry and capacity bounds remain; refreshing an expired key
  can retain an earlier insertion position and permit an earlier reprobe
  after capacity eviction. This is a bounded best-effort throttle cache.
- Preview host-prototype pollution: #147278 added own-property gates as part
  of result retention, not a human inherited-property failure report; linked
  #147105 proposes the feature. The sole caller passes freshly parsed JSON.
  A polluted host Object.prototype can affect bounded descriptive samples;
  retained JSON, reference identity and execution authority remain unchanged.
The discovery/revocation fixture held HTTP tools/list while cold-starting
its stdio sibling. Slow startup could exhaust the existing ten-second
listing deadline before the test reached revocation, producing a timeout
diagnostic or an empty healthy-tool list instead of exercising its overlap.

Warm the non-held sibling through its actual runtime owner first, then hold
the other server's discovery across revocation. Keep every assertion,
deadline, runtime authority check, and cleanup path unchanged.

The two affected cases pass through the production materialization path;
focused lint, format, and the owning test type graph also pass. The earlier
four short-deadline MCP runtime failures remain separately unattributed.
Use cancellation of owned source-resource tasks instead of a revision
counter. Use native async microphone permission APIs instead of manual
authorization-state switches and callback continuations.

Best-effort tradeoffs accepted:
- Resource revision tracking (#148906, feature request #148850, not a
  human invalidation-race incident): invalidation between prepared context
  and favicon task admission may allow one lookup with that snapshot;
  later lookups rediscover. Live route authority and Gateway disabled-fetch
  policy remain enforced.

No protocol, persisted shape, config, permission-prompt or signing changes.
Net production reduction: 26 lines (+10/-36); no test changes. Phase E
untouched. Pager/notification changes were excluded after #171772 made
their files recent under the seven-day rule. BELOW-500 coordinator bundle.

Remaining source is byte-identical to the independently reviewed checkpoint.
macOS/iOS Simulator/watchOS Simulator arm64 platform builds passed.
Actual production-package focused tests passed: 17 VoiceNote XCTest cases
and 18 source-resource SwiftTesting declarations including parameters.
SwiftFormat, SwiftLint, runtime/madge cycles (zero), lint-suppressions,
native-state guard and localization verification passed.

Broad check-changed is not green: one bounded reproduction retained ten
20-second artifact-fixture subprocess timeouts and one 120-second signing
fixture timeout. Unchanged tooling paths do not run these Swift sources;
these are unresolved local failures, not proven hosted-main-red.
Intel execution, app-hosted native UI tests requiring an OS sandbox and
live microphone effects are not proven. No release_gate or remote lease.
Keep the recently edited reload regression file and its current combined-catalog implementation unchanged from main. Preserve the final source-lane trees for quarantine and Live Activity while retaining newer main behavior.

This supersedes the historical source-commit inventories and MCP/quarantine/activity timing tradeoffs. Final bundle: 162 production lines removed; 112 net lines removed including tests (+166/-278, 14 files). Credit source lanes q10, q01 and q02. Fresh final-index review found no actionable P0-P2 defects. Focused proof and exact-head PR CI remain the landing gates.
@clawsweeper

clawsweeper Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added app: ios App: ios app: macos App: macos agents Agent runtime and tooling size: M labels Oct 14, 2026
Hold sibling initialization across client-observed catalog invalidation. Preserve the existing assertions and deadlines; isolate scenario setup so the oversized runtime test does not grow.
@steipete
steipete marked this pull request as ready for review October 14, 2026 16:26
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T16:31:11.061885Z b2f3026 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: b2f3026a0d029503bea67c628959e514a087d6e9
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/sandbox/validate-sandbox-security.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

Copy link
Copy Markdown
Contributor Author

Coordinator merge at exact head b2f3026, under the exception for failures unrelated to this change. All 57 MCP cases passed on this head, including the invalidation case the fixture repair targeted.

Failed job Failure Why it is unrelated to this PR
check-additional-extension-package-boundary plugin-sdk boundary dts preparation timed out after 300000ms This PR changes no plugin-sdk or extensions files (it touches apps/, src/agents, src/auto-reply/reply, src/channels/plugins only); the failure is a build-prep timeout
checks-node-changed-compact-large-23 src/gateway/server.sessions.list-changed.test.ts timed out at 120000ms No src/gateway or sessions files touched; the test passed in local replays at both this head and main
openclaw/ci-gate aggregate Downstream of the two rows above

The cancelled auto-response, dispatch and PR-context runs were superseded by later runs. No CI reruns were used.

@steipete
steipete merged commit c3111ae into main Oct 14, 2026
218 of 226 checks passed
@steipete
steipete deleted the deslop/bundle-old-r3c-20261013 branch October 14, 2026 17:39
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 15, 2026
…aw#172002)

* refactor(agents): simplify old runtime bookkeeping

Use one catalog discovery pass, local-process stop promise, presentation
completion path, diagnostic recovery batch, and generated-media rollback
owner. Reuse directory parameter declarations and keep sandbox validation
at its existing boundary without repeating the same blocked-path checks.
Remove the duplicate full-map primary-probe prune.
Trust JSON-normalized result previews and group identical session-export
style declarations without changing their visibility or cascade rules.

Keep auth/approval/sandbox policy, normal child and write settlement,
transcript/user-data durability, public signatures and Phase E unchanged.
Production reduction: 147 net lines across ten old-only files.

Best-effort tradeoffs accepted

- MCP list_changed during held sibling discovery: openclaw#138694 added a synthetic
  forced-overlap replay, not a cited human incident. The next load refreshes
  the catalog instead; retirement and execution authority remain enforced.
- Competing catalog producer finalization: the same private owner forbids a
  replacement while its promise is present, so the identity recheck is an
  internal invariant, not a realistic concurrency boundary.
- Local-service post-readiness exit: openclaw#154133 describes synthetic parallel
  qualification, not a human report requiring another health check. The
  following request reports an exit after readiness; normal shutdown still
  joins the child, streams and pending termination work.
- Local-process stop identity: replacement starts only after the retained
  authoritative process finishes stopping. The duplicate process reference
  and identity comparisons cannot observe another production replacement;
  failed-stop retry and the retiring marker remain intact.
- Synchronous presentation self-drain: openclaw#156187 extracted this reservation
  without a cited human incident. Production adapters drain after projection;
  callbacks return their own work instead of reserving it before invocation.
- Quarantine recovery overlap: openclaw#161579 explicitly introduced per-key and
  generation fencing for synthetic before-dispatch/after-reply controls.
  Same-key overlap can leave a stale or missing status warning until a later
  failing run or existing TTL. Actual tool exclusion, logs/events, accepted
  writes, stored shapes and worker/SQL contracts remain unchanged.
- Primary-probe cache insertion order: openclaw#82707 introduced duplicate pruning.
  Post-write expiry and capacity bounds remain; refreshing an expired key
  can retain an earlier insertion position and permit an earlier reprobe
  after capacity eviction. This is a bounded best-effort throttle cache.
- Preview host-prototype pollution: openclaw#147278 added own-property gates as part
  of result retention, not a human inherited-property failure report; linked
  openclaw#147105 proposes the feature. The sole caller passes freshly parsed JSON.
  A polluted host Object.prototype can affect bounded descriptive samples;
  retained JSON, reference identity and execution authority remain unchanged.

* test(agents): warm MCP sibling before held discovery

The discovery/revocation fixture held HTTP tools/list while cold-starting
its stdio sibling. Slow startup could exhaust the existing ten-second
listing deadline before the test reached revocation, producing a timeout
diagnostic or an empty healthy-tool list instead of exercising its overlap.

Warm the non-held sibling through its actual runtime owner first, then hold
the other server's discovery across revocation. Keep every assertion,
deadline, runtime authority check, and cleanup path unchanged.

The two affected cases pass through the production materialization path;
focused lint, format, and the owning test type graph also pass. The earlier
four short-deadline MCP runtime failures remain separately unattributed.

* refactor(apple): simplify source resources and microphone permission

Use cancellation of owned source-resource tasks instead of a revision
counter. Use native async microphone permission APIs instead of manual
authorization-state switches and callback continuations.

Best-effort tradeoffs accepted:
- Resource revision tracking (openclaw#148906, feature request openclaw#148850, not a
  human invalidation-race incident): invalidation between prepared context
  and favicon task admission may allow one lookup with that snapshot;
  later lookups rediscover. Live route authority and Gateway disabled-fetch
  policy remain enforced.

No protocol, persisted shape, config, permission-prompt or signing changes.
Net production reduction: 26 lines (+10/-36); no test changes. Phase E
untouched. Pager/notification changes were excluded after openclaw#171772 made
their files recent under the seven-day rule. BELOW-500 coordinator bundle.

Remaining source is byte-identical to the independently reviewed checkpoint.
macOS/iOS Simulator/watchOS Simulator arm64 platform builds passed.
Actual production-package focused tests passed: 17 VoiceNote XCTest cases
and 18 source-resource SwiftTesting declarations including parameters.
SwiftFormat, SwiftLint, runtime/madge cycles (zero), lint-suppressions,
native-state guard and localization verification passed.

Broad check-changed is not green: one bounded reproduction retained ten
20-second artifact-fixture subprocess timeouts and one 120-second signing
fixture timeout. Unchanged tooling paths do not run these Swift sources;
these are unresolved local failures, not proven hosted-main-red.
Intel execution, app-hosted native UI tests requiring an OS sandbox and
live microphone effects are not proven. No release_gate or remote lease.

* refactor(apple): consolidate activity refresh and watch connection paths

* refactor(agents): retain recent MCP contracts in old-code bundle

Keep the recently edited reload regression file and its current combined-catalog implementation unchanged from main. Preserve the final source-lane trees for quarantine and Live Activity while retaining newer main behavior.

This supersedes the historical source-commit inventories and MCP/quarantine/activity timing tradeoffs. Final bundle: 162 production lines removed; 112 net lines removed including tests (+166/-278, 14 files). Credit source lanes q10, q01 and q02. Fresh final-index review found no actionable P0-P2 defects. Focused proof and exact-head PR CI remain the landing gates.

* fix(test): synchronize MCP connection invalidation fixture

Hold sibling initialization across client-observed catalog invalidation. Preserve the existing assertions and deadlines; isolate scenario setup so the oversized runtime test does not grow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant