Skip to content

refactor(agents): move workspace state operations off the Gateway thread - #163496

Merged
steipete merged 13 commits into
mainfrom
dbasync/wsstate
Oct 2, 2026
Merged

steipete merged 13 commits into
mainfrom
dbasync/wsstate

Conversation

@steipete

@steipete steipete commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Workspace initialization and ordinary reply preparation awaited async facades that still ran snapshots, alias registration, setup merges, and exact expired-state cleanup on the Gateway thread. This moves that SQL into the existing shared-state workers while preserving current authority, recovery holds, and filesystem safety.

User Impact

Workspace preparation retains first-writer timestamps, alias safety, vanished-workspace protection, FIFO settlement, and cache retirement. A serialized recovery-hold predicate runs on the worker's transaction connection immediately before commit, using the same connection-bound SQL kernel as the remaining host callers. A new hold rolls back the transaction and preserves the existing DuplicateAgentError and remediation message.

Host filesystem mutations still recheck current recovery holds immediately before each effect, including IDENTITY.md after awaited preparation. Those existing host checks explicitly select native current reads outside worker grants. Without this selection, removing the cached host writer made each file guard spawn a synchronous snapshot subprocess. Artifact-preserving scopes and schema-admission reads retain private snapshots; current guards never reuse stale discovery bytes. The worker's host grant checks remain SQL-free.

Decided by Peter: warn and allow. Released plugins can continue passing beforePersistentApply, including callbacks that synchronously read OpenClaw databases. Each callback runs synchronously once immediately before worker dispatch, outside admission grants; throwing stops dispatch. A once-per-process deprecation warning names the typed guard.assertHost replacement. The documented timing nuance is that legacy checks run before dispatch, while typed guards revalidate live authority inside the commit grant. The compatibility record and SDK migration guide preserve this released surface through the next Plugin SDK major.

No schema, configuration, permission, retention, durability, or update-contract change. src/plugins/compat/workspace-mutation-guard.ts is SDK deprecation metadata, not a database migration/backfill/repair. Existing tables and stored encodings are unchanged; recovery reads reuse the existing connection-bound query. The released-plugin regression and compatibility-registry cases cover the public upgrade contract. This does not claim that the entire creation or config-preflight flow is free of host SQLite.

Implementation Notes

Confirmed expiry receipts retire the stored workspace's file cache within the existing FIFO interval, including lost ordinary replies. Accepted writes settle before database close. Read-only snapshots, explicit deletion, and Doctor relocation retain their existing owners.

The gateway ownership extraction moves persisted-record parsing and classification into a cohesive module, leaving live custody and schema authority with the original owner. The compiled-wrapper inventory includes all extracted modules. Bootstrap/Talk fixtures use the existing host-broker fork pools, and Windows teardown joins worker close before removing temporary files.

The assertion baseline is an exact shrink-only ratchet-down: one obsolete unchecked-decode allowance removed, with no allowance added or loosened. Against integrated main db24ac34b6ab0337ba37b8f57432ea601fbc621a, the authored change is +1,116 net lines, below the approved cap.

Evidence

  • Final creation boundary proof: three cases passed in 216.32 s wall. Late identity/bootstrap holds refuse filesystem changes. The real operator/agent creation flow in isolated fixtures completed in 53.502 s with zero synchronous snapshot subprocesses during workspace preparation and zero host SQL inside admission grants. The negative control failed at the workspace file guard's snapshot fallback in 7.940 s (208.33 s command wall). Guided staging and fresh-workspace siblings passed on the same production tree in 61.838 / 32.814 s. Fixture cleanup uses its canonical agent-before-shared-state order.
  • Released-plugin regression passed: real synchronous SQL allowed outside grants, exact callback/dispatch order, refusal before dispatch, typed commit revocation/rollback, and one warning. Test body 6.154 s, command wall 234.09 s. Its negative control caught the old in-grant invocation. The typed public call compiles.
  • Workspace worker behavior, alias/expiry safety, recovery rollback, settlement, and ownership cases passed in the final validation runs. The completed focused batch also passed 26 ownership/admission cases. Earlier broader Node proof passed 236 tests with one existing platform skip (762.53 s); Bun Talk passed 13 (116.42 s), and team failure/revocation passed 4 (212.52 s).
  • Final wrapper inventory, lease bootstrap, both pre-helper anchors, and all 12 compatibility-registry cases passed: 16 cases, 212.13 s wall, with original deadlines. An earlier loaded-host run had a child status:null and a 120 s timeout; its exact child signal was not captured. The passing replay is not claimed as an inherited-CI qualification. A queued Testbox attempt was stopped without test results.
  • Fresh Madge: 0 cycles (86.64 s). Worker ratchet: no T1 growth. Both line-cap ratchets, the shrink-only assertion ratchet, and the 477/477 environment budget pass. The final test observation-window correction also passes its owning typecheck and formatting check (6.82 s for typecheck).
  • Before final main integration, the full local build completed successfully in 2,023.94 s wall on the shared host, including runtime bundles, core/extension/SDK declarations, SDK export checks, native loading of 53 built control-plane modules, and UI asset/performance checks.
  • Independent Codex review is clean through P2 for the full candidate, the final five-file repair, the subsequent three-file CI repair, the final main-integration candidate including the added lineage route, and the subsequent cleanup-fixture conflict resolution. No accepted actionable finding remains.
  • Final CI-repair proof: 429 Node tests passed in 484.72 s wall, covering Talk client/native consult/storage, all 20 host-hook cleanup cases, and the routing/planner suites. The same 71 Talk tests passed under local Bun 1.4.2 in 243.99 s wall. Bun printed a non-failing directory-mismatch diagnostic; hosted CI uses the pinned Linux fork. Existing exact database-byte assertions remain unchanged.

After the CI repair, the full selected changed-check pipeline completed successfully, including all 27 test typecheck graphs, unused-export scans, and core/script lint. Its 3,078.68 s wall time includes waiting behind the full build. Post-main focused proof then passed 396 Node tests in 330.33 s wall, including the fixed real UI validators, routing, workspace worker/creation guards, plugin compatibility, and all four new lineage cases. Those four lineage cases also passed under Bun in 68.64 s wall. Fresh post-integration production types pass, Madge reports 0 cycles (63.41 s), and the runtime import graph reports 0 cycles. After the later main conflict repair, all 20 cleanup cases plus the PR wrapper inventory check passed in 108.47 s wall; P2 review is clean again. Unchanged proof is retained for the disjoint main advance.

The earlier full changed-check invocation passed its first 24 checks and found two local lint issues: a shadowed test namespace and a method-shaped callback declaration. Both are corrected and pass focused type-aware lint (63.79 s); every remaining check from the same plan also passed, completing the full changed-check coverage. Both Madge and the runtime import-cycle guard report zero cycles. Final exact-head CI run 37075599338 completed successfully at adef036d5fb21beb31bd1ee5cb70d9c58b381d69. No CI rerun or inherited-failure bypass was needed for this head. Local wall times include substantial preparation overhead on the shared host.

CI History and Limits

Run 37062757944 at 88d4a106 completed with 80 successful jobs and four root failures. Three affected jobs exposed two repairable causes: real Talk consumers omitted from the host-broker pools, and cleanup fixtures capturing protected database bytes before asynchronous worker shutdown/checkpoint had settled. The Talk repair routes those three files through existing pools. The initial fixture repair awaited canonical closure at both byte-baseline sites; main subsequently fixed all four closure sites in ee51203de7ba2 (#163805). Merge commit adef036d5fb21beb31bd1ee5cb70d9c58b381d69 resolves the resulting conflict by adopting main’s fixture byte-for-byte, removing our duplicate fixture diff. Main integration introduced one additional real consumer, agent-consult-runtime.lineage.test.ts: all four cases reproduced the missing-host-broker error through workspace preparation (90.33 s wall), so that file is routed through the same existing pool too.

The fourth failure was test/scripts/ui.test.ts > scripts/ui > checks the selected staged directory with both real validators: its fixture omits the now-required asset-manifest.json. The identical failure is independently present on main run 37061184155, Windows job 111018447113, and the fixture/validators/manifest owner are unchanged by this PR. Main subsequently fixed this fixture in 2d1011a9a4161ae3931acfe1dea25800e344e5eb; merge commit 354edf97d4e90933de45925c3d60a6cab86382c5 integrates that fix without rebasing. An inherited-red exception is not being requested for a failure whose fix is now integrated.

The original CI exposed PR-caused bootstrap routing, Bun Talk routing, Windows teardown, and cold setup/creation failures. These were repaired and cleared on a later exact-head run. Main's wrapper-inventory and missed async claim-recovery caller fixes are integrated, along with the environment-name budget repair. Main was merged without rebasing.

A later local run exposed creation timeouts from the newly uncached host recovery-read path; the native fallback and workspace-scoped subprocess regression address that cause. A separate warm-turn fixture hit its first turn's 35-second deadline before workspace dispatch. The same case reproduced on pinned main ed754faa, before workspace tasks, SessionManager opening, or legacy append. Its exact delay within early preparation remains unresolved. This local control is not, by itself, an exact-head hosted CI bypass.

Earlier matched synthetic workspace comparison (main / PR): cold setup 10.66 / 13.70 s; 200 warm preparations 2.66 / 2.28 s; process wall 22.11 / 23.31 s; peak RSS 518,438,912 / 583,270,400 bytes. This describes the scoped workload on a shared host, not a live Gateway latency benchmark.

ClawSweeper revision 9 completed for this exact head at 2026-10-02 23:08 UTC, with no actionable or security findings. Its analysis explicitly confirms that the earlier generic migration-proof concern is resolved because stored contracts are unchanged. The generated checklist still classifies the static SDK compatibility record as a migration; that checklist item is inapplicable, as the same review explains.

Keep canonical snapshots, conditional alias registration, first-writer setup merges, and exact vanished-workspace expiry off the Gateway thread. Preserve live filesystem and caller grants at transaction and commit, recent/future protection, and acknowledged cache retirement through native settlement.
@clawsweeper

clawsweeper Bot commented Oct 2, 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 size: L labels Oct 2, 2026
@steipete

steipete commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 2, 2026, 7:24 PM ET / 23:24 UTC (Revision 10).

ClawSweeper review

What this changes

Moves workspace snapshots, alias registration, setup updates, and expiry cleanup into existing database workers while preserving creation safeguards and released plugin callbacks.

Merge readiness

⛔ Blocked before merge - 1 item remains

The refactor remains useful and has no actionable findings. Earlier callback and recovery-hold defects are resolved; the previous generic migration-proof blocker is inapplicable because stored contracts are unchanged.

Priority: P2
Reviewed head: adef036d5fb21beb31bd1ee5cb70d9c58b381d69

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent worker cutover with relevant boundary proof, preserved compatibility, successful exact-head CI, and no remaining actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Recorded isolated production-path runs exercise real creation, worker SQLite, plugin callbacks, late recovery holds, and transaction/commit revocation, observing successful allowed operations and refusal before forbidden effects. Source matches those scenarios; tests and exact-head CI supplement the proof. Stored contracts are unchanged, so the static SDK record requires no data migration proof. No new execution was performed during this read-only review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Recorded isolated production-path runs exercise real creation, worker SQLite, plugin callbacks, late recovery holds, and transaction/commit revocation, observing successful allowed operations and refusal before forbidden effects. Source matches those scenarios; tests and exact-head CI supplement the proof. Stored contracts are unchanged, so the static SDK record requires no data migration proof. No new execution was performed during this read-only review.
Evidence reviewed 9 items Pinned introduction and clean checkout: Reviewed the introduced delta from db24ac3 to adef036. The checkout remained clean. The supplied stale test merge was not used to infer removal of main behavior.
Current main still needs the cutover: Fetched main still opens the host database for writable workspace snapshots and executes setup merges and expiry through native transactions. Its existing attestation worker does not cover these remaining operations.
Latest release retains host operations: The v2026.9.7 source also retains host database opening, deferred snapshots, setup merges, and expiry transactions; this PR's central cutover is not already shipped.
Findings None None.
Security None None.

How this fits together

Workspace preparation supplies agent creation and reply execution with bootstrap files and durable setup facts. The Gateway retains filesystem and caller checks while existing shared-state workers perform SQLite operations.

flowchart TD
  A[Agent creation and reply preparation] --> B[Workspace preparation]
  B --> C[Host authority and filesystem checks]
  C --> D[Shared-state worker]
  D --> E[Recovery hold and commit checks]
  E --> F[Existing SQLite workspace state]
  F --> G[Settled results and cache retirement]
  G --> B
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +543, Tests +528, Docs +42, Other +3. Total +1116 across 45 files.

View PR surface stats
Area Files Added Removed Net
Source 27 1001 458 +543
Tests 14 670 142 +528
Docs 2 42 0 +42
Config 0 0 0 0
Generated 0 0 0 0
Other 2 4 1 +3
Total 45 1717 601 +1116

Review metrics

Metric Value Why it matters
Production versus test growth Production net +543 LOC; tests and test support net +521 LOC Production growth supports worker transport, authority checks, settlement, and compatibility adapters, with the rationale stated in the PR.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/plugins/compat/workspace-mutation-guard.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep one shared-state worker owner for workspace SQL, with current host authority, transaction-local recovery checks, and the documented SDK compatibility window.

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

Not applicable as a discrete bug report; current-main source directly establishes the remaining host-thread SQL, and the supplied boundary runs exercise its worker replacement.

Is this the best way to solve the issue?

Yes. Reusing the existing broker and connection-bound kernels preserves ownership, while the compatibility adapter avoids breaking released plugins.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9ed025c44dde.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded runtime responsiveness refactor with preserved user-facing contracts.
  • merge-risk: 🚨 compatibility: The public plugin callback acquires documented pre-dispatch timing; the recorded warn-and-allow decision and compatibility adapter cover that tradeoff.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Recorded isolated production-path runs exercise real creation, worker SQLite, plugin callbacks, late recovery holds, and transaction/commit revocation, observing successful allowed operations and refusal before forbidden effects. Source matches those scenarios; tests and exact-head CI supplement the proof. Stored contracts are unchanged, so the static SDK record requires no data migration proof. No new execution was performed during this read-only review.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded isolated production-path runs exercise real creation, worker SQLite, plugin callbacks, late recovery holds, and transaction/commit revocation, observing successful allowed operations and refusal before forbidden effects. Source matches those scenarios; tests and exact-head CI supplement the proof. Stored contracts are unchanged, so the static SDK record requires no data migration proof. No new execution was performed during this read-only review.

Evidence

What I checked:

  • Pinned introduction and clean checkout: Reviewed the introduced delta from db24ac3 to adef036. The checkout remained clean. The supplied stale test merge was not used to infer removal of main behavior. (adef036d5fb2)
  • Current main still needs the cutover: Fetched main still opens the host database for writable workspace snapshots and executes setup merges and expiry through native transactions. Its existing attestation worker does not cover these remaining operations. (src/agents/workspace-state-store.ts:93, 9ed025c44dde)
  • Latest release retains host operations: The v2026.9.7 source also retains host database opening, deferred snapshots, setup merges, and expiry transactions; this PR's central cutover is not already shipped. (src/agents/workspace-state-store.ts:93, c074824a27c9)
  • Authority and settlement remain at production boundaries: Worker mutations request transaction and commit admission, evaluate recovery holds on the transaction connection before commit, and publish expiry receipts only through the transaction publication owner. Host settlement retires the exact committed workspace cache without replay. (src/agents/workspace-state-store.worker.ts:163, adef036d5fb2)
  • Released plugin compatibility: The public adapter preserves beforePersistentApply, permits synchronous database reads outside grants, propagates callback refusal, and warns once. The captured body records Peter's warn-and-allow decision; documentation explicitly explains pre-dispatch timing versus typed commit-time checks and retains compatibility until the next SDK major. (src/plugins/runtime/runtime-agent-workspace.ts:13, adef036d5fb2)
  • No stored-data migration introduced: The compatibility record is static SDK deprecation metadata. Existing workspace tables, row encodings, first-writer timestamps, expiry rules, and recovery receipt decoding are preserved by the extracted kernels. No DDL, schema installer, backfill, or new persisted format appears in the introduced delta. (src/plugins/compat/workspace-mutation-guard.ts:3, adef036d5fb2)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • safzanpirani: 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 (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-02T14:01:06.844Z sha aea1a19 :: blocked before merge. :: none
  • reviewed 2026-10-02T14:17:10.043Z sha ee3545b :: needs maintainer review before merge. :: none
  • reviewed 2026-10-02T14:28:29.352Z sha ee3545b :: needs real behavior proof before merge. :: [P1] [P1] Preserve the released plugin mutation-guard callback
  • reviewed 2026-10-02T14:37:48.806Z sha c8d1def :: needs real behavior proof before merge. :: [P1] [P1] Preserve the released plugin mutation-guard callback | [P2] [P2] Recheck recovery holds before writing the identity file
  • reviewed 2026-10-02T14:47:04.645Z sha c8d1def :: needs real behavior proof before merge. :: [P1] [P1] Preserve the released plugin mutation-guard callback | [P2] [P2] Recheck recovery holds before writing the identity file
  • reviewed 2026-10-02T20:54:36.530Z sha 88d4a10 :: blocked before merge. :: none
  • reviewed 2026-10-02T22:59:34.250Z sha 354edf9 :: blocked before merge. :: none
  • reviewed 2026-10-02T23:08:17.019Z sha adef036 :: blocked before merge. :: none

Split workspace guards into SQL-free host authority and a transaction-local recovery predicate. Preserve the recovery reader and typed refusal across worker transport, and prove creation grants avoid host SQL and snapshot children.

Route bootstrap and Bun Talk fixtures through the host broker, join Windows worker teardown, and keep the assertion baseline shrink-only.
@steipete

steipete commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime scripts Repository scripts commands Command implementations size: XL and removed size: L labels Oct 2, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 2, 2026
Keep the Talk worker fixture in canonical order so CI planning and CLI ownership select the same files.
@steipete

steipete commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. label Oct 2, 2026
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. label Oct 2, 2026
@steipete

steipete commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit 6c1e166 into main Oct 2, 2026
182 of 183 checks passed
@steipete
steipete deleted the dbasync/wsstate branch October 2, 2026 23:26
@steipete

steipete commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 3, 2026
…ead (openclaw#163496)

* perf(agents): move workspace state operations into shared workers

Keep canonical snapshots, conditional alias registration, first-writer setup merges, and exact vanished-workspace expiry off the Gateway thread. Preserve live filesystem and caller grants at transaction and commit, recent/future protection, and acknowledged cache retirement through native settlement.

* fix(agents): evaluate workspace recovery holds in worker transactions

Split workspace guards into SQL-free host authority and a transaction-local recovery predicate. Preserve the recovery reader and typed refusal across worker transport, and prove creation grants avoid host SQL and snapshot children.

Route bootstrap and Bun Talk fixtures through the host broker, join Windows worker teardown, and keep the assertion baseline shrink-only.

* fix(test): preserve sorted Gateway worker ownership

Keep the Talk worker fixture in canonical order so CI planning and CLI ownership select the same files.

* fix: preserve workspace mutation guards across worker admission

Keep the released plugin callback compatible and deprecated, with actionable synchronous database access refusal inside worker grants. Recheck recovery holds before host filesystem effects and preserve callback refusals through auxiliary attestation.

* fix: allow legacy workspace guards before worker dispatch

Preserve synchronous database access in released plugin callbacks with one deprecation warning. Keep typed guards at commit admission and recovery checks before filesystem effects. Extract persisted state-owner record admission without changing ownership policy.

* fix(agents): avoid snapshots in workspace recovery guards

Keep current host recovery checks native outside worker grants while preserving private snapshots for artifact-preserving and schema-admission reads. Prove that real workspace preparation during creation spawns no synchronous snapshots, retaining the grant SQL boundary and late-hold regressions.

* fix: declare the ownership guard callback as a function

Use a function-valued callback contract and avoid shadowing the workspace test namespace. Both corrections preserve runtime behavior and pass focused type-aware lint and independent P2 review.

* fix(test): route Talk workers and settle cleanup fixtures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant