Skip to content

refactor(storage): run repository workspace SQL in workers - #161124

Merged
steipete merged 6 commits into
mainfrom
codex/repository-workspaces
Sep 29, 2026
Merged

steipete merged 6 commits into
mainfrom
codex/repository-workspaces

Conversation

@steipete

@steipete steipete commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Related: #145048. Builds on #160858.

What Problem This Solves

Repository session creation, checkpoint updates, and cleanup still access shared SQLite on the Gateway thread after the lazy-open prerequisite.

User Impact

Repository sessions retain their existing behavior while database work moves to the existing workers. No schema, configuration, permission, retention, or upgrade changes are required.

Why This Change Was Made

The repository workspace owner performs reads and synchronous Kysely transactions in the existing SQLite workers. Native commit receipts govern publication, callers await settlement, and prepared repository facts serve synchronous authorization and event publication within their original lifetime. The obsolete native-handle factory option is removed. Session events carry a bound recipient projector, while connections retain ancestor delivery receipts and live-run state. Publication verifies the current connection projection before preparation and for each recipient.

Creation, fork, and cleanup retain the original database source. Bulk cleanup checks full logical session absence at native receipt and workspace grants, then rereads the SQLite revision after the host grant. Direct session deletion preserves its separate historical-receipt and successor rules. A matching native commit receipt authorizes the fixed artifact-cleanup tail within the original retained operation. Ordinary database close joins that cleanup; a different or missing physical source still refuses removal. This does not introduce a cross-database atomicity guarantee.

Evidence

  • Current-main receiving: 80 read-worker, repository, deletion, receipt, native-opening, and WAL-budget cases pass, along with core and owning test types.
  • Broader receiving: 198 Gateway/lifecycle cases and all 27 test type graphs pass. Another 66 repository/checkpoint/node-publication/file-RPC cases cover the path-only factory cutover. Unchanged-source proof is reused across the final canonical composition.
  • Real SQLite controls reproduce workspace loss after a foreign write during a grant, receipt loss with the former receipt implementation, and an exact-only lookup bypass of malformed folded siblings. The repaired paths pass.
  • Creation/fork controls distinguish caller cancellation from database retirement. Reply-loss and filesystem-cleanup controls verify native settlement and retained custody.
  • The full production build passed on the prior receiving cut. A source-isolated eager-import regression was repaired; the composed source passes the affected unified bundle and zero-cycle checks. Independent review is clean through P2.

The first CI run exposed two introduced static type-import cycles. Their contracts now live at the appropriate leaf boundaries; the full architecture checks pass. The owner-replacement regression failed before repair and passes with the 45-case delivery group. The affected 138-case transport/ancestor and 118-case lifecycle/activity groups also pass, with unchanged-source proof reused after the final owner check. Exact-head CI status and attribution are recorded below.

ClawSweeper’s committed-deletion cleanup finding is repaired. A gated real filesystem removal proves close waits for cleanup; a real directory swap proves replacement artifacts survive. All 11 repository-owner and 29 deletion/receipt caller cases pass. The final focused core/owner types, lint, unified bundle, and static cycle checks pass; the preceding complete changed-source gate passed core and all 27 test type graphs.

Measured test cost: pnpm test src/state/session-repository-workspaces.test.ts --maxWorkers=1 took 86.19 seconds wall time including worker preparation (33.34 seconds inside Vitest). The final 45-case Gateway group took 58.54 seconds; the 29-case caller group took 115.04 seconds across two shards. Current-head CI timings are not yet available. No stored representation, schema version, config default, or upgrade behavior changes are introduced; the native schema guard remains at v19.

Receiving main at 92a7977173fb preserves its newer diff, dispatch, and recovery changes. The seven affected caller files pass 238 cases with three existing skips; the final 11-case repository-owner file passes. The physical directory-swap regression uses the existing non-Windows applicability rule and restores file families before native close. Its unfixed control deleted the replacement artifact, while the repaired owner refuses that removal. The ordinary-close control runs on all platforms.

CI also caught noncanonical ordering in the four newly registered Gateway worker test paths. Those declarations now occupy their sorted positions, without changing test membership or fork ownership. The unchanged CLI ownership suite passes all 378 cases (53.97 seconds including runner setup), and the narrow correction has a clean independent review.

The latest CI found a stale broadcast-option assertion after the private projection handoff. Its terminal cancellation payload and persistence were correct. Six exact assertions now include the private callback, and the prepared lifecycle fixture implements the existing read contract. All 71 cases across the four affected files pass (173.47 seconds inside Vitest), preserving payload, recipient, timing, and failed-write checks. The narrow fixture correction has a clean independent review.

Exact-head CI 36566463225 stopped on a pre-existing UI type-import cycle between chat-attachment-controls.types.ts and chat-attachment-reads.ts. Both edges, the checker, resolver, TypeScript configuration, and dependencies are identical in tested baseline b4bdf82761dd and merge 5e2c2d692b7b; independent source review confirmed the closed cycle. The failure monitor cancelled 116 other jobs, whose coverage remains unrun. The earlier introduced failures have been repaired and locally qualified; this run is not represented as green. The UI cycle has a separate canonical repair owner.

Move repository reads and synchronous Kysely mutation kernels to the
existing SQLite workers, and await their actual callers. Publish row changes
from native commit receipts and retain operation custody through cleanup.
Prepared repository facts serve synchronous authorization and event frames.

Revalidate the original physical and logical session source at receipt and
workspace grants, preserving full logical lookup and direct deletion's
historical receipt rules. Remove the obsolete native-handle factory option.
No storage schema, public configuration, permission or retention change.

Current-main proof passes 80 focused SQLite/worker cases and owning types;
qualified receiving adds 198 lifecycle/Gateway cases, all 27 test type graphs,
and 66 repository/checkpoint/publication/file-RPC cases. Source controls
reproduce foreign-write row and receipt loss, and the repaired paths pass.
Independent review is clean through P2. Full build and affected receiving
bundle checks pass with recorded source applicability.

Completes the repository domain cutover after #145048 and #160858.
@clawsweeper

clawsweeper Bot commented Sep 29, 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 gateway Gateway runtime agents Agent runtime and tooling size: XL labels Sep 29, 2026
@steipete
steipete marked this pull request as ready for review September 29, 2026 09:50
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 29, 2026
@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 29, 2026, 8:20 AM ET / 12:20 UTC (Revision 5).

ClawSweeper review

What this changes

Moves repository workspace reads and mutations into SQLite workers and updates session creation, checkpoint, deletion, recovery, and publication callers to use settled worker results.

Merge readiness

⛔ Blocked before merge - 5 items remain

Current main still performs repository workspace SQL on the Gateway thread, so this PR remains useful. The earlier artifact-cleanup finding is repaired. The remaining merge blocker is upgrade proof for an existing repository session created by the published driver.

Priority: P2
Reviewed head: abe20b37474a125963ada3c3fd704197775b7a23

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The worker cutover has focused production-path and regression coverage, with one material published-driver upgrade check outstanding.
Proof confidence 🌊 off-meta tidepool Not applicable: Repository State identifies a MEMBER-authored internal refactor, so the external-contributor proof gate does not apply. Real SQLite, filesystem, and Gateway tests support the worker path, but an existing v2026.9.6 session upgrade remains unverified; no stored-data representation changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Repository State identifies a MEMBER-authored internal refactor, so the external-contributor proof gate does not apply. Real SQLite, filesystem, and Gateway tests support the worker path, but an existing v2026.9.6 session upgrade remains unverified; no stored-data representation changes.
Evidence reviewed 8 items Current main still uses foreground SQL: The current-main store opens the shared database and runs synchronous transactions for repository workspace operations.
Introduced worker owner: The branch routes workspace reads and mutations through the shared-state worker and checks admission at transaction and commit stages.
Committed cleanup custody: A matching native commit result precedes artifact removal, and the original database identity is checked before that removal.
Findings None None.
Security None None.

How this fits together

The Gateway creates and manages repository-backed cloud sessions. Their workspace metadata lives in shared SQLite and feeds session views, worker placement, checkpoint recovery, and GitHub publication.

flowchart LR
  A[Session request] --> B[Gateway admission]
  B --> C[SQLite worker]
  C --> D[Repository workspace row]
  D --> E[Commit receipt]
  E --> F[Session and publication views]
  E --> G[Artifact cleanup]
Loading

Before merge

  • Resolve merge risk (P1) - An existing v2026.9.6 repository session has not been reopened and checkpointed through the candidate. An installed user's session could fail at worker admission or recovery despite fresh-state tests passing.
  • Complete next step (P2) - Record a published v2026.9.6-driver × candidate upgrade of an existing repository session, including reopen and checkpoint use, before merge.
  • Resolve review confidence - ClawSweeper must reach high confidence before merge readiness is known.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production and test line delta production +2585/−1062; tests +1650/−374 The worker, publication, and caller cutover explains the production growth; the PR body provides focused test-cost measurements.

Stored data model

Persistent data-model change detected: unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Prove an existing-session upgrade (recommended)
    Run the published v2026.9.6 driver against an existing repository session, then open and checkpoint it with the candidate and record the observed result.

Technical review

Best possible solution:

Keep one worker-backed repository workspace owner while proving existing published-driver sessions retain their rows, checkpoints, and artifacts through an update.

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

Yes. Current-main source shows repository workspace reads and transactions running synchronously in the Gateway store; no runtime reproduction was executed in this read-only review.

Is this the best way to solve the issue?

Yes. The branch moves SQL to the existing worker owner and carries commit receipts to callers; published-driver upgrade validation is still required.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded storage performance and ownership improvement without an observed urgent user regression.
  • merge-risk: 🚨 compatibility: Worker-backed reopening of repository sessions created by the published driver remains unverified.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository State identifies a MEMBER-authored internal refactor, so the external-contributor proof gate does not apply. Real SQLite, filesystem, and Gateway tests support the worker path, but an existing v2026.9.6 session upgrade remains unverified; no stored-data representation changes.

Evidence

What I checked:

Likely related people:

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

  • Demonstrate reopening and checkpointing an existing v2026.9.6 repository session with the candidate.

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 (4 earlier review cycles)
  • reviewed 2026-09-29T09:59:50.687Z sha 86487da :: blocked before merge. :: [P2] Finish artifact cleanup after a committed workspace deletion
  • reviewed 2026-09-29T11:01:52.420Z sha ee23729 :: blocked before merge. :: none
  • reviewed 2026-09-29T11:38:32.962Z sha 76f784b :: blocked before merge. :: none
  • reviewed 2026-09-29T11:55:00.693Z sha 0c4dda3 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Sep 29, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 29, 2026
@steipete
steipete merged commit 124ddc0 into main Sep 29, 2026
108 of 227 checks passed
@steipete
steipete deleted the codex/repository-workspaces branch September 29, 2026 12:28
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

steipete added a commit that referenced this pull request Sep 29, 2026
…0158)

The process census treated unfamiliar-but-readable argv as a failed inspection, so an unrelated `bun run --silent` process vetoed Doctor's legacy plugin-capture and retained-runtime cleanup. The census now returns a closed holder | non-holder | unresolved result: only positive evidence of foreignness permits cleanup, and every unresolved evidence source (unreadable argv/cwd/package identity, batch timeout) keeps the veto.

Closes #159950. Replaces #159951 (thanks @Marvinthebored for the finding).

Landed under the pre-existing-red rule: remaining CI failures are current main reds from #161124 (server-restart-sentinel, github-shared-publication-events, server.sessions.list-changed, github-publication-personal-pending).
steipete added a commit that referenced this pull request Sep 29, 2026
)

Windows cron isolated-agent runs and session transcript discovery failed with DataCloneError because the request carried the Windows process-environment proxy into the transcript worker. Exact-entry and discovery requests now capture a plain, bounded storage environment and the worker restores Windows lookup semantics.

Closes #157067. Closes #159339. Supersedes #157109 and #157348 (closed with credit).

Landed under the pre-existing-red rule (#161124 and session-store main reds).
steipete added a commit that referenced this pull request Sep 29, 2026
A config change applied by an in-process restart whose startup refused the new config left the process alive but serving nothing: triage removed the refused setting, but the restart loop discarded triage completion and waited indefinitely. The startup owner now retries once after confirmed triage cleanup and exits nonzero when recovery fails, so the supervisor restarts it.

Closes #159539.

Landed under the pre-existing-red rule (#161124 and session-store main reds).
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
…161124)

* refactor(storage): run repository workspace SQL in workers

Move repository reads and synchronous Kysely mutation kernels to the
existing SQLite workers, and await their actual callers. Publish row changes
from native commit receipts and retain operation custody through cleanup.
Prepared repository facts serve synchronous authorization and event frames.

Revalidate the original physical and logical session source at receipt and
workspace grants, preserving full logical lookup and direct deletion's
historical receipt rules. Remove the obsolete native-handle factory option.
No storage schema, public configuration, permission or retention change.

Current-main proof passes 80 focused SQLite/worker cases and owning types;
qualified receiving adds 198 lifecycle/Gateway cases, all 27 test type graphs,
and 66 repository/checkpoint/publication/file-RPC cases. Source controls
reproduce foreign-write row and receipt loss, and the repaired paths pass.
Independent review is clean through P2. Full build and affected receiving
bundle checks pass with recorded source applicability.

Completes the repository domain cutover after openclaw#145048 and openclaw#160858.

* fix(gateway): bind prepared events to the current projection

* fix(storage): finish committed repository artifact cleanup

* fix(test): keep Gateway worker paths in canonical order

* test(gateway): align prepared publication fixtures
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
…nclaw#160158)

The process census treated unfamiliar-but-readable argv as a failed inspection, so an unrelated `bun run --silent` process vetoed Doctor's legacy plugin-capture and retained-runtime cleanup. The census now returns a closed holder | non-holder | unresolved result: only positive evidence of foreignness permits cleanup, and every unresolved evidence source (unreadable argv/cwd/package identity, batch timeout) keeps the veto.

Closes openclaw#159950. Replaces openclaw#159951 (thanks @Marvinthebored for the finding).

Landed under the pre-existing-red rule: remaining CI failures are current main reds from openclaw#161124 (server-restart-sentinel, github-shared-publication-events, server.sessions.list-changed, github-publication-personal-pending).
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
…claw#160075)

Windows cron isolated-agent runs and session transcript discovery failed with DataCloneError because the request carried the Windows process-environment proxy into the transcript worker. Exact-entry and discovery requests now capture a plain, bounded storage environment and the worker restores Windows lookup semantics.

Closes openclaw#157067. Closes openclaw#159339. Supersedes openclaw#157109 and openclaw#157348 (closed with credit).

Landed under the pre-existing-red rule (openclaw#161124 and session-store main reds).
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
…#160173)

A config change applied by an in-process restart whose startup refused the new config left the process alive but serving nothing: triage removed the refused setting, but the restart loop discarded triage completion and waited indefinitely. The startup owner now retries once after confirmed triage cleanup and exits nonzero when recovery fails, so the supervisor restarts it.

Closes openclaw#159539.

Landed under the pre-existing-red rule (openclaw#161124 and session-store main reds).
vincentkoc added a commit that referenced this pull request Oct 1, 2026
Move synchronous session description into the existing materialization owner, preserving owner context, exact refresh, archive handling and generation checks. This resolves the inherited max-lines failure without changing lint limits or row behavior.

Adapt the structural extraction from 124ddc0 (#161124), without the later repository-workspace changes. Existing resident and incognito tests pass before and after (16 cases); both touched files pass the original syntax lint rules.

Co-authored-by: Peter Steinberger <[email protected]>
RomneyDa added a commit that referenced this pull request Oct 1, 2026
* fix(sessions): restore Windows cron setup and session admission (#160075)

Windows cron isolated-agent runs and session transcript discovery failed with DataCloneError because the request carried the Windows process-environment proxy into the transcript worker. Exact-entry and discovery requests now capture a plain, bounded storage environment and the worker restores Windows lookup semantics.

Closes #157067. Closes #159339. Supersedes #157109 and #157348 (closed with credit).

Landed under the pre-existing-red rule (#161124 and session-store main reds).

(cherry picked from commit a181c3f)

* fix(codex): avoid browser auth in CUA readiness (#162467)

(cherry picked from commit 9f9dab3)

* chore(release): prepare 2026.9.7-1

* chore(release): prepare 2026.9.8

* fix(gateway): normalize quiescence recovery diagnostics

Keep the retained watchdog recovery error consistent with the single-line
workspace sync error surfaced to operators on single-digit days. Preserve
raw ps start identities for signal guards and existing watchdogs.

Make the existing exhaustion regression calendar-independent with padded
lstart input, retaining the exact recoveryError assertion and proving
that all stopped workers resume after process probes recover.

Verified the original UTC failure and the deterministic pre-fix failure.
The full quiescence script file passes under UTC, the exact regression
passes in the default timezone, and 15 sibling tests pass. Core typecheck,
formatting, diff checks, and independent review also pass.

---------

Co-authored-by: Peter Steinberger <[email protected]>
yozakura-ava pushed a commit to yozakura-ava/openclaw that referenced this pull request Oct 6, 2026
…#160173)

A config change applied by an in-process restart whose startup refused the new config left the process alive but serving nothing: triage removed the refused setting, but the restart loop discarded triage completion and waited indefinitely. The startup owner now retries once after confirmed triage cleanup and exits nonzero when recovery fails, so the supervisor restarts it.

Closes openclaw#159539.

Landed under the pre-existing-red rule (openclaw#161124 and session-store main reds).

(cherry picked from commit 42700f9)
steipete added a commit that referenced this pull request Oct 15, 2026
…ply text (wave-4 bundle) (#172669)

* refactor(infra): remove redundant replay and freshness machinery

Trust successful migration statements inside their synchronous transactions,
reuse unchanged approval parses, share canonical package-root discovery,
namespace directory caches by plugin identity, and simplify ephemeral presence,
OS facts and suspension timer bookkeeping. Keep source validation, conflicts,
transaction durability, postcommit checks, security authority and write settlement.

Best-effort tradeoffs accepted

- Node-host own-write verification (#108457): no human successful-SQL-loss report; SQL errors still roll back, and independent source retirement checks remain.
- Workspace setup/attestation replay (#109147): no human driver-rewrite report; trust successful writes while retaining fingerprints and later source checks.
- APNs expected-ID replay (#108543): no human silent-insert-loss report; canonical parsing, tombstones and receipts remain.
- Device-auth presence assertion (#112663): no human successful-upsert-loss report; credential validation and transaction failure handling remain.
- Device-identity replay (#110392): no human silent-row-rewrite report; preserve independent post-await verification before source deletion.
- MCP OAuth replay (#161219): no human silent-write-loss report; canonical/source parsing and worker admission remain.
- Exec-approval read/parse/deep-compare replay (#114063): no human successful-driver-rewrite report; malformed policy stays fail-closed and actual authority is unchanged.
- Shared-auth target reread (#123349): no human silent-row-rewrite report; return the known SQL postimage and keep independent copy/flip/cleanup checks.
- Identical authored approval bytes (#168094) reuse the existing parse; changed normalized bytes still parse before publication.
- Plugin metadata fingerprinting (353d778): no human in-place metadata-mutation report; distinct objects remain isolated, and same-object edits use TTL/reset.
- Duplicate asset ancestor search (7224585): no human cached-miss incident; canonical realpath/wrapper discovery remains, while newly appearing packages need owner invalidation/restart.
- Presence logical clock (#134737): provenance is synthetic rollback/suspend tests; clock correction may temporarily retain or hide display rows until full update/reconnect, wall time catches up, or restart. TTL, capacity and connection privacy remain.
- Suspension timer generation (#130003): the removed test directly called a canceled callback; native timer cancellation and current-entry authority remain. An out-of-contract timer implementation could resume a renewed lease early.
- OS tuple-keyed cache (#135911): keep measured probe sharing and sticky labels; hot-patching OS identity needs restart rather than another namespace.
- Presence list type guards (409a160): callers supply validated arrays; existing normalization still owns their values.

Production +40/-228, net -188. Focused migration, asset/cache, presence/caller,
approval-publication and suspension/OS tests pass, as do production and infra-test
types, changed-file lint, assertion and suppression checks, and zero-cycle checks.
Independent final review has no actionable P0-P2 findings. No schema, durability,
retention, indexing, permission, recovery or public SDK change is intended.

Broad changed-check is not claimed green: the original base reproduces the
455-versus-454 environment budget failure. The initial Web Push Doctor timeout
remains unattributed; all Web Push production hunks were dropped and its exact
test passed on restored source. Full build and hosted CI remain unrun.

* refactor(agents): simplify reply preparation and refresh bookkeeping

Share typed actor-store adapters and prepared async auth reads. Reuse the
admitted memory-flush plan, retain last-good catalog views by provider, and
remove unused metadata bookkeeping and config projections. Preserve live
credential/effect authority, FIFO, transcript durability, and ordinary write
settlement. Net production reduction: 303 lines.

Best-effort tradeoffs accepted:
- Plugin-drain successors (#162301, synthetic): wait the current drain once;
  a later reload owns its own publication and recovery.
- A changed memory-flush plan during preparation (#162177/#121157, synthetic):
  finish with the admitted plan; the next turn resolves again.
- Per-row catalog freshness (#158113, synthetic): failed discovery retains
  the provider's last-good configured and supplemental overlays until success.
  Existing auth/profile/source gates and successful-empty replacement remain.
- MCP sibling invalidation during discovery (#138694, synthetic): a listing
  may briefly be stale; the next read observes the invalidation.
- Passive context metadata supersession (#119607, synthetic): late discovered
  metadata may win until refresh. Keep the single current-promise check before
  replacing configured limits, preserving the human capacity fix (#39857).
- Registration-time question answers (#110372/#134003, synthetic): a prompt
  can briefly race the answer; its terminal signal closes delivery.
- Duplicate or never-attached internal question registrations: both real
  producers attach once synchronously. Unsupported misuse loses its extra
  diagnostic/disposal wakeup; ordinary lifecycle rejection remains.
- Cancellation publication once/must-consume flags (#161124, synthetic): the
  sole internal producer invokes once. Keep active-scope/effect authority.
- In-flight placement-service replacement (#164744, synthetic): use the
  captured startup service, with its observation and writer authority intact.
- Compaction callback rebinding (#146732/#163264, synthetic): current work
  retains its captured callbacks and live assertion; later work captures anew.
- Re-entrant logging between synchronous run-owner checks: #162227 removed
  the awaited retry, making the second check redundant. Real post-await and
  mutation-effect checks remain.
- Startup diagnostic admission (#146792): the sole producer checks lifecycle
  immediately before recording. Remove only the recorder's duplicate check;
  preserve the human abort/recovery fix (#146692), reset, and admin redaction.

Release-note context: verbose diagnostics no longer include suppressed reply
text or background bash command contents. Execution and user replies remain
unchanged. Config show uses the same schema-aware redactor without cloning
an already detached result or redacting unused snapshot views.

Validation: touched core, messaging and Gateway-method type graphs passed;
49 changed TypeScript files passed targeted lint/format; runtime and Madge
cycles are both zero. Auth reader, question authority, memory flush, restart
claim, catalog worker, cancellation and compaction boundary proof is recorded
in the lane ledger. Final supplemental run: 392 tests passed, four failed
across 28 files, with final source verification. All 120 agents-support tests
passed, including refresh coalescing, publication, run-wait and compaction.
The four failures were an unchanged 120s ACP reset deadline and three MCP
fixtures settling before child startup markers (empty logs, existing 1-2s
connection/4s catalog deadlines). Narrow failed-case replay passed ACP reset
and two MCP cases; the one-second MCP retirement fixture still failed before
its first child marker. Clean lane-base comparison could not reach assertions:
the temporary checkout lacked workspace-local dependency links for worker
compilation. That case is unresolved, not proven inherited; coordinator-bundle
CI must adjudicate it. No deadline, retry, skip or assertion was weakened.
The final selected real-dispatch suppressed-reply logging regression passed
with completed source verification (one selected case, 202.58s wrapper).

Independent P0-P2 review completed four passes. Declined duplicate findings
about unsupported placement-service hot-swap (real observation/database/writer
authority remains) and alleged run-wait awaits (only synchronous logging lies
between the checks; real mutation and post-await checks remain).

Broad check-changed is NOT green: env-name budget 455/454 also fails on the
unchanged lane-base index, with no added env names; production/full-tree Knip
hit their existing 600s budget; the silent legacy-store scan was interrupted
after 782s. Those two scans are missing proof, not attributed inherited reds.
Hosted coordinator-bundle CI remains the broad gate. Owned mock/type/legacy
fixture findings were corrected and their targeted replays pass.

No changelog, dependency, database schema, durability, retention, permission,
or public API change is included. BELOW-500 branch-only coordinator handoff;
no lane PR or merge.

* chore: shrink stale reply assertion allowance

* test: align catalog publication calls with current contract
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 15, 2026
…ply text (wave-4 bundle) (openclaw#172669)

* refactor(infra): remove redundant replay and freshness machinery

Trust successful migration statements inside their synchronous transactions,
reuse unchanged approval parses, share canonical package-root discovery,
namespace directory caches by plugin identity, and simplify ephemeral presence,
OS facts and suspension timer bookkeeping. Keep source validation, conflicts,
transaction durability, postcommit checks, security authority and write settlement.

Best-effort tradeoffs accepted

- Node-host own-write verification (openclaw#108457): no human successful-SQL-loss report; SQL errors still roll back, and independent source retirement checks remain.
- Workspace setup/attestation replay (openclaw#109147): no human driver-rewrite report; trust successful writes while retaining fingerprints and later source checks.
- APNs expected-ID replay (openclaw#108543): no human silent-insert-loss report; canonical parsing, tombstones and receipts remain.
- Device-auth presence assertion (openclaw#112663): no human successful-upsert-loss report; credential validation and transaction failure handling remain.
- Device-identity replay (openclaw#110392): no human silent-row-rewrite report; preserve independent post-await verification before source deletion.
- MCP OAuth replay (openclaw#161219): no human silent-write-loss report; canonical/source parsing and worker admission remain.
- Exec-approval read/parse/deep-compare replay (openclaw#114063): no human successful-driver-rewrite report; malformed policy stays fail-closed and actual authority is unchanged.
- Shared-auth target reread (openclaw#123349): no human silent-row-rewrite report; return the known SQL postimage and keep independent copy/flip/cleanup checks.
- Identical authored approval bytes (openclaw#168094) reuse the existing parse; changed normalized bytes still parse before publication.
- Plugin metadata fingerprinting (f31bc71): no human in-place metadata-mutation report; distinct objects remain isolated, and same-object edits use TTL/reset.
- Duplicate asset ancestor search (40fb74f): no human cached-miss incident; canonical realpath/wrapper discovery remains, while newly appearing packages need owner invalidation/restart.
- Presence logical clock (openclaw#134737): provenance is synthetic rollback/suspend tests; clock correction may temporarily retain or hide display rows until full update/reconnect, wall time catches up, or restart. TTL, capacity and connection privacy remain.
- Suspension timer generation (openclaw#130003): the removed test directly called a canceled callback; native timer cancellation and current-entry authority remain. An out-of-contract timer implementation could resume a renewed lease early.
- OS tuple-keyed cache (openclaw#135911): keep measured probe sharing and sticky labels; hot-patching OS identity needs restart rather than another namespace.
- Presence list type guards (3965f6b): callers supply validated arrays; existing normalization still owns their values.

Production +40/-228, net -188. Focused migration, asset/cache, presence/caller,
approval-publication and suspension/OS tests pass, as do production and infra-test
types, changed-file lint, assertion and suppression checks, and zero-cycle checks.
Independent final review has no actionable P0-P2 findings. No schema, durability,
retention, indexing, permission, recovery or public SDK change is intended.

Broad changed-check is not claimed green: the original base reproduces the
455-versus-454 environment budget failure. The initial Web Push Doctor timeout
remains unattributed; all Web Push production hunks were dropped and its exact
test passed on restored source. Full build and hosted CI remain unrun.

* refactor(agents): simplify reply preparation and refresh bookkeeping

Share typed actor-store adapters and prepared async auth reads. Reuse the
admitted memory-flush plan, retain last-good catalog views by provider, and
remove unused metadata bookkeeping and config projections. Preserve live
credential/effect authority, FIFO, transcript durability, and ordinary write
settlement. Net production reduction: 303 lines.

Best-effort tradeoffs accepted:
- Plugin-drain successors (openclaw#162301, synthetic): wait the current drain once;
  a later reload owns its own publication and recovery.
- A changed memory-flush plan during preparation (openclaw#162177/openclaw#121157, synthetic):
  finish with the admitted plan; the next turn resolves again.
- Per-row catalog freshness (openclaw#158113, synthetic): failed discovery retains
  the provider's last-good configured and supplemental overlays until success.
  Existing auth/profile/source gates and successful-empty replacement remain.
- MCP sibling invalidation during discovery (openclaw#138694, synthetic): a listing
  may briefly be stale; the next read observes the invalidation.
- Passive context metadata supersession (openclaw#119607, synthetic): late discovered
  metadata may win until refresh. Keep the single current-promise check before
  replacing configured limits, preserving the human capacity fix (openclaw#39857).
- Registration-time question answers (openclaw#110372/openclaw#134003, synthetic): a prompt
  can briefly race the answer; its terminal signal closes delivery.
- Duplicate or never-attached internal question registrations: both real
  producers attach once synchronously. Unsupported misuse loses its extra
  diagnostic/disposal wakeup; ordinary lifecycle rejection remains.
- Cancellation publication once/must-consume flags (openclaw#161124, synthetic): the
  sole internal producer invokes once. Keep active-scope/effect authority.
- In-flight placement-service replacement (openclaw#164744, synthetic): use the
  captured startup service, with its observation and writer authority intact.
- Compaction callback rebinding (openclaw#146732/openclaw#163264, synthetic): current work
  retains its captured callbacks and live assertion; later work captures anew.
- Re-entrant logging between synchronous run-owner checks: openclaw#162227 removed
  the awaited retry, making the second check redundant. Real post-await and
  mutation-effect checks remain.
- Startup diagnostic admission (openclaw#146792): the sole producer checks lifecycle
  immediately before recording. Remove only the recorder's duplicate check;
  preserve the human abort/recovery fix (openclaw#146692), reset, and admin redaction.

Release-note context: verbose diagnostics no longer include suppressed reply
text or background bash command contents. Execution and user replies remain
unchanged. Config show uses the same schema-aware redactor without cloning
an already detached result or redacting unused snapshot views.

Validation: touched core, messaging and Gateway-method type graphs passed;
49 changed TypeScript files passed targeted lint/format; runtime and Madge
cycles are both zero. Auth reader, question authority, memory flush, restart
claim, catalog worker, cancellation and compaction boundary proof is recorded
in the lane ledger. Final supplemental run: 392 tests passed, four failed
across 28 files, with final source verification. All 120 agents-support tests
passed, including refresh coalescing, publication, run-wait and compaction.
The four failures were an unchanged 120s ACP reset deadline and three MCP
fixtures settling before child startup markers (empty logs, existing 1-2s
connection/4s catalog deadlines). Narrow failed-case replay passed ACP reset
and two MCP cases; the one-second MCP retirement fixture still failed before
its first child marker. Clean lane-base comparison could not reach assertions:
the temporary checkout lacked workspace-local dependency links for worker
compilation. That case is unresolved, not proven inherited; coordinator-bundle
CI must adjudicate it. No deadline, retry, skip or assertion was weakened.
The final selected real-dispatch suppressed-reply logging regression passed
with completed source verification (one selected case, 202.58s wrapper).

Independent P0-P2 review completed four passes. Declined duplicate findings
about unsupported placement-service hot-swap (real observation/database/writer
authority remains) and alleged run-wait awaits (only synchronous logging lies
between the checks; real mutation and post-await checks remain).

Broad check-changed is NOT green: env-name budget 455/454 also fails on the
unchanged lane-base index, with no added env names; production/full-tree Knip
hit their existing 600s budget; the silent legacy-store scan was interrupted
after 782s. Those two scans are missing proof, not attributed inherited reds.
Hosted coordinator-bundle CI remains the broad gate. Owned mock/type/legacy
fixture findings were corrected and their targeted replays pass.

No changelog, dependency, database schema, durability, retention, permission,
or public API change is included. BELOW-500 branch-only coordinator handoff;
no lane PR or merge.

* chore: shrink stale reply assertion allowance

* test: align catalog publication calls with current contract
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant