Skip to content

fix(models): keep native models available after worker publication - #134524

Merged
steipete merged 11 commits into
openclaw:mainfrom
jason-allen-oneal:agent/fix-codex-model-catalog-publication
Sep 3, 2026
Merged

steipete merged 11 commits into
openclaw:mainfrom
jason-allen-oneal:agent/fix-codex-model-catalog-publication

Conversation

@jason-allen-oneal

@jason-allen-oneal jason-allen-oneal commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #134460.

What Problem This Solves

Native account models could appear unavailable in the New Session picker after a worker published the model catalog. Both models.list and chat.metadata must reflect readiness observed by the Gateway's current prepared runtime.

Why This Change Was Made

Native readiness belongs to a process and a prepared generation. Serializing model rows and auth facts from a worker does not transfer that readiness into the Gateway. The parent now re-observes native models through the prepared plugin registry before publishing the catalog. Both public projections retain that registry and the worker's paired auth facts.

The maintainer pass improves the incoming fix at two additional ownership boundaries: reusing a registry cannot keep a retired generation alive, and cloning configuration without changing its catalog stamp preserves the original configuration identity used for native observations. Current configuration still owns routing and policy; the original observation configuration is used only at the native callback boundary. Missing paired worker auth is rejected instead of reconstructed from ambient state.

This keeps one parent-owned readiness path. The change removes the duplicate generation predicate, retains deferred catalog loading, and moves unchanged configured-inventory helpers out of the oversized projection module. Serializing process-local observations or consulting an ambient registry would detach readiness from the generation that supplied the models.

Production: +201/-84 (net +117) across 12 files. Tests/support: +661/-41 (net +620) across 28 files. Seventy production lines are an unchanged move between modules. The remaining growth carries the private generation predicate, observation identity and paired-auth contract through the existing publication and projection boundaries. No public configuration, SDK, database or protocol surface is added.

User Impact

Native models remain selectable after worker-backed catalog refreshes. Replaced or closed generations cannot continue publishing readiness, while catalog-neutral configuration edits preserve valid native observations. Existing route policy and auth ownership remain authoritative.

Thanks to @jason-allen-oneal for the original fix and regression coverage. The contributor's commits remain in the branch, together with the maintainer's ownership improvements and focused fixture corrections.

Evidence

Validation used isolated Linux workers with fresh private state, public networking and no IAM or host credentials. Current head 5c3ab13dc4c346a8780c8ab3acd128b307babdcc has exactly the same Git tree as reviewed and natively tested head 94dec2743bd77a95ec5d4ce6213f0b179aaaf3ee: ba706cf86f30e6df58d30eec231e82d14580c671. The contributor amended commit metadata; the complete tree-to-tree diff is empty.

  • Before editing, the worker-publication reproduction failed its native-model availability assertion. Independent generation-reuse and catalog-neutral-config cases also failed on the pre-fix owner. The repaired worker and owner/lifecycle cases pass.
  • The latest native checkpoints contain 183 distinct passing tests across 15 files: 147 owner/sibling cases in 11 complete files, four selected discovery cases, 31 cases in the two updated test files, and one isolated CLI recovery process case. The discovery selection skips 34 other cases; the other listed runs have no skips. Coverage includes worker publication, generation replacement and closure, config observation identity, paired auth, model listing, chat metadata and the real worker boundary. Scoped compiler, formatting and lint checks pass.
  • The canonical full pnpm build passes on genuine parent 05b60fd161e8ea9a3e389e20df1525a2f329230a, including UI startup validation at 348,627 bytes and eight requests. The entire difference from that parent to the current source tree is two test assertions for the existing in-process system actor. There are no production, dependency or build-input differences. The emitted build inventory was verified unchanged before and after the Gateway run; the build retains its parent-commit provenance.
  • The compiled Gateway, loading the emitted Codex plugin and two actual pinned Codex 0.153.0 children, passed both affected RPCs. models.list and chat.metadata each returned exactly one configured openai/gpt-5.6-sol entry with available: true. The Gateway exited successfully, both native children were absent after cleanup, and private state was removed. The proof uses synthetic local API-key configuration and makes no credential-validity, entitlement or inference claim.
  • The root independently checked all 71 files in the final Gateway and CLI evidence archives, 432 selected source files against Git and the local checkout, source/index snapshots, emitted-build inventory, test reports, process completion and independent cleanup receipts. Earlier owner and full-build archives were also checked independently. Installed dependency metadata is bound; this does not claim that the full dependency tree or every emitted file was downloaded for inspection.
  • Fresh independent Codex review of the complete target returned no accepted/actionable P0–P2 findings in either pass. The amended current head has an identical source tree.
{
  "status": "passed",
  "model": "openai/gpt-5.6-sol",
  "modelsListAvailable": true,
  "chatMetadataAvailable": true,
  "nativeCodexVersion": "0.153.0",
  "compiledGateway": true,
  "syntheticLocalAccountState": true,
  "inferenceRequested": false,
  "nativeChildrenExited": true,
  "privateStateRemoved": true
}

The native flow called models.list with {"view":"all","refresh":true} and then chat.metadata through the compiled Gateway client. The pinned Linux Codex executable SHA-256 was fce635028842bfe9257140e8b7d53162732945e2f356fc35225be0702b4974be. Upstream source was inspected directly at Codex revision 41e22fee981a63b3698df7ed36bad393cda24715, including codex-rs/app-server/src/request_processors/catalog_processor.rs:169-180,242-292, codex-rs/app-server/src/request_processors/account_processor.rs:137-145,1108-1129, the account storage contract, model manager, provider authorization and published launcher.

Focused regression commands:

pnpm test src/agents/prepared-model-catalog-worker.native.integration.test.ts -t 'publishes native harness models through prepared list and chat metadata'
pnpm test src/gateway/server-chat-metadata-lifecycle.integration.test.ts -t 'revalidates native observations'
pnpm test src/agents/tools/gateway-tool.test.ts src/auto-reply/reply/commands-update.test.ts
pnpm test src/cli/agent-cli-recovery.process.test.ts
pnpm build

CI history: the first CI attempt on 94dec2743bd77a95ec5d4ce6213f0b179aaaf3ee hit the existing 100-second guard in the CLI durable-rebind process test. The unchanged case passed on the native worker in 27.036 seconds, and a normal retry of the failed CI jobs completed successfully in run 33734267419, attempt 2. The original timeout remains unexplained; no timeout, assertion or process-exit behavior was weakened. CI on amended head 5c3ab13dc4c346a8780c8ab3acd128b307babdcc also completed successfully on its first attempt in run 33739098634, with no failed or pending jobs.

ClawSweeper follow-through: the latest durable review at 09:35 UTC on September 3 inspected current head 5c3ab13dc4c346a8780c8ab3acd128b307babdcc, found no actionable correctness or security defect, and recommended retaining this design once exact-head checks passed. Its rank-up move was the same green-CI requirement, now satisfied by run 33739098634. We accept the +117 production-line owner contract: paired auth, registry, original observation identity and generation liveness are explicit facts protected by replacement, closure, ambient-registry and config-clone regressions across both projections. No review finding is skipped.

@clawsweeper

clawsweeper Bot commented Aug 31, 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 agents Agent runtime and tooling size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Aug 31, 2026
@jason-allen-oneal
jason-allen-oneal marked this pull request as ready for review August 31, 2026 23:00
@clawsweeper clawsweeper Bot added merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. P1 High-priority user-facing bug, regression, or broken workflow. 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 Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 3, 2026, 5:35 AM ET / 09:35 UTC.

ClawSweeper review

What this changes

The PR preserves native model availability after worker catalog publication by carrying the prepared generation’s registry, liveness, observation configuration, and paired auth facts into Gateway model-list and chat-metadata projections.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 2 items remain

No introduced correctness or security defect was found. This PR remains necessary because current main still publishes worker catalog rows without Gateway-side native re-observation; keep it open until required checks complete on the current head.

Priority: P1
Reviewed head: 5c3ab13dc4c346a8780c8ab3acd128b307babdcc

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The repair has strong production-path proof and focused boundary coverage; exact-head checks remain the final merge gate.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The changed production owner is the prepared-runtime catalog publisher; the supplied after-fix compiled-Gateway trace uses actual Codex child processes and exercises refreshed models.list plus chat.metadata, reporting native availability in both outputs and child cleanup.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed production owner is the prepared-runtime catalog publisher; the supplied after-fix compiled-Gateway trace uses actual Codex child processes and exercises refreshed models.list plus chat.metadata, reporting native availability in both outputs and child cleanup.
Evidence reviewed 7 items Current-main gap: Current main publishes the worker catalog immediately after loading it; it does not re-observe native harness readiness in the Gateway before publication.
Published-owner repair: The PR requires paired worker auth, re-observes the worker rows with the prepared generation registry, and checks generation liveness before publishing.
Projection ownership: Gateway model listing retains the prepared registry, liveness predicate, and observation configuration rather than consulting an ambient registry.
Findings None None.
Security None None.

How this fits together

A worker discovers model inventory, while the Gateway publishes that inventory to models.list, chat.metadata, and the New Session picker. Native harness readiness is process-local, so the Gateway must re-observe it through the same prepared generation that owns the catalog.

flowchart LR
  A[Catalog worker] --> B[Published model rows]
  B --> C[Prepared generation owner]
  C --> D[Gateway readiness check]
  D --> E[models.list]
  D --> F[chat metadata]
  E --> G[New Session picker]
  F --> G
Loading

Before merge

  • Resolve merge risk (P1) - The repair adds a net 117 production lines to a lifecycle-sensitive auth/provider path; its generation, registry, and observation-identity propagation should remain covered by the exact-head checks before merge.
  • Complete next step (P2) - Complete and confirm all required checks are green on the current head.
Agent review details

Security

None.

PR surface

Source +117, Tests +620. Total +737 across 40 files.

View PR surface stats
Area Files Added Removed Net
Source 12 201 84 +117
Tests 28 661 41 +620
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 40 862 125 +737

Review metrics

Metric Value Why it matters
Production versus test delta production +117 net; tests/support +620 net The production growth carries lifecycle-owned registry, liveness, and observation facts; the test/support growth covers worker publication and both Gateway projections.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #134460
Summary: This PR formally targets the worker-publication readiness regression tracked by the linked issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Retain after exact-head checks (recommended)
    Merge only after required checks succeed on this head, confirming the generation-scoped readiness and paired-auth contract across both public projections.

Technical review

Best possible solution:

Keep the single Gateway-side re-observation path tied to the prepared generation, preserving paired worker auth and fail-closed behavior when that generation is replaced or closed.

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

Yes, from source: current main serializes and publishes worker catalog rows without Gateway-side native re-observation, while the PR’s worker-boundary test targets that exact path. I did not execute the contributor branch in this read-only review.

Is this the best way to solve the issue?

Yes. The native Codex catalog keeps observations in process-local, configuration-keyed state, and the PR re-observes through the prepared Gateway generation instead of serializing that state or using an ambient registry.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: A refresh can otherwise hide usable native account models from the model picker and chat metadata.
  • merge-risk: 🚨 auth-provider: The change propagates paired auth and native readiness facts across the worker-to-Gateway catalog boundary.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster 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 changed production owner is the prepared-runtime catalog publisher; the supplied after-fix compiled-Gateway trace uses actual Codex child processes and exercises refreshed models.list plus chat.metadata, reporting native availability in both outputs and child cleanup.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed production owner is the prepared-runtime catalog publisher; the supplied after-fix compiled-Gateway trace uses actual Codex child processes and exercises refreshed models.list plus chat.metadata, reporting native availability in both outputs and child cleanup.

Evidence

What I checked:

  • Current-main gap: Current main publishes the worker catalog immediately after loading it; it does not re-observe native harness readiness in the Gateway before publication. (src/agents/prepared-model-runtime.build.ts:242, 3204152c77fd)
  • Published-owner repair: The PR requires paired worker auth, re-observes the worker rows with the prepared generation registry, and checks generation liveness before publishing. (src/agents/prepared-model-runtime.build.ts:248, 5c3ab13dc4c3)
  • Projection ownership: Gateway model listing retains the prepared registry, liveness predicate, and observation configuration rather than consulting an ambient registry. (src/gateway/server-methods/models-list-result.ts:462, 5c3ab13dc4c3)
  • Boundary regression coverage: The added worker-boundary helper empties the ambient registry, then verifies the prepared native row remains available through both models.list and chat.metadata. (src/agents/prepared-model-catalog-worker.test-support.ts:307, 5c3ab13dc4c3)
  • Direct Codex contract inspection: The inspected Codex source defaults model/list to excluding hidden models and projects model metadata from the app-server process; OpenClaw therefore cannot treat a worker-side native observation as portable readiness. (codex-rs/app-server/src/request_processors/catalog_processor.rs:243, 41e22fee981a63b3698df7ed36bad393cda24715)
  • Implementation provenance: The integrated generation-scoped implementation was committed as a merge commit with the worker-publication fix and its stated lifecycle rationale. (src/agents/prepared-model-runtime.build.ts:254, 840b35ca3eba)

Likely related people:

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

  • Complete and confirm all required checks are green on the current head.

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 (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-01T00:13:58.903Z sha fa97260b522fa31af564b3a325bd6c2466c730f9 :: needs real behavior proof before merge. :: [P1] Carry the prepared registry through direct models.list
  • reviewed 2026-09-01T03:08:14.359Z sha 056a85b2fafd67a919f0a8bb7696f8c26d4398df :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-01T16:48:58.786Z sha 7466f73 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-02T18:22:48.985Z sha 59a1dda :: needs maintainer review before merge. :: none
  • reviewed 2026-09-03T07:05:48.982Z sha 840b35c :: blocked before merge. :: none
  • reviewed 2026-09-03T07:52:24.209Z sha 6511866 :: blocked before merge. :: none
  • reviewed 2026-09-03T08:18:32.643Z sha 05b60fd :: blocked before merge. :: none
  • reviewed 2026-09-03T08:43:34.818Z sha 94dec2743bd77a95ec5d4ce6213f0b179aaaf3ee :: blocked before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Aug 31, 2026
@jason-allen-oneal
jason-allen-oneal force-pushed the agent/fix-codex-model-catalog-publication branch from fa97260 to 056a85b Compare September 1, 2026 03:02
@jason-allen-oneal
jason-allen-oneal requested a review from a team as a code owner September 1, 2026 03:02
@jason-allen-oneal
jason-allen-oneal force-pushed the agent/fix-codex-model-catalog-publication branch from 056a85b to 7466f73 Compare September 1, 2026 16:39
@openclaw-barnacle openclaw-barnacle Bot added size: L triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed size: M triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Sep 1, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed 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 1, 2026
jason-allen-oneal and others added 2 commits September 2, 2026 14:03
Re-observe process-local native readiness in the publishing Gateway using
the prepared registry and paired worker auth. Preserve the exact generation
predicate and original observation config through model-list and chat
metadata projections so neutral config clones stay valid and retired
generations cannot publish readiness.

Retain contributor ancestry while resolving the main conflict. Remove the
duplicate generation predicate, preserve lazy catalog loading, and move
unchanged configured-inventory helpers out of the projection module.

Verified failing/passing worker and owner cases, 266 sibling tests, all 16
core test compiler graphs, scoped static gates, an actual Codex process,
and both model-listing RPCs through the compiled Gateway. Native proof used
synthetic local account state without inference. The older base's full
build failed only its unrelated final startup CSS budget; integrated CI
remains required before landing. Final independent autoreview is clean.

Fixes openclaw#134460

Co-authored-by: Jason O'Neal <[email protected]>
@steipete steipete self-assigned this Sep 3, 2026
@steipete steipete changed the title fix(models): preserve native catalog readiness across worker publication fix(models): keep native models available after worker publication Sep 3, 2026
@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

The revised head is 840b35c. It preserves the contributor's ancestry, resolves the main conflict, and strengthens generation lifetime and native observation identity through both public projections. The PR body now describes the final change and independently checked proof: failing/passing owner cases, 266 sibling tests, all 16 core test compiler graphs, final static gates, and a compiled Gateway using actual Codex processes. The native account state was synthetic; no inference or credential-validity claim is made. The older base's unrelated final UI CSS budget failure is recorded separately, and integrated CI remains a landing gate.

@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

steipete and others added 2 commits September 3, 2026 00:36
Pair mocked worker catalogs with their auth generation and carry the owned plugin registry into Gateway catalog projections. Keep the native harness assertion helper private.

The complete startup suite, Codex catalog loopback and real worker boundary pass in isolated native execution (13 cases). Scoped lint/type checks and the canonical unused-export gate pass; independent full-target review is clean.
Co-authored-by: Jason O'Neal <[email protected]>
@jason-allen-oneal

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@jason-allen-oneal
jason-allen-oneal force-pushed the agent/fix-codex-model-catalog-publication branch from 94dec27 to 5c3ab13 Compare September 3, 2026 09:29
@jason-allen-oneal

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@jason-allen-oneal

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete merged commit 6c44634 into openclaw:main Sep 3, 2026
233 checks passed
@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

obviyus added a commit that referenced this pull request Sep 3, 2026
Collapses the model-list cleanup (#135912) and the provider-login branch into
one change rebased onto main.

- models.list reads one closed catalog source (gateway, prepared, published);
  the CLI `models list` and chat `/models` consume the prepared catalog directly.
- Prepared model runtime: owners publish one curated build, live discovery runs
  only in the catalog worker, and secret-free provider-auth facts captured at
  build time replace native readiness reobservation and auth-mode flags.
- Provider login: one login runtime shared by the CLI, chat `/login`, Telegram,
  and the Control UI; `openclaw.setup.auth.start` owns interactive sign-in.
- First-run setup inference saves the credential, confirms the in-memory
  candidate with one tool-free turn, and commits config only on success.
- xai catalog derives from the manifest; Codex native auth probes the CLI;
  doctor repairs legacy model refs and session routes.

Integration with main: keeps the worker discovery plan (#137063), worker plugin
scoping (#135486), auth order and profile identity (#132450, #137022), the
plugin-owned Codex/Claude login readers, and the built-artifact preference for
setup revalidation (#136036). Drops main's readiness reobservation (#134524)
and stale-refresh catalog mode (#136915): the prepared build already carries
the provider-auth facts those paths re-derived.

Claude-Session: https://claude.ai/code/session_01CnvVXNnjjQGMrBLYjq29RP
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 4, 2026
…penclaw#134524)

* fix(models): preserve native catalog readiness across worker publication

* fix(models): bind prepared readiness to projection registry

* fix(models): preserve prepared registry in direct lists

* fix(gateway): retain prepared catalog registry

* test(gateway): type native catalog mock against production helper

* fix(gateway): align prepared catalog lifecycle tests

* test(models): split native catalog worker coverage

* test(models): align catalog fixtures with prepared runtime ownership

Pair mocked worker catalogs with their auth generation and carry the owned plugin registry into Gateway catalog projections. Keep the native harness assertion helper private.

The complete startup suite, Codex catalog loopback and real worker boundary pass in isolated native execution (13 cases). Scoped lint/type checks and the canonical unused-export gate pass; independent full-target review is clean.
Co-authored-by: Jason O'Neal <[email protected]>

* test(update): expect in-process system actor

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Jason O'Neal <[email protected]>
steipete added a commit that referenced this pull request Oct 11, 2026
## What Problem This Solves

Agent runtime bookkeeping repeatedly restarted otherwise valid work when configuration, plugin, or catalog metadata changed during an asynchronous operation. This maintainer-requested simplification removes that speculative retry machinery.

## User Impact

Normal model selection, tool execution, credential checks, FIFO scheduling, and shutdown settlement remain. A request racing a reload may fail visibly and be retried by the caller; passive metadata may remain at its captured version until the next refresh. No configuration, protocol, SDK, schema, durability, retention, or permission contract changes.

## Why This Change Was Made

Prepared runtime acquisition and remote catalog adoption now take one preparation path rather than repeatedly rebinding and rebuilding. Admission still handles the concrete drain, retirement, and failed-activation recovery stages. Cache publication keeps its final currentness check; tool and credential effects keep their authority checks. Steering and Tool Search retain their actual owner, FIFO, and settlement contracts without comparing unrelated metadata.

Production: **519 net lines removed**. Tests that exclusively required the removed synthetic interleavings were removed with them. Open-parent borrowing, pending-auth cancellation, explicit MCP acquisition config, and queued-tool implementation checks remain. No new lint suppressions, timeouts, retries, or skips were added.

Scope proof also caught two nearby correctness issues: an earlier MCP reload could overwrite a new caller's explicit configuration, and snapshot reconciliation could prepend a separator to a later text block. Both are fixed with their existing boundary tests. Bootstrap fixtures now test the no-clobber fallback already shipped by the pinned fs-safe version; no dependency or storage policy changed.

## Best-effort tradeoffs accepted

| Removed guard | Provenance and accepted result |
| --- | --- |
| Per-batch context projection cancellation | #119607 measured the value of cooperative yielding; its mid-batch cancellation callbacks were synthetic coverage. Yielding and the final publication check stay; obsolete pure computation may finish unused. |
| Mixed-version module/cache repair | #119607 seeded an old global singleton inside a synthetic process. Normal upgrades restart the process; unsupported mixed-version module replacement no longer repairs that marker. |
| Runtime acquisition retry/rebind loop | #128138/#127217 exercised forced reload timing. A racing request now returns a visible supersession error; the next request uses the current owner. The actual no-spin incident in #153313 remains addressed. |
| Configured-generation re-admission | 171df4e / #168410 adds re-admission for a gated Docker reproduction with a catalog publication 0.3s after admission, not a human-user incident. A superseded request now fails visibly. Parent confinement remains fail-closed, with its security test retained. The retry-only WeakSet and two retry-specific tests are removed. |
| Repeated passive owner selection | a718c1c / #162484 added recursion alongside the real self-drain fix; that incident did not require recursive reselection. The self-drain refusal stays. Reads use one captured owner or fail visibly, rather than recursively trying later publications. |
| Remote catalog config reread/per-attempt cancellation | #158000 used synthetic config/auth churn. Adoption reads once and prepares once; an overlapping change can defer adoption until the next normal catalog check. |
| Parent-generation cancellation subscriptions during adoption | 504d290 / #158000 used the same synthetic churn. Parent replacement may leave bounded preparation running until its final owner/config check rejects it. Shutdown cancellation, candidate-retirement aborts, cleanup, and the final serialized effect check remain. |
| Three-attempt catalog adoption settlement recovery | The same synthetic churn caused a second retry protocol around owner publication. One attempt remains, with one final checked atomic rows/pricing commit. |
| Duplicate early publication checks/error relabeling | Same-tick checks and concurrent-change relabeling did not guard an effect. The final effect check stays; failures retain their actual reason. |
| Auth-batch sibling retry after supersession | f3c52bd / #152467 used synthetic tests that superseded one owner during a sibling build. The operation now settles with its original error instead of selectively rebuilding siblings. Credential authority checks remain. |
| Post-await cache-stale generation check | No human incident supports fencing this metadata flag. A config/auth change during discovery can let the older load clear a reused owner's stale marker; discovery may remain stale until another explicit refresh/reload. This does not grant credentials or execution authority. |
| Passive harness catalog cancellation | #134524 fixed the actual availability report #134460; replacement/closure guards were additional synthetic hardening. Completed discovery rows are retained, and later discovery observes replacement. |
| Native binding clock-only rechecks after worker waits | #158396 used clock-jump fixtures. An expired but unreplaced exact row can finish its prepared bookkeeping mutation; CAS takeover detection and current mutation authority still gate commit. One exact, unexpired lease check gates protected callback entry, and live effect assertions remain. |
| Tool Search ancestor reentrancy tracking | #140767 covered synthetic nested control calls, not a reachable production control target. FIFO/exclusion and real implementation settlement remain. |
| Complete steering metadata fingerprint | #163195 recorded a real production ordering/ownership incident. Its owner, pending-row, result-authority, and lease checks stay; metadata-only edits no longer invalidate already-captured prompt bytes. |
| Repeated MCP acquisition/reload replay | #138694 used synthetic crossed-publication choreography. A new runtime catches up once; later reloads target the published owner. A racing creation can fail and reconnect on the next acquisition. |
| MCP tools/list invalidation generations and replay | #125541/#125564 describe isolated protocol stress fixtures. A notification inside tools/list no longer triggers immediate replay; the next notification or explicit refresh replaces the inventory. Normal exit/reconnect, bounds, validation, and cleanup remain. |
| Failed-start replay crossed by config publication | #158088's test forces a config publication into an in-flight failed initialization. That request may now report its first failure; ordinary backoff and explicit-refresh retry remain. |

## Evidence

Candidate head: `d72afea0c17a45c677977e23937049d7c7fc43ec` (tree `51daca08d7288e906188bc25ec3d1896bf841349`).

Final exact-head CI: [run 38132644989](https://github.com/openclaw/openclaw/actions/runs/38132644989) completed successfully; all 82 jobs terminal with no failed or cancelled jobs. Full head-bound check census also confirms the CI gate and applicable security checks passed. Earlier failed/cancelled attempts are described below, not represented as passing proof.

- Independent P2 reviews completed. The catalog-staleness, duplicate steering metadata fingerprint, and auth-sibling retry findings are explicitly accepted tradeoffs listed above; steering result facts and destination eligibility remain checked at their owners. The latest native-lease callback-entry finding was accepted and fixed with one live lease check instead of restoring per-write expiry callbacks. Its new fake-clock regression failed before the fix by entering the protected callback after expiry.
- Conflict-only integration kept main's three repaired test fixtures byte-for-byte. All **22 conflict tests** passed (cursor, sandbox, bootstrap publication, lint suppressions); affected root/tools test graphs, core types, typed lint and both cycle checks passed. Runtime and Madge cycles remain **0**.
- The native callback-entry fix passed fresh P2 review and **24 focused tests** (21 native binding tests plus 3 lint-suppression tests), wrapper 212.01s; native test project 164.77s including 113.11s compiled-worker preparation. The added fake-clock case performs no real wait; the existing native suite exercises authority and worker settlement. Final affected types and typed lint are checked before push.
- CI run `38125430266` found one owned stale expectation: the remote-catalog integration still forced config/auth replacement while pricing was paused and demanded the removed immediate retry. Only that scenario was removed; both schema variants retain normal publication, pinned pricing, input validation, worker recovery and disable coverage and pass locally (141.35s project), with gateway test types, typed lint, lint suppressions (3/3), and fresh P2 review passing.
- The other root failure, `checks-node-changed-compact-small-11`, independently reproduced on clean main `fd1fd2ce0ef8cb7e9c4074c8f855eff8992a54c2`: `embedded-agent-runner.prompt-cache.test.ts` responses and in-history both raised `SqliteTranscriptMutationConflictError` in the session actor append path (2 failed / 2 passed). Investigation found a cold actor snapshot prevented the existing implicit-watermark retry. Fixed directly on main as `e65bd3be4134f1453bb4ab26e68704c678086b58` and integrated here: all 4 prompt-cache cases and 35 session-manager siblings plus lint-suppressions pass, including explicit stale rewrite refusal. The repair passed types, typed lint and fresh P2 review.
- Follow-up CI `38127338915` reached one more synthetic-only case: compaction's `mutate=input` row changes an internal selection object after starting acquisition. Removed only that row/branch under the campaign rule; five remaining compaction cases pass, along with lint-suppressions, affected types, typed lint and fresh P2 review. Its provenance is `c131ec041e1` / #139429, not a human report of post-call input mutation. The final conflict repair keeps main's equivalent streaming/steering refactors, removes the obsolete retry predicate, and passes 49 owner tests plus lint-suppressions. Cancelled jobs are not counted as passing; final-head hosted CI remains the gate. No CI job was rerun.
- CI `38130432441` had one inherited fixture failure: three `sessions-mutations.catalog-queue` cases selected their configured default while expecting override fields, after #169030 intentionally made that selection a default reset. Integrated main's existing fixture-only correction `194a08e59632`, retaining all assertions. The corrected file passes all 14 cases on clean main under Node and Bun; the three affected cases also pass under Bun on this branch (249.87s project, mostly transformation). Exact-head hosted CI remains the final gate.
- Focused effects suites: **43 passed** across inbound-registry, remote-publication, hot-reload-dispatch and tool-search-scheduling. This includes cancellation, parent confinement, ordinary rollback/failed-activation recovery, and queued implementation replacement. Single-worker wrapper 752.15s including 142.017s compiled-worker preparation; infra 432.15s and agents-core 115.09s. Final restored remote-publication file: **7 passed**, including first reply crossing catalog adoption and exact derived-parent confinement; wrapper 372.77s (184.30s worker preparation; 131.87s Vitest). These loaded-host timings are not a performance claim.
- Integrated native-binding suites: **20 passed**, including exact token cleanup, successor protection, and revocation. The same command passed all **3 lint-suppression tests**. Single-worker wrapper 354.47s including 145.31s worker preparation.
- Current core types and native-binding test graph passed; runtime cycles **0**, Madge cycles **0**; changed-file typed lint passed. The full changed-check run reached an old-base UI duplicate-import error already fixed on main by `48588a65222`; that fix was integrated and the affected UI graph passed. Remaining type graphs and static guards were completed separately without changing baselines.
- Isolated Linux scope run and canonical remaining projects exercised **19,900 passing tests**. Eight failures were investigated: three pinned removed synthetic retry paths and were deleted; five exposed the correctness/fixture issues described above and were repaired with focused proof. Existing platform skips were unchanged. This is combined incremental proof, not a claim that one final-head all-scope invocation was green.
- Final repair suites: **71 passed** across passive runtime, SSE recovery, startup backoff, bootstrap, stream reconciliation/markup/phase coverage; **12 passed** across sandbox/cursor coverage, followed by **2 passed** for the real-append cursor fixture. Final MCP regression retained stdio-exit recovery and HTTP failure semantics; it passed 64 cases but hit two unchanged local child-start deadlines (1s/2s). Those initial-start paths passed on the isolated Linux run; no timeout, retry, or skip was changed to mask the local failures.
- Full-core Linux lint passed with 13 existing max-lines warnings, none in changed files. Deadcode identified and drove removal of the unused owner-publication helper. Remaining findings were in unmodified config/state/Gateway/UI files. A separate fresh current-main checkout (`f4d601a006`) passed production deadcode and failed full-tree deadcode only on the unrelated `readActiveGatewayLockPortMock` export. The PR does not change any deadcode baseline.
- Blacksmith Testbox did not admit a runner within 15 minutes; AWS quota pressure supplied an undersized instance, which was released. The authorized Hetzner fallback supplied the Linux proof above. All owned remote leases are stopped. Hosted CI on the exact final head remains the landing gate; no CI jobs were rerun.

<details>
<summary>Audit coverage ledger and retained boundaries</summary>

| Mechanism (base lines) | Scenario and provenance | Decision |
| --- | --- | --- |
| context-cache-projection.ts:145-213, context.ts:87-109,146-169 | Cancellation/replacement during pure batched metadata computation. bf7840f / #119607 fixed a measured multi-second RPC stall by yielding and atomic publication. Mid-batch authority callbacks were extra cancellation machinery; no effect occurs in projection. | REMOVE repeated projection/early checks; KEEP cooperative yields and the caller's check immediately before publication. |
| context-runtime-state.ts:33-38 | bf7840f / #119607 seeds an old global singleton and new cache module in a synthetic child process; no human report of mixed code versions within one live process. | REMOVE old-module/cache-pair normalization, its only reuse flag, and the synthetic migration test. Ordinary process startup and same-version bundled singleton sharing remain. |
| prepared-model-runtime-lease.ts:149-164 | 8720fbf / #153386. Human report #153313 by stackingrockss includes the deployed Docker version, profiler samples, and repeated boot-loop observations. Its infinite retry was caused by non-idempotent runtime selection normalization. | KEEP normalized owner selection and a visible error when a settled replacement never published; REMOVE the acquisition retry loop entirely, so it cannot spin. |
| prepared-model-catalog-worker.ts:71-220 | 349aef7 / #150354. Human report #149538 by 609NFT describes copied production fleet state, 632 agents, 504 failed health probes and growing RSS. #161738 by matthematics1137 reports 92 worker lifetimes, OOMs and 1.285 TB written. | KEEP one bounded shared worker, borrower cleanup, failure logging, and ordinary crash recovery. These are measured resource and real concurrency contracts, not permission to retain unrelated reload fences. |
| prepared-model-runtime.refresh-scope.ts:240 | d56279c / #151597 by obviyus describes a controlled worker crash and synthetic Gateway regression, not a human production report. Later #161738 independently establishes actual recurring worker failures. | KEEP source-bound failure reporting and bounded recovery to avoid reintroducing the observed restart/discovery amplification. The #151597 PR alone is not accepted incident evidence. |
| prepared-model-runtime.resources.ts:30-127 | 73b4086 / #143109 contains native regressions and synthetic compiled CLI/Gateway proof, no linked human incident. | KEEP physical resource claims until ordinary concurrent borrowers settle and shutdown joins their cleanup; these are required cleanup mechanics, not a blanket historical-incident exemption. Inspected the complete resource owner; no extra reload retry protocol lives here. |
| prepared-model-runtime.plugin-lifetime.ts:230-319 | 382c987 / #159448 links #157842 by highfly-hi: five-agent Linux deployment with catalog-worker heap increasing 70-80 MB per scheduled turn, watchdog restarts and before/after version evidence. | KEEP final registry-reference release, current execution authority, and ordinary borrowed-resource settlement. Retained memory claims are scoped to physical lifecycle, not all historical publication machinery. |
| prepared-model-runtime.lifecycle.ts:101-164 | a718c1c / #162484 by jalehman records actual lossless-claw maintenance calls stuck about 45 minutes during reload until restart. a3e4005 / #162301 explicitly says synthetic Gateway, no production deployment. | KEEP refusal of plugin work waiting on its own drain and process-close settlement. #162301 is synthetic evidence, not an independent incident exemption. |
| prepared-model-runtime-lease.ts acquisition loop and borrowed-generation branch | 79e6755 / #128138 and related #127217 describe synthetic QA-channel/config replacement tests; #127217 explicitly reports that its pre-fix real-Gateway run still delivered replies. Retained inbound-registry tests exposed ordinary nested selected-parent borrowing as a distinct contract. | REMOVE retry/rebind loop. KEEP exact open-parent borrowing and selection confinement; a reload during new acquisition may fail that request visibly. |
| prepared-model-runtime.published-owner.ts:91-203 | a718c1c / #162484 added retry/recursive rereads alongside the real plugin-drain repair. That incident justifies self-drain refusal and ordinary settlement, not recursive passive owner reselection. | REMOVE repeated rereads/retries; wait once, then project or activate once. Pure catalog-stale bookkeeping no longer revalidates generation after its await. |
| prepared-model-runtime.configured-refresh.ts remote catalog adoption | 504d290 / #158000 has explicitly synthetic config/auth churn and fixture-provider proof; no human incident cited for the reread loop, per-attempt controllers or three-attempt owner settlement recovery. | REMOVE those race-specific retries, plus early duplicate currentness checks/error relabeling. KEEP the final owner/authority check, atomic rows/pricing commit, current catalog ordering, and ordinary cancellation/disposal. |
| prepared-model-runtime.configured-refresh.ts:396-430 parent subscriptions | 504d290 / #158000; same synthetic churn proof. Parent-generation subscriptions duplicate the final owner/generation/config check. | REMOVE parent-generation early cancellation listeners. KEEP shutdown and candidate-retirement cancellation, bounded work, cleanup, and the final serialized effect check. |
| prepared-model-runtime.owner.ts:612-631 batch supersession retry | f3c52bd / #152467. Tests force one auth owner to supersede while a sibling is building. No independent human incident identified for sibling retry. | REMOVE retry of the surviving batch; retain source-bound credential/current-owner checks and report the original publication failure. |
| prepared-model-runtime.owner.ts:124-134 unused publication probe | dd2d66c / #130856 introduced a helper returning matching/pending publication facts for acquisition retries. Its callers are gone; full-repository search finds only the definition. | REMOVE the dead helper/export. Credential-refresh cancellation remains supported by the direct, abortable configured-owner wait and its unchanged regression tests. |
| sandbox/registry.kernel.ts:396,420; sandbox/registry.ts:295 | 2889a99 / #151172 is not treated as an incident report. Read-only admission accepts older schemas; tableExists consumes admitted schema.tables facts, not repeated SQL/format validation. | KEEP the existing absent-table empty/null contract. No runtime foreign-commit or repeated validation probe exists in these calls. |
| harness/native-session/binding-leases.ts | cfef174 / #158396 moved writes to workers; elapsed-time rechecks were covered by synthetic clock-jump tests. 283d5e6 / #164197 supplies native successor authority behavior, not a blanket exemption. | REMOVE prepared callback plumbing and post-worker wall-clock-only rechecks. KEEP exact-row CAS, token/phase/failure checks, current mutation authority, bounded acquisition, renewal, and write settlement. |
| harness/context-engine-logical-turn.ts | #143491/#140023 supply synthetic lifecycle tests, not qualifying human incident evidence. The owner actually holds resources used by outstanding context-engine work. | KEEP ordinary work completion and deferred disposal until implementation settlement; no extra synthetic reload retry was retained here. |
| harness/model-catalog.ts:168-177,242-284,353 | 6c44634 / #134524 repairs human availability report #134460. Passive replacement/closure branches were additional maintainer hardening and synthetic variants, not that report's failure. | REMOVE passive isCurrent callbacks and ambient registry replacement checks. KEEP exact owned registry/config, provider outcomes, discovery, selection and the actual availability repair. |
| auth-profiles/oauth-refresh-peers.ts | #166183/#167002/#166659 are not claimed as human incident evidence. Refresh credentials rotate/revoke and carry account identity; copied historical peers must not replay spent tokens or inherit another account. | KEEP these credential/identity effect boundaries and ordinary uncertain-write settlement. No auth-profile schema, secrets, permissions or durability changes. |
| worktrees lifecycle/removal | Audited run-lease-owner.ts, service-preparation.ts, eviction.runtime.ts and gc-removal.ts. They coordinate destructive removal of user artifacts with live checkout/source handles, exact refs and ordinary parallel sessions. No PR title is treated as incident evidence. | KEEP current-row removal/exclusive source checks and rollback/cleanup custody for writes and deletion. Removing them would risk user artifacts, independently prohibited by the data-loss boundary. |
| tool-search-scheduling.ts | 9b93fc8 / #140767 adds ancestry reentrancy and queued object/mode identity checks with automated interactive/headless regressions. Production catalogs exclude control tools; recursive calls using the same runtime were synthetic only. | REMOVE unreachable nested-call ancestry. KEEP one exact queued implementation/mode check at the effect, catalog-ID authorization, FIFO/exclusion, abort and implementation settlement. |
| agent-steering-queue.ts:194-263 | 3f761a8 / #163195 records Peter's actual three-day production errors. The incident justifies owner/FIFO repair, not a fingerprint of every result label/task/time/outcome/origin/transcript field. | REMOVE full payload fingerprints and deep-equality invalidation. KEEP run-owner identity, prepared result authority, current requester store, pending-row effect checks, FIFO, exact lease/status acknowledgment and release. |
| agent-bundle-mcp-manager.ts and manager-install.ts | 89c1a09 / #138694 reports synthetic fail-before/real-transport proof but no cited actual-use incident for repeated crossed-publication acquisition/reload. | REMOVE the acquisition retry/rebind loop and repeated reload replay. KEEP the runtime-key queue, ordinary cleanup, one postcreation config catchup, requester credentials/authorization and live tool effect checks. |
| agent-bundle-mcp-runtime.ts catalog generations | 1cf8ea4 / #125564 and follow-up 1d03e5d / #167642 have synthetic notifications/listing interleavings, not human reports for replaying tools/list during its own response. | REMOVE catalog invalidation generations, replay of a notification arriving inside tools/list, and the impossible repeated replacement-retirement loop. KEEP listing single-flight, caching, bounds, diagnostics, normal reconnect, one retry for an actually exited previously healthy server, and execution authority. |
| prepared-model-runtime-lease.ts / plugin-lifetime.ts configured-generation re-admission | 171df4e / #168410, landed during this lane, describes a gated Docker reproduction with catalog publication 0.3s after admission, not an actual human-user incident. | REMOVE configured-generation retry and its now-unused WeakSet plus the two retry-only tests. KEEP fail-closed superseded-generation rejection and the new derived-parent confinement security test. |

</details>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
…168981)

## What Problem This Solves

Agent runtime bookkeeping repeatedly restarted otherwise valid work when configuration, plugin, or catalog metadata changed during an asynchronous operation. This maintainer-requested simplification removes that speculative retry machinery.

## User Impact

Normal model selection, tool execution, credential checks, FIFO scheduling, and shutdown settlement remain. A request racing a reload may fail visibly and be retried by the caller; passive metadata may remain at its captured version until the next refresh. No configuration, protocol, SDK, schema, durability, retention, or permission contract changes.

## Why This Change Was Made

Prepared runtime acquisition and remote catalog adoption now take one preparation path rather than repeatedly rebinding and rebuilding. Admission still handles the concrete drain, retirement, and failed-activation recovery stages. Cache publication keeps its final currentness check; tool and credential effects keep their authority checks. Steering and Tool Search retain their actual owner, FIFO, and settlement contracts without comparing unrelated metadata.

Production: **519 net lines removed**. Tests that exclusively required the removed synthetic interleavings were removed with them. Open-parent borrowing, pending-auth cancellation, explicit MCP acquisition config, and queued-tool implementation checks remain. No new lint suppressions, timeouts, retries, or skips were added.

Scope proof also caught two nearby correctness issues: an earlier MCP reload could overwrite a new caller's explicit configuration, and snapshot reconciliation could prepend a separator to a later text block. Both are fixed with their existing boundary tests. Bootstrap fixtures now test the no-clobber fallback already shipped by the pinned fs-safe version; no dependency or storage policy changed.

## Best-effort tradeoffs accepted

| Removed guard | Provenance and accepted result |
| --- | --- |
| Per-batch context projection cancellation | openclaw#119607 measured the value of cooperative yielding; its mid-batch cancellation callbacks were synthetic coverage. Yielding and the final publication check stay; obsolete pure computation may finish unused. |
| Mixed-version module/cache repair | openclaw#119607 seeded an old global singleton inside a synthetic process. Normal upgrades restart the process; unsupported mixed-version module replacement no longer repairs that marker. |
| Runtime acquisition retry/rebind loop | openclaw#128138/openclaw#127217 exercised forced reload timing. A racing request now returns a visible supersession error; the next request uses the current owner. The actual no-spin incident in openclaw#153313 remains addressed. |
| Configured-generation re-admission | 8b13535 / openclaw#168410 adds re-admission for a gated Docker reproduction with a catalog publication 0.3s after admission, not a human-user incident. A superseded request now fails visibly. Parent confinement remains fail-closed, with its security test retained. The retry-only WeakSet and two retry-specific tests are removed. |
| Repeated passive owner selection | d92dc37 / openclaw#162484 added recursion alongside the real self-drain fix; that incident did not require recursive reselection. The self-drain refusal stays. Reads use one captured owner or fail visibly, rather than recursively trying later publications. |
| Remote catalog config reread/per-attempt cancellation | openclaw#158000 used synthetic config/auth churn. Adoption reads once and prepares once; an overlapping change can defer adoption until the next normal catalog check. |
| Parent-generation cancellation subscriptions during adoption | 27a0f6d / openclaw#158000 used the same synthetic churn. Parent replacement may leave bounded preparation running until its final owner/config check rejects it. Shutdown cancellation, candidate-retirement aborts, cleanup, and the final serialized effect check remain. |
| Three-attempt catalog adoption settlement recovery | The same synthetic churn caused a second retry protocol around owner publication. One attempt remains, with one final checked atomic rows/pricing commit. |
| Duplicate early publication checks/error relabeling | Same-tick checks and concurrent-change relabeling did not guard an effect. The final effect check stays; failures retain their actual reason. |
| Auth-batch sibling retry after supersession | 4616d20 / openclaw#152467 used synthetic tests that superseded one owner during a sibling build. The operation now settles with its original error instead of selectively rebuilding siblings. Credential authority checks remain. |
| Post-await cache-stale generation check | No human incident supports fencing this metadata flag. A config/auth change during discovery can let the older load clear a reused owner's stale marker; discovery may remain stale until another explicit refresh/reload. This does not grant credentials or execution authority. |
| Passive harness catalog cancellation | openclaw#134524 fixed the actual availability report openclaw#134460; replacement/closure guards were additional synthetic hardening. Completed discovery rows are retained, and later discovery observes replacement. |
| Native binding clock-only rechecks after worker waits | openclaw#158396 used clock-jump fixtures. An expired but unreplaced exact row can finish its prepared bookkeeping mutation; CAS takeover detection and current mutation authority still gate commit. One exact, unexpired lease check gates protected callback entry, and live effect assertions remain. |
| Tool Search ancestor reentrancy tracking | openclaw#140767 covered synthetic nested control calls, not a reachable production control target. FIFO/exclusion and real implementation settlement remain. |
| Complete steering metadata fingerprint | openclaw#163195 recorded a real production ordering/ownership incident. Its owner, pending-row, result-authority, and lease checks stay; metadata-only edits no longer invalidate already-captured prompt bytes. |
| Repeated MCP acquisition/reload replay | openclaw#138694 used synthetic crossed-publication choreography. A new runtime catches up once; later reloads target the published owner. A racing creation can fail and reconnect on the next acquisition. |
| MCP tools/list invalidation generations and replay | openclaw#125541/openclaw#125564 describe isolated protocol stress fixtures. A notification inside tools/list no longer triggers immediate replay; the next notification or explicit refresh replaces the inventory. Normal exit/reconnect, bounds, validation, and cleanup remain. |
| Failed-start replay crossed by config publication | openclaw#158088's test forces a config publication into an in-flight failed initialization. That request may now report its first failure; ordinary backoff and explicit-refresh retry remain. |

## Evidence

Candidate head: `d72afea0c17a45c677977e23937049d7c7fc43ec` (tree `51daca08d7288e906188bc25ec3d1896bf841349`).

Final exact-head CI: [run 38132644989](https://github.com/openclaw/openclaw/actions/runs/38132644989) completed successfully; all 82 jobs terminal with no failed or cancelled jobs. Full head-bound check census also confirms the CI gate and applicable security checks passed. Earlier failed/cancelled attempts are described below, not represented as passing proof.

- Independent P2 reviews completed. The catalog-staleness, duplicate steering metadata fingerprint, and auth-sibling retry findings are explicitly accepted tradeoffs listed above; steering result facts and destination eligibility remain checked at their owners. The latest native-lease callback-entry finding was accepted and fixed with one live lease check instead of restoring per-write expiry callbacks. Its new fake-clock regression failed before the fix by entering the protected callback after expiry.
- Conflict-only integration kept main's three repaired test fixtures byte-for-byte. All **22 conflict tests** passed (cursor, sandbox, bootstrap publication, lint suppressions); affected root/tools test graphs, core types, typed lint and both cycle checks passed. Runtime and Madge cycles remain **0**.
- The native callback-entry fix passed fresh P2 review and **24 focused tests** (21 native binding tests plus 3 lint-suppression tests), wrapper 212.01s; native test project 164.77s including 113.11s compiled-worker preparation. The added fake-clock case performs no real wait; the existing native suite exercises authority and worker settlement. Final affected types and typed lint are checked before push.
- CI run `38125430266` found one owned stale expectation: the remote-catalog integration still forced config/auth replacement while pricing was paused and demanded the removed immediate retry. Only that scenario was removed; both schema variants retain normal publication, pinned pricing, input validation, worker recovery and disable coverage and pass locally (141.35s project), with gateway test types, typed lint, lint suppressions (3/3), and fresh P2 review passing.
- The other root failure, `checks-node-changed-compact-small-11`, independently reproduced on clean main `8d45488ae2075bd14a50c881aff6e18c32182538`: `embedded-agent-runner.prompt-cache.test.ts` responses and in-history both raised `SqliteTranscriptMutationConflictError` in the session actor append path (2 failed / 2 passed). Investigation found a cold actor snapshot prevented the existing implicit-watermark retry. Fixed directly on main as `0fa340c21f484740ec7b4ed1169b7b02439aa970` and integrated here: all 4 prompt-cache cases and 35 session-manager siblings plus lint-suppressions pass, including explicit stale rewrite refusal. The repair passed types, typed lint and fresh P2 review.
- Follow-up CI `38127338915` reached one more synthetic-only case: compaction's `mutate=input` row changes an internal selection object after starting acquisition. Removed only that row/branch under the campaign rule; five remaining compaction cases pass, along with lint-suppressions, affected types, typed lint and fresh P2 review. Its provenance is `44d905388f9` / openclaw#139429, not a human report of post-call input mutation. The final conflict repair keeps main's equivalent streaming/steering refactors, removes the obsolete retry predicate, and passes 49 owner tests plus lint-suppressions. Cancelled jobs are not counted as passing; final-head hosted CI remains the gate. No CI job was rerun.
- CI `38130432441` had one inherited fixture failure: three `sessions-mutations.catalog-queue` cases selected their configured default while expecting override fields, after openclaw#169030 intentionally made that selection a default reset. Integrated main's existing fixture-only correction `a8ef16f77650`, retaining all assertions. The corrected file passes all 14 cases on clean main under Node and Bun; the three affected cases also pass under Bun on this branch (249.87s project, mostly transformation). Exact-head hosted CI remains the final gate.
- Focused effects suites: **43 passed** across inbound-registry, remote-publication, hot-reload-dispatch and tool-search-scheduling. This includes cancellation, parent confinement, ordinary rollback/failed-activation recovery, and queued implementation replacement. Single-worker wrapper 752.15s including 142.017s compiled-worker preparation; infra 432.15s and agents-core 115.09s. Final restored remote-publication file: **7 passed**, including first reply crossing catalog adoption and exact derived-parent confinement; wrapper 372.77s (184.30s worker preparation; 131.87s Vitest). These loaded-host timings are not a performance claim.
- Integrated native-binding suites: **20 passed**, including exact token cleanup, successor protection, and revocation. The same command passed all **3 lint-suppression tests**. Single-worker wrapper 354.47s including 145.31s worker preparation.
- Current core types and native-binding test graph passed; runtime cycles **0**, Madge cycles **0**; changed-file typed lint passed. The full changed-check run reached an old-base UI duplicate-import error already fixed on main by `ef175b247c9`; that fix was integrated and the affected UI graph passed. Remaining type graphs and static guards were completed separately without changing baselines.
- Isolated Linux scope run and canonical remaining projects exercised **19,900 passing tests**. Eight failures were investigated: three pinned removed synthetic retry paths and were deleted; five exposed the correctness/fixture issues described above and were repaired with focused proof. Existing platform skips were unchanged. This is combined incremental proof, not a claim that one final-head all-scope invocation was green.
- Final repair suites: **71 passed** across passive runtime, SSE recovery, startup backoff, bootstrap, stream reconciliation/markup/phase coverage; **12 passed** across sandbox/cursor coverage, followed by **2 passed** for the real-append cursor fixture. Final MCP regression retained stdio-exit recovery and HTTP failure semantics; it passed 64 cases but hit two unchanged local child-start deadlines (1s/2s). Those initial-start paths passed on the isolated Linux run; no timeout, retry, or skip was changed to mask the local failures.
- Full-core Linux lint passed with 13 existing max-lines warnings, none in changed files. Deadcode identified and drove removal of the unused owner-publication helper. Remaining findings were in unmodified config/state/Gateway/UI files. A separate fresh current-main checkout (`401216ac50`) passed production deadcode and failed full-tree deadcode only on the unrelated `readActiveGatewayLockPortMock` export. The PR does not change any deadcode baseline.
- Blacksmith Testbox did not admit a runner within 15 minutes; AWS quota pressure supplied an undersized instance, which was released. The authorized Hetzner fallback supplied the Linux proof above. All owned remote leases are stopped. Hosted CI on the exact final head remains the landing gate; no CI jobs were rerun.

<details>
<summary>Audit coverage ledger and retained boundaries</summary>

| Mechanism (base lines) | Scenario and provenance | Decision |
| --- | --- | --- |
| context-cache-projection.ts:145-213, context.ts:87-109,146-169 | Cancellation/replacement during pure batched metadata computation. 0dd154f / openclaw#119607 fixed a measured multi-second RPC stall by yielding and atomic publication. Mid-batch authority callbacks were extra cancellation machinery; no effect occurs in projection. | REMOVE repeated projection/early checks; KEEP cooperative yields and the caller's check immediately before publication. |
| context-runtime-state.ts:33-38 | 0dd154f / openclaw#119607 seeds an old global singleton and new cache module in a synthetic child process; no human report of mixed code versions within one live process. | REMOVE old-module/cache-pair normalization, its only reuse flag, and the synthetic migration test. Ordinary process startup and same-version bundled singleton sharing remain. |
| prepared-model-runtime-lease.ts:149-164 | 9505286 / openclaw#153386. Human report openclaw#153313 by stackingrockss includes the deployed Docker version, profiler samples, and repeated boot-loop observations. Its infinite retry was caused by non-idempotent runtime selection normalization. | KEEP normalized owner selection and a visible error when a settled replacement never published; REMOVE the acquisition retry loop entirely, so it cannot spin. |
| prepared-model-catalog-worker.ts:71-220 | 9d58cf2 / openclaw#150354. Human report openclaw#149538 by 609NFT describes copied production fleet state, 632 agents, 504 failed health probes and growing RSS. openclaw#161738 by matthematics1137 reports 92 worker lifetimes, OOMs and 1.285 TB written. | KEEP one bounded shared worker, borrower cleanup, failure logging, and ordinary crash recovery. These are measured resource and real concurrency contracts, not permission to retain unrelated reload fences. |
| prepared-model-runtime.refresh-scope.ts:240 | 3e7ca30 / openclaw#151597 by obviyus describes a controlled worker crash and synthetic Gateway regression, not a human production report. Later openclaw#161738 independently establishes actual recurring worker failures. | KEEP source-bound failure reporting and bounded recovery to avoid reintroducing the observed restart/discovery amplification. The openclaw#151597 PR alone is not accepted incident evidence. |
| prepared-model-runtime.resources.ts:30-127 | d70d026 / openclaw#143109 contains native regressions and synthetic compiled CLI/Gateway proof, no linked human incident. | KEEP physical resource claims until ordinary concurrent borrowers settle and shutdown joins their cleanup; these are required cleanup mechanics, not a blanket historical-incident exemption. Inspected the complete resource owner; no extra reload retry protocol lives here. |
| prepared-model-runtime.plugin-lifetime.ts:230-319 | 1233536 / openclaw#159448 links openclaw#157842 by highfly-hi: five-agent Linux deployment with catalog-worker heap increasing 70-80 MB per scheduled turn, watchdog restarts and before/after version evidence. | KEEP final registry-reference release, current execution authority, and ordinary borrowed-resource settlement. Retained memory claims are scoped to physical lifecycle, not all historical publication machinery. |
| prepared-model-runtime.lifecycle.ts:101-164 | d92dc37 / openclaw#162484 by jalehman records actual lossless-claw maintenance calls stuck about 45 minutes during reload until restart. 1f3038b / openclaw#162301 explicitly says synthetic Gateway, no production deployment. | KEEP refusal of plugin work waiting on its own drain and process-close settlement. openclaw#162301 is synthetic evidence, not an independent incident exemption. |
| prepared-model-runtime-lease.ts acquisition loop and borrowed-generation branch | 1977a39 / openclaw#128138 and related openclaw#127217 describe synthetic QA-channel/config replacement tests; openclaw#127217 explicitly reports that its pre-fix real-Gateway run still delivered replies. Retained inbound-registry tests exposed ordinary nested selected-parent borrowing as a distinct contract. | REMOVE retry/rebind loop. KEEP exact open-parent borrowing and selection confinement; a reload during new acquisition may fail that request visibly. |
| prepared-model-runtime.published-owner.ts:91-203 | d92dc37 / openclaw#162484 added retry/recursive rereads alongside the real plugin-drain repair. That incident justifies self-drain refusal and ordinary settlement, not recursive passive owner reselection. | REMOVE repeated rereads/retries; wait once, then project or activate once. Pure catalog-stale bookkeeping no longer revalidates generation after its await. |
| prepared-model-runtime.configured-refresh.ts remote catalog adoption | 27a0f6d / openclaw#158000 has explicitly synthetic config/auth churn and fixture-provider proof; no human incident cited for the reread loop, per-attempt controllers or three-attempt owner settlement recovery. | REMOVE those race-specific retries, plus early duplicate currentness checks/error relabeling. KEEP the final owner/authority check, atomic rows/pricing commit, current catalog ordering, and ordinary cancellation/disposal. |
| prepared-model-runtime.configured-refresh.ts:396-430 parent subscriptions | 27a0f6d / openclaw#158000; same synthetic churn proof. Parent-generation subscriptions duplicate the final owner/generation/config check. | REMOVE parent-generation early cancellation listeners. KEEP shutdown and candidate-retirement cancellation, bounded work, cleanup, and the final serialized effect check. |
| prepared-model-runtime.owner.ts:612-631 batch supersession retry | 4616d20 / openclaw#152467. Tests force one auth owner to supersede while a sibling is building. No independent human incident identified for sibling retry. | REMOVE retry of the surviving batch; retain source-bound credential/current-owner checks and report the original publication failure. |
| prepared-model-runtime.owner.ts:124-134 unused publication probe | e56f825 / openclaw#130856 introduced a helper returning matching/pending publication facts for acquisition retries. Its callers are gone; full-repository search finds only the definition. | REMOVE the dead helper/export. Credential-refresh cancellation remains supported by the direct, abortable configured-owner wait and its unchanged regression tests. |
| sandbox/registry.kernel.ts:396,420; sandbox/registry.ts:295 | 5c7e44c / openclaw#151172 is not treated as an incident report. Read-only admission accepts older schemas; tableExists consumes admitted schema.tables facts, not repeated SQL/format validation. | KEEP the existing absent-table empty/null contract. No runtime foreign-commit or repeated validation probe exists in these calls. |
| harness/native-session/binding-leases.ts | b272376 / openclaw#158396 moved writes to workers; elapsed-time rechecks were covered by synthetic clock-jump tests. ffd0759 / openclaw#164197 supplies native successor authority behavior, not a blanket exemption. | REMOVE prepared callback plumbing and post-worker wall-clock-only rechecks. KEEP exact-row CAS, token/phase/failure checks, current mutation authority, bounded acquisition, renewal, and write settlement. |
| harness/context-engine-logical-turn.ts | openclaw#143491/openclaw#140023 supply synthetic lifecycle tests, not qualifying human incident evidence. The owner actually holds resources used by outstanding context-engine work. | KEEP ordinary work completion and deferred disposal until implementation settlement; no extra synthetic reload retry was retained here. |
| harness/model-catalog.ts:168-177,242-284,353 | 01fd244 / openclaw#134524 repairs human availability report openclaw#134460. Passive replacement/closure branches were additional maintainer hardening and synthetic variants, not that report's failure. | REMOVE passive isCurrent callbacks and ambient registry replacement checks. KEEP exact owned registry/config, provider outcomes, discovery, selection and the actual availability repair. |
| auth-profiles/oauth-refresh-peers.ts | openclaw#166183/openclaw#167002/openclaw#166659 are not claimed as human incident evidence. Refresh credentials rotate/revoke and carry account identity; copied historical peers must not replay spent tokens or inherit another account. | KEEP these credential/identity effect boundaries and ordinary uncertain-write settlement. No auth-profile schema, secrets, permissions or durability changes. |
| worktrees lifecycle/removal | Audited run-lease-owner.ts, service-preparation.ts, eviction.runtime.ts and gc-removal.ts. They coordinate destructive removal of user artifacts with live checkout/source handles, exact refs and ordinary parallel sessions. No PR title is treated as incident evidence. | KEEP current-row removal/exclusive source checks and rollback/cleanup custody for writes and deletion. Removing them would risk user artifacts, independently prohibited by the data-loss boundary. |
| tool-search-scheduling.ts | 49f8d29 / openclaw#140767 adds ancestry reentrancy and queued object/mode identity checks with automated interactive/headless regressions. Production catalogs exclude control tools; recursive calls using the same runtime were synthetic only. | REMOVE unreachable nested-call ancestry. KEEP one exact queued implementation/mode check at the effect, catalog-ID authorization, FIFO/exclusion, abort and implementation settlement. |
| agent-steering-queue.ts:194-263 | 94acbe6 / openclaw#163195 records Peter's actual three-day production errors. The incident justifies owner/FIFO repair, not a fingerprint of every result label/task/time/outcome/origin/transcript field. | REMOVE full payload fingerprints and deep-equality invalidation. KEEP run-owner identity, prepared result authority, current requester store, pending-row effect checks, FIFO, exact lease/status acknowledgment and release. |
| agent-bundle-mcp-manager.ts and manager-install.ts | 1d60d3d / openclaw#138694 reports synthetic fail-before/real-transport proof but no cited actual-use incident for repeated crossed-publication acquisition/reload. | REMOVE the acquisition retry/rebind loop and repeated reload replay. KEEP the runtime-key queue, ordinary cleanup, one postcreation config catchup, requester credentials/authorization and live tool effect checks. |
| agent-bundle-mcp-runtime.ts catalog generations | 140dbbd / openclaw#125564 and follow-up 0818bcb / openclaw#167642 have synthetic notifications/listing interleavings, not human reports for replaying tools/list during its own response. | REMOVE catalog invalidation generations, replay of a notification arriving inside tools/list, and the impossible repeated replacement-retirement loop. KEEP listing single-flight, caching, bounds, diagnostics, normal reconnect, one retry for an actually exited previously healthy server, and execution authority. |
| prepared-model-runtime-lease.ts / plugin-lifetime.ts configured-generation re-admission | 8b13535 / openclaw#168410, landed during this lane, describes a gated Docker reproduction with catalog publication 0.3s after admission, not an actual human-user incident. | REMOVE configured-generation retry and its now-unused WeakSet plus the two retry-only tests. KEEP fail-closed superseded-generation rejection and the new derived-parent confinement security test. |

</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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.

[Bug]: Prepared catalog drops native Codex readiness across worker boundary

2 participants