Skip to content

refactor(harness): share native output projection operations - #156187

Merged
sjf-oa merged 4 commits into
mainfrom
sjf/agentsapi-shared-projection
Sep 24, 2026
Merged

sjf-oa merged 4 commits into
mainfrom
sjf/agentsapi-shared-projection

Conversation

@sjf-oa

@sjf-oa sjf-oa commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Why

OpenClaw now supports multiple external harnesses that need the same presentation and transcript operations. A shared owner keeps those operations consistent while each adapter retains its native protocol handling.

What Problem This Solves

The Codex harness owns reusable bounded output, attributed message construction, and presentation settlement code. Move that behavior into the existing agent-harness packages so the Agents API adapter can consume it through the official bundled-plugin boundary. This PR targets main and precedes #156182 and the later tools/file-transfer layers.

Changes

  • Move shared native output formatting, message construction, and callback settlement into their agent-harness owners.
  • Keep Codex labels, bounds, normalization, provenance, raw-output precedence, and callback ordering unchanged.
  • Colocate four pure output-formatting tests with their shared implementation, retaining adapter integration tests in the Codex package.
  • Describe shared projection in the harness guide without advertising a private runtime facade as a typed public SDK export.

Evidence

Verified rebased head 51545fd53cb703a582200746556d6c2781b9b0d5:

  • Independent source reviews found no actionable P0-P2 findings.
  • Relocated output-formatting tests pass (4 tests, measured pnpm test src/agents/harness/projection-tool-output.test.ts --maxWorkers=1 wall 3.99 seconds).
  • Affected Codex projection tests pass (34 tests across two files, 53.63 seconds including cold worker preparation).
  • The SDK documentation guardrail and all three extension/plugin-SDK import-boundary modes pass.

Exact-head CI is green. The 103 Node test shards took 10 minutes 10 seconds from first start to last completion; their summed runtime was 6 hours 58 minutes 17 seconds. The longest shard took 9 minutes 58 seconds.

A fresh native Linux/arm64 image built runtime, UI, declarations, and bundled plugins successfully at descendant bdcbcab846d5c18e91ed1a8953ab65dcc72e19c9. The Codex adapter, shared harness owners, and plugin-SDK sources are byte-identical between this PR head and that tested descendant. The packaged Slack plugin required its standalone package-local dependency layout; full plugin loading and dependency resolution passed after that packaging correction. This is descendant-source live proof, not a separately built image at this PR head.

Through ordinary Slack messages, the installed Codex app-server executed two real shell commands, retained exactly one call/result pair per native item, delivered each final answer, and settled without an active run. Two consecutive history reads retained identical messages. The first real command's outer execution result contained both start and completion markers. The normalized observer did not capture a Codex command-output delta, so this evidence does not establish command stdout streaming.

Actual Slack presentation screenshots and their scoped result show the shared rolling commentary/final lifecycle. The full commentary-content case failed because model-written prose included exit/status metadata; that failure is retained. No nonempty reasoning or reconnect result is claimed.

@clawsweeper

clawsweeper Bot commented Sep 23, 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 docs Improvements or additions to documentation agents Agent runtime and tooling extensions: codex size: XL labels Sep 23, 2026
@clawsweeper

clawsweeper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 23, 2026, 9:19 PM ET / September 24, 2026, 01:19 UTC (Revision 6).

ClawSweeper review

What this changes

Moves Codex native output formatting, transcript message construction, and presentation callback settlement into shared agent-harness helpers, updates Codex callers and documentation, and relocates four formatting tests.

Merge readiness

✅ Ready for maintainer review

Keep open. Current main and the latest release lack the shared projection owner, and the open Agents API PR depends on this branch. The updated installed Codex run addresses the earlier delivery and transcript parity concern within its stated scope; this review found no actionable patch defect.

Priority: P3
Reviewed head: 51545fd53cb703a582200746556d6c2781b9b0d5

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) The extraction is coherent, focused checks and the updated installed-path account support parity, and no concrete blocking defect remains.
Proof confidence 🌊 off-meta tidepool Not applicable: The author’s verified maintain permission exempts this PR from the external-contributor proof gate. The updated body describes installed Codex app-server turns through Slack with retained tool rows, final delivery, and settled state on a descendant whose relevant sources match this head; it does not establish command-output delta streaming. The shared helpers do not change a stored-data contract.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The author’s verified maintain permission exempts this PR from the external-contributor proof gate. The updated body describes installed Codex app-server turns through Slack with retained tool rows, final delivery, and settled state on a descendant whose relevant sources match this head; it does not establish command-output delta streaming. The shared helpers do not change a stored-data contract.
Evidence reviewed 9 items Introduced SDK boundary: The pinned merge-base-to-head patch exports message, output, and settlement helpers from the existing production-private harness attempt runtime.
Codex production callers: Codex imports the new helper through the bundled-plugin SDK boundary; its progress owner still appends command output, and finalization still drains pending presentation callbacks.
Current-main necessity: Fetched current main has no shared projection exports and still uses Codex-local output accumulation and settlement.
Findings None None.
Security None None.

How this fits together

Codex app-server sends native turn and item events to OpenClaw’s Codex plugin. The plugin turns those events into bounded progress, transcript messages, and callbacks used by history and reply delivery.

flowchart LR
A[Codex app-server events] --> B[Codex protocol adapter]
B --> C[Shared projection helpers]
C --> D[Transcript messages]
C --> E[Presentation callbacks]
D --> F[OpenClaw history]
E --> G[Reply delivery]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +99, Tests -139, Docs +13. Total -27 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 11 497 398 +99
Tests 3 44 183 -139
Docs 1 13 0 +13
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 15 554 581 -27

Review metrics

None.

Technical review

Best possible solution:

Keep one shared owner for native output, message construction, and callback settlement while Codex retains protocol decoding, approvals, and transcript persistence.

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

Not applicable: this PR reorganizes existing behavior rather than reporting a current-main defect. The relevant parity path is an installed Codex app-server turn.

Is this the best way to solve the issue?

Yes: the existing harness boundary is a suitable owner for reusable projection operations, and the adapter retains Codex-specific protocol and persistence responsibilities.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.

Label justifications:

  • P3: This is a shared-owner refactor with no demonstrated urgent user regression.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author’s verified maintain permission exempts this PR from the external-contributor proof gate. The updated body describes installed Codex app-server turns through Slack with retained tool rows, final delivery, and settled state on a descendant whose relevant sources match this head; it does not establish command-output delta streaming. The shared helpers do not change a stored-data contract.

Evidence

What I checked:

  • Introduced SDK boundary: The pinned merge-base-to-head patch exports message, output, and settlement helpers from the existing production-private harness attempt runtime. (src/plugin-sdk/agent-harness-attempt-runtime.ts:17, 51545fd53cb7)
  • Codex production callers: Codex imports the new helper through the bundled-plugin SDK boundary; its progress owner still appends command output, and finalization still drains pending presentation callbacks. (extensions/codex/src/app-server/event-projector-tool-progress.ts:104, 51545fd53cb7)
  • Current-main necessity: Fetched current main has no shared projection exports and still uses Codex-local output accumulation and settlement. (src/plugin-sdk/agent-harness-attempt-runtime.ts:15, 10145049f817)
  • Release check: The latest release resolves to the recorded release commit and does not contain the new shared projection files; the PR head is in no local tag. (eb377ac59e6c)
  • Installed-path evidence: The updated PR body reports ordinary Slack turns through an installed Codex app-server, one call/result pair per native item, delivered final answers, settled runs, and identical repeated history reads. It expressly does not claim an observed command-output delta. GitHub comparison lists only Agents API files and its docs between the reviewed head and the tested descendant, supporting the stated source identity for this PR’s owners. (51545fd53cb7)
  • Storage boundary: The changed guide says the shared helpers construct messages while the existing scoped transcript APIs persist them; no stored-data schema or format change appears in the introduced patch. Public docs: docs/plugins/codex-harness.md. (docs/plugins/codex-harness.md:25, 51545fd53cb7)

Likely related people:

  • Peter Steinberger: Raw commit f636823 adds extensions/codex/src/app-server/event-projector-settlement.ts:67 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f6368237e967; files: extensions/codex/src/app-server/event-projector-settlement.ts)
  • Sarah Fortune: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • RoboClaw: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (5 earlier review cycles)
  • reviewed 2026-09-23T04:59:58.179Z sha f1a9fd2 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-23T05:11:43.707Z sha 69216a4 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-23T07:43:19.555Z sha 1b8e97a :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-24T00:29:40.718Z sha 51545fd :: blocked before merge. :: none
  • reviewed 2026-09-24T00:37:58.675Z sha 51545fd :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 23, 2026
@sjf-oa
sjf-oa force-pushed the sjf/agentsapi-tools-files branch from f1b0cf9 to d3b4859 Compare September 23, 2026 07:24
@sjf-oa
sjf-oa force-pushed the sjf/agentsapi-shared-projection branch from 69216a4 to 6568fc5 Compare September 23, 2026 07:24
@sjf-oa
sjf-oa force-pushed the sjf/agentsapi-tools-files branch from d3b4859 to 8221c2e Compare September 23, 2026 07:32
@sjf-oa
sjf-oa force-pushed the sjf/agentsapi-shared-projection branch from 6568fc5 to 1b8e97a Compare September 23, 2026 07:32
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 23, 2026
@sjf-oa
sjf-oa force-pushed the sjf/agentsapi-shared-projection branch from 1b8e97a to ca34ddd Compare September 24, 2026 00:10
@sjf-oa
sjf-oa requested a review from a team as a code owner September 24, 2026 00:10
@sjf-oa
sjf-oa changed the base branch from sjf/agentsapi-tools-files to main September 24, 2026 00:10
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor 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: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 24, 2026
@sjf-oa

sjf-oa commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review the current head 51545fd with the updated CI, native package build, and installed Codex evidence in the PR body. Fresh native Linux/arm64 live proof ran at descendant bdcbcab; a source comparison confirms the Codex adapter, shared harness owners, and plugin-SDK sources are unchanged between these heads. Ordinary Slack messages executed real Codex shell commands, retained exactly-once native call/result history, delivered final answers, and settled with no active run. Repeated history reads are identical. The package build compiled runtime, UI, and declarations; actual full plugin loading and dependency ownership were verified.

The proof scope and remaining gaps are explicit in the body. The normalized observer did not capture a Codex command-output delta. These observations do not imply a command-streaming regression or claim unobserved streaming. This is a review request, without permission to apply logic changes.

@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Sep 24, 2026
@sjf-oa
sjf-oa merged commit f8db002 into main Sep 24, 2026
233 checks passed
@sjf-oa
sjf-oa deleted the sjf/agentsapi-shared-projection branch September 24, 2026 01:27
@sjf-oa

sjf-oa commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 24, 2026
…w#156187)

* refactor(harness): share native output projection operations

* style(harness): satisfy shared projection lint rules

* test(agents): colocate native output formatting coverage

* docs(harness): describe shared projection at its owner

---------

Co-authored-by: Sarah Fortune <[email protected]>
@roboclaw-bot roboclaw-bot mentioned this pull request Sep 24, 2026
2 of 8 tasks
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 docs Improvements or additions to documentation extensions: codex P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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.

2 participants