Skip to content

refactor: await runtime quarantine health writes - #161579

Merged
steipete merged 11 commits into
mainfrom
codex/quarantine-health-writes
Sep 30, 2026
Merged

steipete merged 11 commits into
mainfrom
codex/quarantine-health-writes

Conversation

@steipete

@steipete steipete commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Runtime setup and recovery still perform caller-thread SQLite writes when recording context-engine and tool-schema quarantines. Moving those writes off-thread also requires retaining the selected plugin resources before the first new await.

User Impact

This is an internal persistence migration. Quarantine decisions, stored data, retention, and public callback contracts remain unchanged. Ordinary health writes are awaited; loader activation retains its existing synchronous publication boundary.

Why This Change Was Made

Registration uses the existing plugin-state worker. Recovery selects and deletes current matching rows inside its admitted transaction, without creating or migrating state for a no-op cleanup. Runtime callers join diagnostic writes after synchronous tool normalization and permission publication, before acknowledging completion.

Context-engine resolution captures the exact registrations and retains their native sources before awaiting initialization or quarantine recording. Factories remain lazy. First-factory admission checks current authority; recovery of already-admitted work retains its original resource lifetime and settlement. Rejection, cancellation, and disposal release the retained sources through the existing owner. No public plugin callback becomes asynchronous.

Evidence

  • Real SQLite record/recovery controls demonstrate zero caller-thread data statements, with same-key recovery, cold opening, absent/native-only state, and accepted-write settlement preserved.
  • Current-main receiving passed 168 health, CLI preparation, and compaction cases locally. Subsequent Linux CI passed all 10 quarantine-health cases, including the three process-liveness controls skipped on macOS, and archive E2E passed all 25 cases.
  • The original ordered 23-file lifecycle group reproduced the introduced selection timeout locally: 307 passed, 1 failed, 11 skipped. Corrected capture passed 311 cases with 11 skips, including retained initialization/rejection/cancellation controls. Its unchanged logical-capture path remains covered by that run; final fallback/disposal siblings passed 159 cases and additional CLI/swarm/subagent callers passed 177 cases on macOS/Node 24.21.
  • Core and all 27 test type graphs passed. An obsolete fixture export found by the complete gate was removed; all three dead-code scans and the remaining selected lint/schema/architecture/auth checks then passed. Fresh independent P0–P2 review is clean.

The first executed CI failed before product tests because its tested merge lacked the separate canonical manifest fix; the branch now includes it. The next run exposed a routing-dependent synthetic timing fixture: exact base 207 passed, adding the three required worker-routing rows reproduced five failures. The fixture now names its intended runtime consumers through the real prerequisite resolver, retaining production placement policy and assertions. Actual Linux CI subsequently passed all 207 cases.

That same CI exposed the source-retention regression repaired here; it is not treated as pre-existing or waived. The new head still requires current CI and review. An earlier local CLI timeout was not reproduced and remains unattributed, rather than labelled flaky.

Move ordinary quarantine registration and recovery onto the existing plugin-state worker, preserving namespace, retention, and authoritative in-memory decisions. Join accepted health writes at the actual asynchronous callers without widening public synchronous callbacks.

Keep activation cleanup in the existing synchronous publication frame. Preserve absent/native-only state during no-op recovery and retain current-row admission for real deletion.

Align fixtures with awaited initialization and retain timed-out CLI bodies before global teardown.
@clawsweeper

clawsweeper Bot commented Sep 30, 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 commands Command implementations agents Agent runtime and tooling size: XL labels Sep 30, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. 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 30, 2026
@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 30, 2026, 7:57 AM ET / 11:57 UTC (Revision 9).

ClawSweeper review

What this changes

The branch moves context-engine and tool-schema quarantine writes to the plugin-state worker, awaits their completion, and retains plugin resources across the new waits.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep open. Current main still performs synchronous runtime health writes, and this branch addresses that work through the existing storage owner. The earlier per-key recovery finding is fixed; upgrade and recurring test-cost evidence remain before merge.

Priority: P2
Reviewed head: d603ca33458bfcacf59f200b14dcac1ababe9a03

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The worker-boundary implementation and SQLite validation are strong, with upgrade and CI cost evidence still outstanding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The captured PR evidence reports after-fix recording and recovery through the production health owner and real SQLite worker, observing zero caller-thread data statements and correct row recovery; source tests exercise that boundary and the prior per-key overlap. The separate Doctor upgrade check remains a merge risk. Stored fields, namespaces, and retention are unchanged, so no data-model migration is implicated.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The captured PR evidence reports after-fix recording and recovery through the production health owner and real SQLite worker, observing zero caller-thread data statements and correct row recovery; source tests exercise that boundary and the prior per-key overlap. The separate Doctor upgrade check remains a merge risk. Stored fields, namespaces, and retention are unchanged, so no data-model migration is implicated.
Evidence reviewed 10 items Current main still has caller-thread writes: The current-main health store registers and clears records through the synchronous keyed store; the central worker cutover is not already on main.
Worker-backed record and recovery: Registration uses the asynchronous keyed store; recovery sends selected keys to the plugin-state worker and awaits settlement.
Current-row deletion: The worker checks for existing health rows and reselects matching rows inside its write transaction before deletion.
Findings None None.
Security None None.

How this fits together

Agent setup selects context engines and projects tools from plugin registrations. Failures enter a runtime quarantine and an SQLite health mirror that Status and Doctor can read.

flowchart LR
A[Plugin engines and tools] --> B[Agent setup]
B --> C{Failure detected?}
C -->|Yes| D[Runtime quarantine]
D --> E[SQLite health worker]
E --> F[Status and Doctor]
C -->|No| G[Usable engine and tools]
D --> G
Loading

Before merge

  • Resolve merge risk (P1) - Doctor’s changed runtime context-engine inspection now awaits worker-backed initialization, but the PR does not show the required published-updater-driver × candidate check on existing operator state.
  • Resolve merge risk (P1) - Three tests gain database-worker CI routing and materially changed tests lack reported one-worker wall times and CI seconds, leaving their recurring CI cost unquantified.
  • Complete next step (P2) - Report a published-driver × candidate Doctor check on existing state, single-worker wall times for materially changed tests, and CI seconds for the added worker routes.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +370, Tests +704, Other -1. Total +1073 across 61 files.

View PR surface stats
Area Files Added Removed Net
Source 28 845 475 +370
Tests 32 1430 726 +704
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 61 2275 1202 +1073

Review metrics

Metric Value Why it matters
Production and test growth production +411 net; tests and support +663 net The production growth supports the worker cutover and resource-lifetime handling described in the PR.
Database-worker CI routes 3 added These routes add recurring CI work whose measured cost belongs in the PR evidence.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor/shared/context-engine-host-compat.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Complete upgrade and cost evidence (recommended)
    Report a published-driver × candidate Doctor check using existing state, plus one-worker test wall times and the added routes’ CI seconds.

Technical review

Best possible solution:

Keep the single plugin-state owner for health persistence, with settled writes, retained plugin lifetimes, and verified Doctor upgrade behavior.

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

Yes, from source: current main calls the synchronous keyed store for runtime health registration and recovery. This read-only review did not execute the runtime.

Is this the best way to solve the issue?

Yes, provisionally: the branch uses the existing plugin-state worker and preserves the stored record shape; the Doctor upgrade path still needs its required compatibility check.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded internal runtime-persistence improvement without a demonstrated urgent user regression.
  • merge-risk: 🚨 compatibility: Doctor’s changed initialization path needs the repository-required check against an existing installation’s state.
  • merge-risk: 🚨 automation: The diff changes database-worker test routing and CI timing fixtures, with recurring cost not yet measured.
  • 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. Sufficient (terminal): The captured PR evidence reports after-fix recording and recovery through the production health owner and real SQLite worker, observing zero caller-thread data statements and correct row recovery; source tests exercise that boundary and the prior per-key overlap. The separate Doctor upgrade check remains a merge risk. Stored fields, namespaces, and retention are unchanged, so no data-model migration is implicated.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured PR evidence reports after-fix recording and recovery through the production health owner and real SQLite worker, observing zero caller-thread data statements and correct row recovery; source tests exercise that boundary and the prior per-key overlap. The separate Doctor upgrade check remains a merge risk. Stored fields, namespaces, and retention are unchanged, so no data-model migration is implicated.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Josh Lehman: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: 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.

  • Report the published-driver × candidate Doctor result on existing state.
  • Add one-worker wall times for materially changed tests and CI seconds for the added worker routes.

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 (8 earlier review cycles)
  • reviewed 2026-09-30T03:45:54.904Z sha d4f28f2 :: blocked before merge. :: none
  • reviewed 2026-09-30T04:19:02.142Z sha d4f28f2 :: blocked before merge. :: none
  • reviewed 2026-09-30T04:35:30.409Z sha 0cddabe :: blocked before merge. :: none
  • reviewed 2026-09-30T05:21:56.566Z sha 6e053cc :: blocked before merge. :: none
  • reviewed 2026-09-30T07:37:19.014Z sha cd5c0c5 :: blocked before merge. :: [P2] Clear unaffected recovered keys when another key fails again
  • reviewed 2026-09-30T08:32:23.566Z sha ba9a655 :: blocked before merge. :: none
  • reviewed 2026-09-30T09:59:45.683Z sha 61790c4 :: blocked before merge. :: none
  • reviewed 2026-09-30T11:06:09.428Z sha 000f856 :: blocked before merge. :: none

@steipete
steipete marked this pull request as ready for review September 30, 2026 04:13
Required health-worker routing adds another runtime-backed storage stripe. The timing fixtures assumed an admissible donation but inherited that unrelated runtime prerequisite, leaving an immovable donor remainder above its budget. Call through to the real prerequisite resolver for the four fixture consumers while preserving full inventories, worker and runner policy, and every existing result assertion. Require the first case to share a donor before observations separate it.

Exact base passed all 207 cases; the three routing additions alone reproduced the five CI failures. The corrected fixture passes all 207 plus 112 planner siblings. Selected types, guards, lint, and independent P2 review pass. Production planning policy is unchanged.
Capture registration and native source claims before awaited health writes.
Keep first-factory authority checks distinct from already-admitted fallback
settlement, and retain lazy fallback construction and disposal ownership.

The original ordered 23-file failure reproduces locally; corrected capture
passes 311 cases with 11 skips. Final fallback and caller coverage passes
159 and 177 cases respectively, with real SQLite lifetime controls.
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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 30, 2026
Start existing worker clears per captured tool identity so a renewed failure
cannot veto recovery of another healthy key. Join every clear and remove its
submission only after that operation succeeds and remains current.

The existing before-dispatch overlap reproduces the stale healthy record on
the old batch path. The corrected tool and context health owners pass 14
cases locally, with three Linux-only process controls skipped on macOS.
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 30, 2026
Preserve the original poll, deadline, durable-row assertions, and held old
completion. On failure, report existing model calls and settlements, change
notifications, and abort state without new SQL or success-path logging.

The hosted Linux failure remains unclassified; the fixed-main original
group passed locally. These observations distinguish pending preparation
from model and write progress without weakening the race oracle.
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 30, 2026
Preserve the canonical Doctor test deletion and retain the failure-only
activity diagnostic. Carry the qualified terminal/UI line-cap repair
17d00fc and canonical bootstrap baseline cleanup 0361956.

Affected receiving tests pass 249 cases with 3 Linux-only skips. Retain
the prior lifecycle proof for unchanged sources and source-bound static
repair evidence; the activity race still requires exact-head Linux CI.

Co-authored-by: Vincent Koc <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Sep 30, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 30, 2026
Resolve the sole conflict to the exact canonical #161824 fixture,
replacing the superseded failure-only observation with its actual
publication join. Preserve the delayed prior-owner result and all
persistence and cancellation assertions.

Whole recap owner plus health and Doctor compatibility checks pass
47 cases with 3 Linux-only skips; scoped independent P2 review is clean.
The separately observed Doctor legacy-yes timeout remains unclassified.
Observe the first legacy yes-mode case through its existing test signal.
Keep lazy loading, the original maintenance promise and object, all six
cases, the 30-second deadline, and every outcome assertion unchanged.
Print only phase timings, settlement and migration counts on interruption.

Selected static checks and independent P2 review pass. Local E2E
preparation was refused before tests by the managed Gateway artifact
fence; exact-head isolated CI must supply runtime qualification.
@openclaw-barnacle openclaw-barnacle Bot removed the app: web-ui App: web-ui label Sep 30, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Sep 30, 2026
@steipete
steipete merged commit 3875fd5 into main Sep 30, 2026
210 checks passed
@steipete
steipete deleted the codex/quarantine-health-writes branch September 30, 2026 12:35
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 1, 2026
* refactor: await runtime quarantine health writes

Move ordinary quarantine registration and recovery onto the existing plugin-state worker, preserving namespace, retention, and authoritative in-memory decisions. Join accepted health writes at the actual asynchronous callers without widening public synchronous callbacks.

Keep activation cleanup in the existing synchronous publication frame. Preserve absent/native-only state during no-op recovery and retain current-row admission for real deletion.

Align fixtures with awaited initialization and retain timed-out CLI bodies before global teardown.

* test(ci): make runtime placement prerequisites explicit

Required health-worker routing adds another runtime-backed storage stripe. The timing fixtures assumed an admissible donation but inherited that unrelated runtime prerequisite, leaving an immovable donor remainder above its budget. Call through to the real prerequisite resolver for the four fixture consumers while preserving full inventories, worker and runner policy, and every existing result assertion. Require the first case to share a donor before observations separate it.

Exact base passed all 207 cases; the three routing additions alone reproduced the five CI failures. The corrected fixture passes all 207 plus 112 planner siblings. Selected types, guards, lint, and independent P2 review pass. Production planning policy is unchanged.

* fix(context-engine): retain sources before health initialization

Capture registration and native source claims before awaited health writes.
Keep first-factory authority checks distinct from already-admitted fallback
settlement, and retain lazy fallback construction and disposal ownership.

The original ordered 23-file failure reproduces locally; corrected capture
passes 311 cases with 11 skips. Final fallback and caller coverage passes
159 and 177 cases respectively, with real SQLite lifetime controls.

* test(subagents): expect retained engine initialization callback

* fix(agents): isolate recovered tool quarantine cleanup

Start existing worker clears per captured tool identity so a renewed failure
cannot veto recovery of another healthy key. Join every clear and remove its
submission only after that operation succeeds and remains current.

The existing before-dispatch overlap reproduces the stale healthy record on
the old batch path. The corrected tool and context health owners pass 14
cases locally, with three Linux-only process controls skipped on macOS.

* test(gateway): report activity recap relocation failures

Preserve the original poll, deadline, durable-row assertions, and held old
completion. On failure, report existing model calls and settlements, change
notifications, and abort state without new SQL or success-path logging.

The hosted Linux failure remains unclassified; the fixed-main original
group passed locally. These observations distinguish pending preparation
from model and write progress without weakening the race oracle.

* test(doctor): report interrupted maintenance phase

Observe the first legacy yes-mode case through its existing test signal.
Keep lazy loading, the original maintenance promise and object, all six
cases, the 30-second deadline, and every outcome assertion unchanged.
Print only phase timings, settlement and migration counts on interruption.

Selected static checks and independent P2 review pass. Local E2E
preparation was refused before tests by the managed Gateway artifact
fence; exact-head isolated CI must supply runtime qualification.

---------

Co-authored-by: Vincent Koc <[email protected]>
steipete added a commit that referenced this pull request Oct 14, 2026
* 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: #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.

* 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 (#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.

* 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.
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

agents Agent runtime and tooling commands Command implementations gateway Gateway runtime merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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