Skip to content

fix(cron): run scheduled work with current agent tools - #161105

Open
sjf-oa wants to merge 1 commit into
sjf/no-reply-explicit-silencefrom
sjf/cron-current-agent-tools
Open

sjf-oa wants to merge 1 commit into
sjf/no-reply-explicit-silencefrom
sjf/cron-current-agent-tools

Conversation

@sjf-oa

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

Copy link
Copy Markdown
Contributor

Why

Scheduled jobs can stop working after tools, plugins, or runtimes change because their saved tool inventory no longer matches the owning agent. AgentsAPI also rejects those saved inventories when they omit native capabilities it cannot disable.

What Problem This Solves

Combine the three release fixes so every cron backend, including Codex and AgentsAPI, runs with the owning agent's current tools and permissions.

User Impact

  • New jobs no longer capture per-job tool lists or application permission snapshots. Existing saved lists remain readable but do not constrain execution.
  • New toolsAllow and --tools requests fail with guidance to configure the owning agent. Clearing a legacy list remains supported.
  • Current agent policy, authenticated requester and account identity, mutation grants, execution placement, and delivery authority still apply. A job does not gain tools disabled by its owning agent.

Earlier evidence

Ported the release changes onto main at e43402af0e29a3c3d5efc9077ce2559ab091a15a, retaining newer requester authorization and cancellation behavior. Removed tests for retired snapshot enforcement and adapted coverage for current policy and request rejection.

At the initial publication, unit tests, formatters, builds, and live tests had not been run. Prompt snapshots still need regeneration; their generator invokes the formatter, which is currently outside the requested validation scope. Test timing is therefore unmeasured. Independent source review of published commit 1632b4f859b30a27169410383c243658e0454e0c completed with no actionable P0/P1 findings; git diff --check passes. Current message policy is checked when building the tool catalog and again on every scheduled invocation. UI cloning, monitor planning, and existing creation fixtures were updated to the same contract.

Supersedes the narrower AgentsAPI-only approach in #160706.

Rebase verification, 2026-10-01 PDT

Published head: 6a4a5b97d64db3c90dde0925b8dd7750b9fb415c, stacked on #156181. Resolved current-main file moves while retaining workspace-only restrictions, requester and owner authority, revision guards, and cancellation checks. Independent source review found no introduced issue. Changed-file formatting and whitespace checks passed.

The focused cron selection passed 356 cases and failed one existing case, cron tool > clears a legacy per-job tool list using the current revision. Both its expectation and the implementation that removes toolsAllow were already present in the pre-rebase source bbb5ee2f4506bcf693fd60c941c7d29e1f770250; neither was changed to hide the failure. Wrapper stdout:

AssertionError: expected { id: 'job-8', …(2) } to have property "patch.payload" with value { kind: 'agentTurn', toolsAllow: null }

The received payload contains only kind: "agentTurn". Wrapper wall time: 63.66 seconds. No new tests, snapshot regeneration, live test, or full CI pass is claimed.

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

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: bbb5ee2f4506bcf693fd60c941c7d29e1f770250
  • Maintainer: @sjf-oa
  • Repository role: maintain

These security sensitive changes were made:

  • src/agents/scheduled-tool-policy.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

Carefully review these changes before merging.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes commands Command implementations agents Agent runtime and tooling extensions: codex size: XL labels Sep 29, 2026
@sjf-oa
sjf-oa force-pushed the sjf/cron-current-agent-tools branch from cdb40f0 to 1632b4f Compare September 29, 2026 09:10
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui scripts Repository scripts docker Docker and sandbox tooling labels Sep 29, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 29, 2026
@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

Scheduled jobs and recovered continuations use current agent tools and Codex configuration instead of saved tool restrictions, execution-host pins, and app permission snapshots.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The useful scheduling repair remains blocked by concrete authority regressions and missing scoped authority and upgrade proof.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🧂 unranked krab (1/6) Security review found an item that needs attention.

Regression provenance

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

Merge readiness

⛔ Blocked before merge - 18 items remain

Keep open. The merged automatic-snapshot repair covers part of the reported problem, but five prior findings remain unresolved in this broader change. Maintainer authorship also excludes automatic closure.

Priority: P1
Reviewed head: d69cee6bcd1632c079def7717130e354190c983c
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should existing scheduled jobs retain their authored tool, Codex account, and execution-host ceilings, or may those ceilings be retired through an explicit operator-authorized migration?
  • Recommendation: Preserve existing ceilings: Keep existing restricted jobs and continuations bounded while narrowing the current-tool repair to the remaining backend incompatibility.
  • Why: The merged default-snapshot acceptance is narrower than this PR, and changing current agent configuration does not establish consent to widen previously authorized delayed work.

Before merge

  • Add real behavior proof - Authority-chain proof required: changed scheduler dispatch and native Codex app/MCP startup lack allowed and nearest-forbidden final-effect evidence, including account reassignment and revocation before I/O. Inspected tests mock dispatch or native clients; the inspected image concerns the parent silence fix. Trusted-author exemption remains intact for unrelated proof. Published-job and persisted-continuation upgrade compatibility is independently unproven. Provide redacted terminal traces, logs, or diagnostic recordings; remove credentials and private endpoints. Updating the PR body should trigger re-review, with @clawsweeper re-review available to a maintainer if needed. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Preserve explicitly restricted legacy jobs on upgrade (P1) - Removing toolsAllow from dispatch widens every existing authored cap, including []. A job previously limited to read/message can now receive exec or other currently enabled tools without reauthorization; script execution and recovered continuations have the same change. The shipped contract and the merged automatic-snapshot repair preserve explicit restrictions. Retain those restrictions until an explicit authorized replacement.
  • Keep stored Codex jobs bound to their authorized account (P1) - The removed prewarm assertion checked a stored job's prepared profile/account or configured app-server fingerprint. Dispatch now also omits the stored authority, so changing the active Codex account or endpoint lets an existing job reach native apps under the replacement identity and current app policy. Channel owner metadata does not preserve this provider-account binding. Keep the captured identity check and permission intersection for existing jobs.
  • Retain the execution host on existing scheduled grants (P1) - The policy resolver no longer reconstructs the stored Gateway exec pin or its ask:always restriction. With current host configuration set to auto, an existing Gateway-only grant can select another available host; recovered continuations also discard their saved pin and recovery check. Preserve the captured target and reject conflicting placement until the operator explicitly reauthorizes it.
  • Replace Doctor's obsolete tool-list recovery guidance (P2) - The new validator rejects non-null toolsAllow, but Doctor still directs unresolved scheduled-authority jobs to openclaw automations edit <id> --tools <tool,...> in its index and repair-plan output. Following that recovery instruction now fails. Update the Doctor-owned guidance and recovery coverage to a supported authenticated recovery path.
  • Preserve the null sentinel when clearing a legacy tool list (P2) - The validator permits toolsAllow:null, but these unconditional deletions remove it before cron.update. The payload merger interprets omission as preservation and requires null to delete the legacy field, so the operation reports success without clearing it. Preserve null while removing obsolete capture markers; the retained legacy-clear regression already expects this behavior.
  • Resolve security concern: Explicit delayed-work tool ceilings are ignored - Saved finite and empty caps no longer reach the runtime, allowing currently enabled tools beyond the job's previously authorized scope.
  • Resolve security concern: Captured Codex account authority is no longer enforced - Removing stored-authority dispatch and the prewarm identity assertion permits existing app-authorized jobs to use a replacement prepared account or configured endpoint.
  • Resolve security concern: Saved host and approval restrictions are discarded - Existing Gateway-pinned exec grants lose their target and ask-always restriction when scheduled policy is rebuilt.
  • Resolve merge risk - No recorded maintainer decision covers intentionally retiring existing jobs' explicit tool, Codex account, and execution-host ceilings.
  • Resolve merge risk - Allowed-job and nearest-forbidden final-effect proof is missing for scheduled dispatch and native Codex app/MCP execution, including account reassignment and revocation before I/O.
  • Resolve merge risk - Published-version upgrade compatibility for persisted jobs and recovered cron continuations remains unverified.
  • Complete next step - Resolve the five retained findings, obtain the maintainer decision on existing-job authority, and provide scoped final-effect and upgrade compatibility evidence before merge.
  • Improve patch quality - Preserve existing explicit tool ceilings, Codex account bindings, and execution-host pins; fix the retained Doctor and null-clear defects.
  • Improve patch quality - Prove an allowed scheduled effect and rejection of the nearest unauthorized or reassigned account, including revocation before final I/O.
  • Improve patch quality - Verify published-version jobs and persisted continuations across upgrade alongside fresh-job behavior.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P1] Preserve explicitly restricted legacy jobs on upgrade — src/cron/isolated-agent/run-executor.ts:603-606
  • [P1] Keep stored Codex jobs bound to their authorized account — extensions/codex/src/app-server/run-attempt-runtime.ts:68-73
  • [P1] Retain the execution host on existing scheduled grants — src/agents/scheduled-tool-policy.ts:70-72
  • [high] Explicit delayed-work tool ceilings are ignored — src/cron/isolated-agent/run-executor.ts:605
  • [high] Captured Codex account authority is no longer enforced — extensions/codex/src/app-server/run-attempt-runtime.ts:68
  • [high] Saved host and approval restrictions are discarded — src/agents/scheduled-tool-policy.ts:70
Agent review details

How this fits together

OpenClaw's scheduler turns persisted automation definitions into agent runs or scripts. It passes owner identity and execution policy to the selected runtime, whose tools can perform filesystem, process, provider, and channel actions.

flowchart TD
  A[Saved automation] --> B[Scheduler admission]
  C[Current agent policy] --> B
  B --> D[Owner and requester checks]
  D --> E[Agent or script runtime]
  E --> F[Tool and provider effects]
  E --> G[Recorded result and delivery]
Loading

Technical review

Best possible solution:

Extend current-tool scheduling only where necessary while preserving existing explicit restrictions, account bindings, and host pins until an operator-authorized migration deliberately replaces them.

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

Yes, from source: an upgraded explicitly restricted job loses its dispatch cap, a stored Codex job loses its captured account check, and an agent update with toolsAllow:null drops the clear sentinel. Runtime tests were not executed in this read-only review.

Is this the best way to solve the issue?

No. Current main already repairs eligible automatic snapshots; preserving explicit saved ceilings while addressing the remaining backend incompatibility is the narrower safe approach.

Full review comments:

  • [P1] Preserve explicitly restricted legacy jobs on upgrade — src/cron/isolated-agent/run-executor.ts:603-606
    Removing toolsAllow from dispatch widens every existing authored cap, including []. A job previously limited to read/message can now receive exec or other currently enabled tools without reauthorization; script execution and recovered continuations have the same change. The shipped contract and the merged automatic-snapshot repair preserve explicit restrictions. Retain those restrictions until an explicit authorized replacement.
    Confidence: 0.99
  • [P1] Keep stored Codex jobs bound to their authorized account — extensions/codex/src/app-server/run-attempt-runtime.ts:68-73
    The removed prewarm assertion checked a stored job's prepared profile/account or configured app-server fingerprint. Dispatch now also omits the stored authority, so changing the active Codex account or endpoint lets an existing job reach native apps under the replacement identity and current app policy. Channel owner metadata does not preserve this provider-account binding. Keep the captured identity check and permission intersection for existing jobs.
    Confidence: 0.98
  • [P1] Retain the execution host on existing scheduled grants — src/agents/scheduled-tool-policy.ts:70-72
    The policy resolver no longer reconstructs the stored Gateway exec pin or its ask:always restriction. With current host configuration set to auto, an existing Gateway-only grant can select another available host; recovered continuations also discard their saved pin and recovery check. Preserve the captured target and reject conflicting placement until the operator explicitly reauthorizes it.
    Confidence: 0.98
  • [P2] Replace Doctor's obsolete tool-list recovery guidance — src/cron/normalize-payload.ts:21-25
    The new validator rejects non-null toolsAllow, but Doctor still directs unresolved scheduled-authority jobs to openclaw automations edit <id> --tools <tool,...> in its index and repair-plan output. Following that recovery instruction now fails. Update the Doctor-owned guidance and recovery coverage to a supported authenticated recovery path.
    Confidence: 0.99
  • [P2] Preserve the null sentinel when clearing a legacy tool list — src/agents/tools/cron-tool.ts:527-529
    The validator permits toolsAllow:null, but these unconditional deletions remove it before cron.update. The payload merger interprets omission as preservation and requires null to delete the legacy field, so the operation reports success without clearing it. Preserve null while removing obsolete capture markers; the retained legacy-clear regression already expects this behavior.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 4d2617d425ab.

Merge-risk options

Maintainer options:

  1. Narrow the repair (recommended)
    Preserve saved explicit ceilings and repair only the remaining current-tool backend failure, then verify fresh and upgraded jobs through the production boundary.
  2. Pause broad retirement
    Keep the broader policy change paused until maintainers approve its reauthorization contract and receive matching final-effect and upgrade evidence.

Security

Needs attention: The introduced authority removals allow existing delayed work to exceed its saved tool, provider-account, or execution-host authorization.

Evidence

Security concerns:

  • [high] Explicit delayed-work tool ceilings are ignored — src/cron/isolated-agent/run-executor.ts:605
    Saved finite and empty caps no longer reach the runtime, allowing currently enabled tools beyond the job's previously authorized scope.
    Confidence: 0.99
  • [high] Captured Codex account authority is no longer enforced — extensions/codex/src/app-server/run-attempt-runtime.ts:68
    Removing stored-authority dispatch and the prewarm identity assertion permits existing app-authorized jobs to use a replacement prepared account or configured endpoint.
    Confidence: 0.98
  • [high] Saved host and approval restrictions are discarded — src/agents/scheduled-tool-policy.ts:70
    Existing Gateway-pinned exec grants lose their target and ask-always restriction when scheduled policy is rebuilt.
    Confidence: 0.98

What I checked:

  • Pinned introduction and merge ownership: Inspected the introduced delta from 0a4f13e to d69cee6. Raw commit records confirm that the original head has the pinned base as its parent and that the test merge has the pinned base followed by the exact head; the test-merge tree equals the head tree. (d69cee6bcd16)
  • Saved execution ceilings stop reaching dispatch: The introduced run-executor changes remove toolsAllow, scheduledRuntimeAuthority, runtime-authority recovery state, and the saved exec target from scheduled dispatch. Script execution and recovered Gateway continuations similarly stop consuming saved restrictions. (src/cron/isolated-agent/run-executor.ts:605, d69cee6bcd16)
  • Existing supported restriction contract: Inspected v2026.9.8 documentation: finite and empty --tools lists restrict scheduled execution, captured Gateway exec placement remains binding, and executable reauthorization requires an authorized source. The release also contains the scheduled Codex app-authority implementation. These are shipped contracts rather than assumptions about unreleased main. Public docs: docs/automation/cron-jobs/payloads.md. (docs/automation/cron-jobs/payloads.md:56, fc23bc864e45)
  • Narrower merged repair and accepted scope: fix(cron): stale automatic tool lists block scheduled jobs from tools their owner has #162432 merged the automatic-snapshot repair. Its recorded acceptance covers default jobs losing creator-turn sender or hook limits; it explicitly preserves authored lists, scripts, condition triggers, Codex app authority, and exec pins. That acceptance does not cover this PR's removal of those retained ceilings. Git history ties the narrower repair to 08498ec; tag inspection did not establish a shipped stable release containing it. (src/cron/tools-allow.ts, 08498ec40de5)
  • Current main still retains the narrower dispatch: The fetched-main run-executor blob is 0aed48b9b31c54b050d014b83d6623db54440cdc, identical to the pinned base blob. Current main therefore has not adopted the broader dispatch removal inspected here. (src/cron/isolated-agent/run-executor.ts, 4d2617d425ab)
  • Codex account binding is removed: The original scheduled-app-authority owner rejected a changed prepared profile/account or configured app-server fingerprint before prewarm and intersected current app permissions with captured permissions. This PR deletes that owner, its startup assertion, and dispatch of the stored authority. (extensions/codex/src/app-server/run-attempt-runtime.ts:68, d69cee6bcd16)

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Existing CLI contract 1 existing option rejected: --tools Published automation-authoring and recovery commands can fail after upgrade even though the option remains registered.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: The change addresses broken scheduled workflows but also introduces consequential regressions in existing delayed-work restrictions.
  • merge-risk: 🚨 compatibility: Existing saved restrictions and the published --tools authoring contract change without verified upgrade compatibility.
  • merge-risk: 🚨 auth-provider: Stored Codex jobs cease enforcing their captured prepared-account or configured app-server binding.
  • merge-risk: 🚨 security-boundary: Explicit tool ceilings and execution-host restrictions stop bounding scheduled effects.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (7 earlier review cycles)
  • reviewed 2026-09-29T09:25:37.799Z sha 1632b4f :: needs real behavior proof before merge. :: [P1] Preserve explicitly restricted legacy jobs on upgrade | [P1] Keep stored Codex jobs bound to their authorized account | [P2] Replace Doctor's obsolete tool-list recovery instructions | [P2] Update the workspace regression for the new run arguments
  • reviewed 2026-09-30T07:13:02.559Z sha abeaddc :: needs real behavior proof before merge. :: [P1] Preserve explicitly restricted legacy jobs on upgrade | [P1] Keep stored Codex jobs bound to their authorized account | [P2] Replace Doctor's obsolete tool-list recovery guidance
  • reviewed 2026-10-01T09:38:31.064Z sha bbb5ee2 :: needs real behavior proof before merge. :: [P1] Preserve explicitly restricted legacy jobs on upgrade | [P1] Keep stored Codex jobs bound to their authorized account | [P2] Replace Doctor's obsolete tool-list recovery guidance
  • reviewed 2026-10-02T03:49:08.543Z sha 6a4a5b9 :: needs real behavior proof before merge. :: [P1] Preserve explicitly restricted legacy jobs on upgrade | [P1] Keep stored Codex jobs bound to their authorized account | [P2] Replace Doctor's obsolete tool-list recovery guidance
  • reviewed 2026-10-02T04:00:11.217Z sha 6a4a5b9 :: needs real behavior proof before merge. :: [P1] Preserve explicitly restricted legacy jobs on upgrade | [P1] Keep stored Codex jobs bound to their authorized account | [P2] Replace Doctor's obsolete tool-list recovery guidance | [P2] Preserve the null sentinel when clearing a legacy tool list
  • reviewed 2026-10-04T10:07:38.137Z sha e08f34a966372f9d490883e096fc8620b9a6f8a1 :: needs real behavior proof before merge. :: [P1] Preserve explicitly restricted legacy jobs on upgrade | [P1] Keep stored Codex jobs bound to their authorized account | [P1] Retain the execution host on existing scheduled grants | [P2] Replace Doctor's obsolete tool-list recovery guidance | [P2] Preserve the null sentinel when clearing a legacy tool list
  • reviewed 2026-10-04T10:18:35.933Z sha fe759c390aba44d367a3542986b180699cfc062d :: needs real behavior proof before merge. :: [P1] Preserve explicitly restricted legacy jobs on upgrade | [P1] Keep stored Codex jobs bound to their authorized account | [P1] Retain the execution host on existing scheduled grants | [P2] Replace Doctor's obsolete tool-list recovery guidance | [P2] Preserve the null sentinel when clearing a legacy tool list

Reviewed October 4, 2026, 6:27 AM ET / 10:27 UTC (Revision 8).

@sjf-oa
sjf-oa force-pushed the sjf/cron-current-agent-tools branch 2 times, most recently from ae6dc19 to abeaddc Compare September 30, 2026 07:06
@sjf-oa
sjf-oa force-pushed the sjf/cron-current-agent-tools branch from abeaddc to bbb5ee2 Compare October 1, 2026 09:29
@sjf-oa
sjf-oa changed the base branch from main to sjf/no-reply-explicit-silence October 1, 2026 09:30
@sjf-oa
sjf-oa force-pushed the sjf/no-reply-explicit-silence branch from 79ed2de to 4245e35 Compare October 2, 2026 03:41
@sjf-oa
sjf-oa force-pushed the sjf/cron-current-agent-tools branch 2 times, most recently from 01798e7 to 6a4a5b9 Compare October 2, 2026 03:42
@clawsweeper clawsweeper Bot added the rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. label Oct 2, 2026
@clawsweeper clawsweeper Bot removed the rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. label Oct 2, 2026
steipete added a commit that referenced this pull request Oct 4, 2026
…164514)

* perf(agents): run per-turn session-entry patches through the worker

Route audited writer claims, live-model-switch bookkeeping, and pending-final
preparation, settlement, and cleanup through the existing agent executor.
Preserve native opaque SDK callbacks and the excluded lifecycle and cron paths.

The paired isolated Gateway workload reduces native patch transactions from
8 to 2 per warmed turn and target-site SQL from 48 to 12. Overall main-thread
SQL averages 648.5 to 493.4 statements per warmed turn. Lifecycle persistence
remains follow-up work after #142236; cron preparation remains with #161105.

Local caller, settlement, error identity, import-boundary, cycle, and database
ratchet proof passes. Full build, changed checks, and released SDK diff remain
explicit merge preconditions under the maintainer's validation instruction.

* test(outbound): align recovery fixtures with queue state

Create and read producer-recovery sessions under the same explicit shared-state root as their delivery queue. Worker-backed pending-final settlement correctly rejects the previous fixture ownership mismatch. Preserve durable payloads and all existing assertions.

* test(agents): extract accounting persistence fixture

Keep the accounting persistence suite within its line cap by moving fixture construction into a dedicated test-support module. Preserve suite-owned state, immediate operation registration, and every test case and assertion.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
…penclaw#164514)

* perf(agents): run per-turn session-entry patches through the worker

Route audited writer claims, live-model-switch bookkeeping, and pending-final
preparation, settlement, and cleanup through the existing agent executor.
Preserve native opaque SDK callbacks and the excluded lifecycle and cron paths.

The paired isolated Gateway workload reduces native patch transactions from
8 to 2 per warmed turn and target-site SQL from 48 to 12. Overall main-thread
SQL averages 648.5 to 493.4 statements per warmed turn. Lifecycle persistence
remains follow-up work after openclaw#142236; cron preparation remains with openclaw#161105.

Local caller, settlement, error identity, import-boundary, cycle, and database
ratchet proof passes. Full build, changed checks, and released SDK diff remain
explicit merge preconditions under the maintainer's validation instruction.

* test(outbound): align recovery fixtures with queue state

Create and read producer-recovery sessions under the same explicit shared-state root as their delivery queue. Worker-backed pending-final settlement correctly rejects the previous fixture ownership mismatch. Preserve durable payloads and all existing assertions.

* test(agents): extract accounting persistence fixture

Keep the accounting persistence suite within its line cap by moving fixture construction into a dedicated test-support module. Preserve suite-owned state, immediate operation registration, and every test case and assertion.
steipete added a commit that referenced this pull request Oct 4, 2026
* perf(state): carry admitted schema facts with database handles

Refresh freshness at read admission and after BEGIN while reusing
handle-owned facts for runtime schema checks. Validate canonical
triggers before exposing agent readers and classify shared-state
failures only after failed admission.

Focused runtime checks execute zero SQL statements, versus 30 with
the baseline owner. Preserve foreign-commit and snapshot semantics.
Full workload measurement and remote integration checks remain merge
preconditions after remote runner and fleet-capacity admission failed.

* perf(agents): run per-turn session-entry patches through the worker

Route audited writer claims, live-model-switch bookkeeping, and pending-final
preparation, settlement, and cleanup through the existing agent executor.
Preserve native opaque SDK callbacks and the excluded lifecycle and cron paths.

The paired isolated Gateway workload reduces native patch transactions from
8 to 2 per warmed turn and target-site SQL from 48 to 12. Overall main-thread
SQL averages 648.5 to 493.4 statements per warmed turn. Lifecycle persistence
remains follow-up work after #142236; cron preparation remains with #161105.

Local caller, settlement, error identity, import-boundary, cycle, and database
ratchet proof passes. Full build, changed checks, and released SDK diff remain
explicit merge preconditions under the maintainer's validation instruction.

* test(outbound): align recovery fixtures with queue state

Create and read producer-recovery sessions under the same explicit shared-state root as their delivery queue. Worker-backed pending-final settlement correctly rejects the previous fixture ownership mismatch. Preserve durable payloads and all existing assertions.

* fix(state): preserve worker handoffs during schema admission

Use the existing worker generation claim for maintenance metadata instead of
retaining a host read handle. Keep both live ownership checks around the
required transaction-entry freshness probe.

Consolidate shared-state cache initialization, refresh, and terminal failures
in its admission sibling and update the compiled-wrapper inventory. This
keeps the cache within the existing module-size limit without changing stored
schema or quarantine semantics.

Focused maintenance, ownership, schema, worker, wrapper, and quarantine proof
passed. Independent Codex review is clean through P2. Full landing validation
remains required before merge.

* test(agents): extract accounting persistence fixture

Keep the accounting persistence suite within its line cap by moving fixture construction into a dedicated test-support module. Preserve suite-owned state, immediate operation registration, and every test case and assertion.

* fix(state): keep retained handles free of schema probes

Refresh canonical readiness when it consumes schema facts. Retention only
holds native lifetime, so cold restore and other worker handoffs no longer
execute host SQLite before dispatch.

Protect foreign schema invalidation at the warm readiness fast path. Tighten
retained-reader budgets to the optimized counts, and require early missing-table
diagnosis before callbacks while preserving handle-cleanup assertions.

Validation: 93 focused tests, production types, state/config test types, and
independent review clean through P2.

* perf(tts): carry prepared TTS preferences through dispatch

Read the machine-owned preference path through the shared-state worker once per turn and carry the result through delivery and prompt assembly. Preserve scoped path precedence, fresh preference-file reads, and synchronous SDK compatibility.

Move existing machine-state, ACP prompt, and CLI error helpers to their owning modules to keep capped orchestration files from growing. No schema, retention, durability, or configuration changes.

* fix(tts): finish prepared preference compatibility

Record and type-check the retained synchronous Plugin SDK calls while host turns carry worker-prepared preferences. Include the compatibility metadata in the PR wrapper dependency inventory.

Update TTS and cron fixtures to supply and expect prepared preference facts. Bind pending-final recovery fixtures to the queue shared-state environment, matching the worker admission ownership boundary without changing assertions.

Validation: 192 focused tests, wrapper inventory, released SDK type graph, lint, documentation links, and clean P2 review.

* test(tts): document dispatch preference mock isolation
steipete added a commit that referenced this pull request Oct 4, 2026
…ders (#164648)

* perf(state): carry admitted schema facts with database handles

Refresh freshness at read admission and after BEGIN while reusing
handle-owned facts for runtime schema checks. Validate canonical
triggers before exposing agent readers and classify shared-state
failures only after failed admission.

Focused runtime checks execute zero SQL statements, versus 30 with
the baseline owner. Preserve foreign-commit and snapshot semantics.
Full workload measurement and remote integration checks remain merge
preconditions after remote runner and fleet-capacity admission failed.

* perf(agents): run per-turn session-entry patches through the worker

Route audited writer claims, live-model-switch bookkeeping, and pending-final
preparation, settlement, and cleanup through the existing agent executor.
Preserve native opaque SDK callbacks and the excluded lifecycle and cron paths.

The paired isolated Gateway workload reduces native patch transactions from
8 to 2 per warmed turn and target-site SQL from 48 to 12. Overall main-thread
SQL averages 648.5 to 493.4 statements per warmed turn. Lifecycle persistence
remains follow-up work after #142236; cron preparation remains with #161105.

Local caller, settlement, error identity, import-boundary, cycle, and database
ratchet proof passes. Full build, changed checks, and released SDK diff remain
explicit merge preconditions under the maintainer's validation instruction.

* test(outbound): align recovery fixtures with queue state

Create and read producer-recovery sessions under the same explicit shared-state root as their delivery queue. Worker-backed pending-final settlement correctly rejects the previous fixture ownership mismatch. Preserve durable payloads and all existing assertions.

* fix(state): preserve worker handoffs during schema admission

Use the existing worker generation claim for maintenance metadata instead of
retaining a host read handle. Keep both live ownership checks around the
required transaction-entry freshness probe.

Consolidate shared-state cache initialization, refresh, and terminal failures
in its admission sibling and update the compiled-wrapper inventory. This
keeps the cache within the existing module-size limit without changing stored
schema or quarantine semantics.

Focused maintenance, ownership, schema, worker, wrapper, and quarantine proof
passed. Independent Codex review is clean through P2. Full landing validation
remains required before merge.

* test(agents): extract accounting persistence fixture

Keep the accounting persistence suite within its line cap by moving fixture construction into a dedicated test-support module. Preserve suite-owned state, immediate operation registration, and every test case and assertion.

* fix(state): keep retained handles free of schema probes

Refresh canonical readiness when it consumes schema facts. Retention only
holds native lifetime, so cold restore and other worker handoffs no longer
execute host SQLite before dispatch.

Protect foreign schema invalidation at the warm readiness fast path. Tighten
retained-reader budgets to the optimized counts, and require early missing-table
diagnosis before callbacks while preserving handle-cleanup assertions.

Validation: 93 focused tests, production types, state/config test types, and
independent review clean through P2.

* perf(exec): prepare reply skill approval defaults asynchronously

* test: document exec preparation mock isolation
@sjf-oa
sjf-oa force-pushed the sjf/no-reply-explicit-silence branch from 4245e35 to 0a4f13e Compare October 4, 2026 10:00
@sjf-oa
sjf-oa force-pushed the sjf/cron-current-agent-tools branch 2 times, most recently from e08f34a to fe759c3 Compare October 4, 2026 10:11
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Oct 4, 2026
Combine the three release fixes that retire per-job tool lists, reject newly authored lists, and remove obsolete snapshot capture. Port the behavior to current main while preserving requester identity, account policy, live mutation grants, and execution placement.
@sjf-oa
sjf-oa force-pushed the sjf/cron-current-agent-tools branch from fe759c3 to d69cee6 Compare October 4, 2026 10:21
steipete added a commit that referenced this pull request Oct 4, 2026
… the worktree reader (#164685)

* perf(state): carry admitted schema facts with database handles

Refresh freshness at read admission and after BEGIN while reusing
handle-owned facts for runtime schema checks. Validate canonical
triggers before exposing agent readers and classify shared-state
failures only after failed admission.

Focused runtime checks execute zero SQL statements, versus 30 with
the baseline owner. Preserve foreign-commit and snapshot semantics.
Full workload measurement and remote integration checks remain merge
preconditions after remote runner and fleet-capacity admission failed.

* perf(agents): run per-turn session-entry patches through the worker

Route audited writer claims, live-model-switch bookkeeping, and pending-final
preparation, settlement, and cleanup through the existing agent executor.
Preserve native opaque SDK callbacks and the excluded lifecycle and cron paths.

The paired isolated Gateway workload reduces native patch transactions from
8 to 2 per warmed turn and target-site SQL from 48 to 12. Overall main-thread
SQL averages 648.5 to 493.4 statements per warmed turn. Lifecycle persistence
remains follow-up work after #142236; cron preparation remains with #161105.

Local caller, settlement, error identity, import-boundary, cycle, and database
ratchet proof passes. Full build, changed checks, and released SDK diff remain
explicit merge preconditions under the maintainer's validation instruction.

* test(outbound): align recovery fixtures with queue state

Create and read producer-recovery sessions under the same explicit shared-state root as their delivery queue. Worker-backed pending-final settlement correctly rejects the previous fixture ownership mismatch. Preserve durable payloads and all existing assertions.

* fix(state): preserve worker handoffs during schema admission

Use the existing worker generation claim for maintenance metadata instead of
retaining a host read handle. Keep both live ownership checks around the
required transaction-entry freshness probe.

Consolidate shared-state cache initialization, refresh, and terminal failures
in its admission sibling and update the compiled-wrapper inventory. This
keeps the cache within the existing module-size limit without changing stored
schema or quarantine semantics.

Focused maintenance, ownership, schema, worker, wrapper, and quarantine proof
passed. Independent Codex review is clean through P2. Full landing validation
remains required before merge.

* test(agents): extract accounting persistence fixture

Keep the accounting persistence suite within its line cap by moving fixture construction into a dedicated test-support module. Preserve suite-owned state, immediate operation registration, and every test case and assertion.

* fix(state): keep retained handles free of schema probes

Refresh canonical readiness when it consumes schema facts. Retention only
holds native lifetime, so cold restore and other worker handoffs no longer
execute host SQLite before dispatch.

Protect foreign schema invalidation at the warm readiness fast path. Tighten
retained-reader budgets to the optimized counts, and require early missing-table
diagnosis before callbacks while preserving handle-cleanup assertions.

Validation: 93 focused tests, production types, state/config test types, and
independent review clean through P2.

* perf(agents): read worktree publication lookups in worker

Move publication preparation and per-turn tool availability through the existing worktree reader. Capture the physical store and session lifecycle before yielding, refresh availability facts, and preserve live effect guards and branch identity semantics.

* test(gateway): document publication reader mock isolation

Keep the SQL boundary fixture isolated from session storage, managed-worktree services, configuration, and credential state. Document those boundaries for the new first-party mock-export check.

No executable test code, assertions, timeouts, or production behavior changes. The mock-export check, formatter, reader tests, and scoped P2 review pass.
steipete added a commit that referenced this pull request Oct 4, 2026
…tory reader (#164747)

* perf(state): carry admitted schema facts with database handles

Refresh freshness at read admission and after BEGIN while reusing
handle-owned facts for runtime schema checks. Validate canonical
triggers before exposing agent readers and classify shared-state
failures only after failed admission.

Focused runtime checks execute zero SQL statements, versus 30 with
the baseline owner. Preserve foreign-commit and snapshot semantics.
Full workload measurement and remote integration checks remain merge
preconditions after remote runner and fleet-capacity admission failed.

* perf(agents): run per-turn session-entry patches through the worker

Route audited writer claims, live-model-switch bookkeeping, and pending-final
preparation, settlement, and cleanup through the existing agent executor.
Preserve native opaque SDK callbacks and the excluded lifecycle and cron paths.

The paired isolated Gateway workload reduces native patch transactions from
8 to 2 per warmed turn and target-site SQL from 48 to 12. Overall main-thread
SQL averages 648.5 to 493.4 statements per warmed turn. Lifecycle persistence
remains follow-up work after #142236; cron preparation remains with #161105.

Local caller, settlement, error identity, import-boundary, cycle, and database
ratchet proof passes. Full build, changed checks, and released SDK diff remain
explicit merge preconditions under the maintainer's validation instruction.

* test(outbound): align recovery fixtures with queue state

Create and read producer-recovery sessions under the same explicit shared-state root as their delivery queue. Worker-backed pending-final settlement correctly rejects the previous fixture ownership mismatch. Preserve durable payloads and all existing assertions.

* fix(state): preserve worker handoffs during schema admission

Use the existing worker generation claim for maintenance metadata instead of
retaining a host read handle. Keep both live ownership checks around the
required transaction-entry freshness probe.

Consolidate shared-state cache initialization, refresh, and terminal failures
in its admission sibling and update the compiled-wrapper inventory. This
keeps the cache within the existing module-size limit without changing stored
schema or quarantine semantics.

Focused maintenance, ownership, schema, worker, wrapper, and quarantine proof
passed. Independent Codex review is clean through P2. Full landing validation
remains required before merge.

* test(agents): extract accounting persistence fixture

Keep the accounting persistence suite within its line cap by moving fixture construction into a dedicated test-support module. Preserve suite-owned state, immediate operation registration, and every test case and assertion.

* fix(state): keep retained handles free of schema probes

Refresh canonical readiness when it consumes schema facts. Retention only
holds native lifetime, so cold restore and other worker handoffs no longer
execute host SQLite before dispatch.

Protect foreign schema invalidation at the warm readiness fast path. Tighten
retained-reader budgets to the optimized counts, and require early missing-table
diagnosis before callbacks while preserving handle-cleanup assertions.

Validation: 93 focused tests, production types, state/config test types, and
independent review clean through P2.

* perf(sessions): read transcript anchors and readiness through the history reader

* refactor(sessions): group history read request types
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
…164694)

* perf(state): carry admitted schema facts with database handles

Refresh freshness at read admission and after BEGIN while reusing
handle-owned facts for runtime schema checks. Validate canonical
triggers before exposing agent readers and classify shared-state
failures only after failed admission.

Focused runtime checks execute zero SQL statements, versus 30 with
the baseline owner. Preserve foreign-commit and snapshot semantics.
Full workload measurement and remote integration checks remain merge
preconditions after remote runner and fleet-capacity admission failed.

* perf(agents): run per-turn session-entry patches through the worker

Route audited writer claims, live-model-switch bookkeeping, and pending-final
preparation, settlement, and cleanup through the existing agent executor.
Preserve native opaque SDK callbacks and the excluded lifecycle and cron paths.

The paired isolated Gateway workload reduces native patch transactions from
8 to 2 per warmed turn and target-site SQL from 48 to 12. Overall main-thread
SQL averages 648.5 to 493.4 statements per warmed turn. Lifecycle persistence
remains follow-up work after openclaw#142236; cron preparation remains with openclaw#161105.

Local caller, settlement, error identity, import-boundary, cycle, and database
ratchet proof passes. Full build, changed checks, and released SDK diff remain
explicit merge preconditions under the maintainer's validation instruction.

* test(outbound): align recovery fixtures with queue state

Create and read producer-recovery sessions under the same explicit shared-state root as their delivery queue. Worker-backed pending-final settlement correctly rejects the previous fixture ownership mismatch. Preserve durable payloads and all existing assertions.

* fix(state): preserve worker handoffs during schema admission

Use the existing worker generation claim for maintenance metadata instead of
retaining a host read handle. Keep both live ownership checks around the
required transaction-entry freshness probe.

Consolidate shared-state cache initialization, refresh, and terminal failures
in its admission sibling and update the compiled-wrapper inventory. This
keeps the cache within the existing module-size limit without changing stored
schema or quarantine semantics.

Focused maintenance, ownership, schema, worker, wrapper, and quarantine proof
passed. Independent Codex review is clean through P2. Full landing validation
remains required before merge.

* test(agents): extract accounting persistence fixture

Keep the accounting persistence suite within its line cap by moving fixture construction into a dedicated test-support module. Preserve suite-owned state, immediate operation registration, and every test case and assertion.

* fix(state): keep retained handles free of schema probes

Refresh canonical readiness when it consumes schema facts. Retention only
holds native lifetime, so cold restore and other worker handoffs no longer
execute host SQLite before dispatch.

Protect foreign schema invalidation at the warm readiness fast path. Tighten
retained-reader budgets to the optimized counts, and require early missing-table
diagnosis before callbacks while preserving handle-cleanup assertions.

Validation: 93 focused tests, production types, state/config test types, and
independent review clean through P2.

* perf(tts): carry prepared TTS preferences through dispatch

Read the machine-owned preference path through the shared-state worker once per turn and carry the result through delivery and prompt assembly. Preserve scoped path precedence, fresh preference-file reads, and synchronous SDK compatibility.

Move existing machine-state, ACP prompt, and CLI error helpers to their owning modules to keep capped orchestration files from growing. No schema, retention, durability, or configuration changes.

* fix(tts): finish prepared preference compatibility

Record and type-check the retained synchronous Plugin SDK calls while host turns carry worker-prepared preferences. Include the compatibility metadata in the PR wrapper dependency inventory.

Update TTS and cron fixtures to supply and expect prepared preference facts. Bind pending-final recovery fixtures to the queue shared-state environment, matching the worker admission ownership boundary without changing assertions.

Validation: 192 focused tests, wrapper inventory, released SDK type graph, lint, documentation links, and clean P2 review.

* test(tts): document dispatch preference mock isolation
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
…ders (openclaw#164648)

* perf(state): carry admitted schema facts with database handles

Refresh freshness at read admission and after BEGIN while reusing
handle-owned facts for runtime schema checks. Validate canonical
triggers before exposing agent readers and classify shared-state
failures only after failed admission.

Focused runtime checks execute zero SQL statements, versus 30 with
the baseline owner. Preserve foreign-commit and snapshot semantics.
Full workload measurement and remote integration checks remain merge
preconditions after remote runner and fleet-capacity admission failed.

* perf(agents): run per-turn session-entry patches through the worker

Route audited writer claims, live-model-switch bookkeeping, and pending-final
preparation, settlement, and cleanup through the existing agent executor.
Preserve native opaque SDK callbacks and the excluded lifecycle and cron paths.

The paired isolated Gateway workload reduces native patch transactions from
8 to 2 per warmed turn and target-site SQL from 48 to 12. Overall main-thread
SQL averages 648.5 to 493.4 statements per warmed turn. Lifecycle persistence
remains follow-up work after openclaw#142236; cron preparation remains with openclaw#161105.

Local caller, settlement, error identity, import-boundary, cycle, and database
ratchet proof passes. Full build, changed checks, and released SDK diff remain
explicit merge preconditions under the maintainer's validation instruction.

* test(outbound): align recovery fixtures with queue state

Create and read producer-recovery sessions under the same explicit shared-state root as their delivery queue. Worker-backed pending-final settlement correctly rejects the previous fixture ownership mismatch. Preserve durable payloads and all existing assertions.

* fix(state): preserve worker handoffs during schema admission

Use the existing worker generation claim for maintenance metadata instead of
retaining a host read handle. Keep both live ownership checks around the
required transaction-entry freshness probe.

Consolidate shared-state cache initialization, refresh, and terminal failures
in its admission sibling and update the compiled-wrapper inventory. This
keeps the cache within the existing module-size limit without changing stored
schema or quarantine semantics.

Focused maintenance, ownership, schema, worker, wrapper, and quarantine proof
passed. Independent Codex review is clean through P2. Full landing validation
remains required before merge.

* test(agents): extract accounting persistence fixture

Keep the accounting persistence suite within its line cap by moving fixture construction into a dedicated test-support module. Preserve suite-owned state, immediate operation registration, and every test case and assertion.

* fix(state): keep retained handles free of schema probes

Refresh canonical readiness when it consumes schema facts. Retention only
holds native lifetime, so cold restore and other worker handoffs no longer
execute host SQLite before dispatch.

Protect foreign schema invalidation at the warm readiness fast path. Tighten
retained-reader budgets to the optimized counts, and require early missing-table
diagnosis before callbacks while preserving handle-cleanup assertions.

Validation: 93 focused tests, production types, state/config test types, and
independent review clean through P2.

* perf(exec): prepare reply skill approval defaults asynchronously

* test: document exec preparation mock isolation
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
… the worktree reader (openclaw#164685)

* perf(state): carry admitted schema facts with database handles

Refresh freshness at read admission and after BEGIN while reusing
handle-owned facts for runtime schema checks. Validate canonical
triggers before exposing agent readers and classify shared-state
failures only after failed admission.

Focused runtime checks execute zero SQL statements, versus 30 with
the baseline owner. Preserve foreign-commit and snapshot semantics.
Full workload measurement and remote integration checks remain merge
preconditions after remote runner and fleet-capacity admission failed.

* perf(agents): run per-turn session-entry patches through the worker

Route audited writer claims, live-model-switch bookkeeping, and pending-final
preparation, settlement, and cleanup through the existing agent executor.
Preserve native opaque SDK callbacks and the excluded lifecycle and cron paths.

The paired isolated Gateway workload reduces native patch transactions from
8 to 2 per warmed turn and target-site SQL from 48 to 12. Overall main-thread
SQL averages 648.5 to 493.4 statements per warmed turn. Lifecycle persistence
remains follow-up work after openclaw#142236; cron preparation remains with openclaw#161105.

Local caller, settlement, error identity, import-boundary, cycle, and database
ratchet proof passes. Full build, changed checks, and released SDK diff remain
explicit merge preconditions under the maintainer's validation instruction.

* test(outbound): align recovery fixtures with queue state

Create and read producer-recovery sessions under the same explicit shared-state root as their delivery queue. Worker-backed pending-final settlement correctly rejects the previous fixture ownership mismatch. Preserve durable payloads and all existing assertions.

* fix(state): preserve worker handoffs during schema admission

Use the existing worker generation claim for maintenance metadata instead of
retaining a host read handle. Keep both live ownership checks around the
required transaction-entry freshness probe.

Consolidate shared-state cache initialization, refresh, and terminal failures
in its admission sibling and update the compiled-wrapper inventory. This
keeps the cache within the existing module-size limit without changing stored
schema or quarantine semantics.

Focused maintenance, ownership, schema, worker, wrapper, and quarantine proof
passed. Independent Codex review is clean through P2. Full landing validation
remains required before merge.

* test(agents): extract accounting persistence fixture

Keep the accounting persistence suite within its line cap by moving fixture construction into a dedicated test-support module. Preserve suite-owned state, immediate operation registration, and every test case and assertion.

* fix(state): keep retained handles free of schema probes

Refresh canonical readiness when it consumes schema facts. Retention only
holds native lifetime, so cold restore and other worker handoffs no longer
execute host SQLite before dispatch.

Protect foreign schema invalidation at the warm readiness fast path. Tighten
retained-reader budgets to the optimized counts, and require early missing-table
diagnosis before callbacks while preserving handle-cleanup assertions.

Validation: 93 focused tests, production types, state/config test types, and
independent review clean through P2.

* perf(agents): read worktree publication lookups in worker

Move publication preparation and per-turn tool availability through the existing worktree reader. Capture the physical store and session lifecycle before yielding, refresh availability facts, and preserve live effect guards and branch identity semantics.

* test(gateway): document publication reader mock isolation

Keep the SQL boundary fixture isolated from session storage, managed-worktree services, configuration, and credential state. Document those boundaries for the new first-party mock-export check.

No executable test code, assertions, timeouts, or production behavior changes. The mock-export check, formatter, reader tests, and scoped P2 review pass.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
…tory reader (openclaw#164747)

* perf(state): carry admitted schema facts with database handles

Refresh freshness at read admission and after BEGIN while reusing
handle-owned facts for runtime schema checks. Validate canonical
triggers before exposing agent readers and classify shared-state
failures only after failed admission.

Focused runtime checks execute zero SQL statements, versus 30 with
the baseline owner. Preserve foreign-commit and snapshot semantics.
Full workload measurement and remote integration checks remain merge
preconditions after remote runner and fleet-capacity admission failed.

* perf(agents): run per-turn session-entry patches through the worker

Route audited writer claims, live-model-switch bookkeeping, and pending-final
preparation, settlement, and cleanup through the existing agent executor.
Preserve native opaque SDK callbacks and the excluded lifecycle and cron paths.

The paired isolated Gateway workload reduces native patch transactions from
8 to 2 per warmed turn and target-site SQL from 48 to 12. Overall main-thread
SQL averages 648.5 to 493.4 statements per warmed turn. Lifecycle persistence
remains follow-up work after openclaw#142236; cron preparation remains with openclaw#161105.

Local caller, settlement, error identity, import-boundary, cycle, and database
ratchet proof passes. Full build, changed checks, and released SDK diff remain
explicit merge preconditions under the maintainer's validation instruction.

* test(outbound): align recovery fixtures with queue state

Create and read producer-recovery sessions under the same explicit shared-state root as their delivery queue. Worker-backed pending-final settlement correctly rejects the previous fixture ownership mismatch. Preserve durable payloads and all existing assertions.

* fix(state): preserve worker handoffs during schema admission

Use the existing worker generation claim for maintenance metadata instead of
retaining a host read handle. Keep both live ownership checks around the
required transaction-entry freshness probe.

Consolidate shared-state cache initialization, refresh, and terminal failures
in its admission sibling and update the compiled-wrapper inventory. This
keeps the cache within the existing module-size limit without changing stored
schema or quarantine semantics.

Focused maintenance, ownership, schema, worker, wrapper, and quarantine proof
passed. Independent Codex review is clean through P2. Full landing validation
remains required before merge.

* test(agents): extract accounting persistence fixture

Keep the accounting persistence suite within its line cap by moving fixture construction into a dedicated test-support module. Preserve suite-owned state, immediate operation registration, and every test case and assertion.

* fix(state): keep retained handles free of schema probes

Refresh canonical readiness when it consumes schema facts. Retention only
holds native lifetime, so cold restore and other worker handoffs no longer
execute host SQLite before dispatch.

Protect foreign schema invalidation at the warm readiness fast path. Tighten
retained-reader budgets to the optimized counts, and require early missing-table
diagnosis before callbacks while preserving handle-cleanup assertions.

Validation: 93 focused tests, production types, state/config test types, and
independent review clean through P2.

* perf(sessions): read transcript anchors and readiness through the history reader

* refactor(sessions): group history read request types

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui cli CLI command changes commands Command implementations docker Docker and sandbox tooling docs Improvements or additions to documentation extensions: codex gateway Gateway runtime merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts security-sensitive-changed size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants