Skip to content

refactor(agents): simplify completed-run bookkeeping - #174838

Merged
steipete merged 2 commits into
mainfrom
deslop/z24-3-bookkeeping-20261015
Oct 17, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/z24-3-bookkeeping-20261015

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Agent bookkeeping grew extra ownership protocols around already-owned work: repeated recovery repairs, detached cancellation custody, retry-cache publication fences, completed-result freshness rescans, and mutable-generation bookkeeping. The introducing changes described forced interleavings rather than human-reported failures for these particular guards.

User Impact

No new feature or configuration is introduced. Rare recovery, callback, and streaming interleavings use the best-effort behavior listed below; security, durable accepted work, FIFO, and ordinary shutdown settlement remain protected.

What changed

Use one awaited idempotent recovery repair and one bounded failed-registration cancellation. Let the existing Gateway own actual child execution and shutdown. Keep the measured recovery cache and bounded retries, but remove observer invalidation/facts-vector admission around that cache. Completed Stop and CLI results no longer become failures solely because their old resolver or executable changed afterward.

Use a plain unique-entry sandbox registration stack, captured auth-state identity, typed private history projection, and existing canonical membership/selected draft facts. MCP turn completion drains admitted work without a speculative late-arrival quiet window. Remove repeated observer/result copies under the existing by-reference contract and historical reconstruction of already-delivered streaming source rewrites.

Security/approval effect revalidation, credential ownership, external parsing, durable accepted input/transcripts/retry ceilings, ordinary awaited shutdown settlement, and FIFO remain. Phase E standalone memory backend, factory, registry/expiry/federation machinery, and tests are untouched. No config, schema, protocol, dependency, or public SDK change.

Best-effort tradeoffs accepted

Evidence

Current repaired production diff against pinned base facbe21: +158/-646, 488 net lines removed across29 production files;48 total changed paths. Test/support/generated/declaration files excluded from this production measure. No production z04 exclusion overlap; the assertion baseline receives only the explicitly authorized shrink-only ratchet update. Necessary native-prefix handling was restored after CI rather than padding the cut to the normal size floor.

The initial whole-change review and fresh six-file repair review both completed scoped-clean at P0–P2 (repair confidence0.93, final source verification completed). Original46-path type-aware lint and suppression audit3/3 passed; final five-path repair type-aware lint and the fresh suppression audit3/3 also pass (188.99s Vitest;259.04s wrapper). Formatting and whitespace pass. The production diff adds no module import specifier. Check-changed dry-run classified the initial46 paths; broad graph checks remain hosted-CI proof under the campaign host budget.

CI38982486674 on561cad88 failed on five attributable jobs: assertion-baseline shrink; obsolete reservation cleanup retry expectations; obsolete admitted-restoration retries; streaming native-prefix handling; and an added actual-write missing-store expectation beyond the original no-op owner contract. This repair shrinks only the ratchet, replaces retry-only proof with one-shot warning/durable-state and successful refund/no-dispatch coverage, restores native-prefix/shortened-fence behavior and its original test, and retains the original read-only missing-store regression. These are our failures, not inherited-red claims. The body-context failure has successful same-head replacement38983087434.

The repair's four-suite isolated replay spent1053.364s compiling workers, then another ten minutes in Vitest without a case result. Its owned runtime was interrupted and joined; wrapper exited130 after1817.52s and retained completed compiler outputs. That is neither passing proof nor an assertion failure. Earlier full runtime-cycle scanning likewise produced no graph result under shared host load; no production import edge is added. No timeout, retry, skip or suppression was added. Exact-head hosted CI is the broad behavior/type/cycle gate. All runtime/test commands use isolated HOME/OpenClaw/XDG state, maxWorkers1, and serial execution.

Admin exception: inherited CI failure

Repaired-head CI38989171245 has one non-aggregate failed job: checks-node-changed-compact-small-20-1 (117267817193), with two unchanged Gateway accepted-facts tests reporting Drain bypassed the pending ACP read at line429. Both identical cases and assertion fail on completed scheduled main38988964265, head2354224e994429dbb63cd5c09fc96e245aec1488, job117267060121. The failing test is byte-identical between PR and that main head. This is direct scheduled-main evidence, not an import-graph or local-timeout inference. The CI gate117269579233 is its downstream aggregate. No PR-caused failure remains on this head.

All143 exact-head check runs were enumerated:85success,54skipped,1neutral,2failures above, and one superseded metadata cancellation. PR-context cancellation117267450406 has successful same-head replacement117267548035; no behavior suite is missing. Security-fast117267816370 and current dependency/security statuses pass. No CI rerun or green-only push was made.

Two native review-init attempts failed before any merge intent: state-lease heartbeat startup timeout60005ms, then managed-worktree provisioning EPIPE. The first released its operation lock and all known children exited; the second reports operation-complete and leaves no managed PR worktree or merge outcome. Campaign rule10 authorizes the exact-head guarded REST squash route after the evidence comment. Failed CI remains accurately labeled inherited, not green.

Review disposition: the after-tool observation isolation suggestion is declined under the campaign's explicit best-effort tradeoff above. The hook reference requires explicit modifications rather than relying on in-place mutation; after-tool return values remain ignored. No authorization/approval effect check is removed, and no human incident is cited for an observer mutating completed data. Public hook/event shapes are unchanged.

@clawsweeper

clawsweeper Bot commented Oct 16, 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.

@steipete
steipete marked this pull request as ready for review October 16, 2026 23:38
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T01:06:12.825668Z 979e9ef New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: XL labels Oct 16, 2026
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 979e9ef50e73b458c60727e18953777e161e90d1
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/auth-profiles/usage-lifecycle.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/embedded-agent-runner/run/auth-controller.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/mcp-oauth-provider.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/sandbox/backend.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

Carefully review these changes before merging.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 561cad88fa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/harness/hook-helpers.ts Resolved
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 17, 2026
@clawsweeper

clawsweeper Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR removes redundant agent bookkeeping and adopts documented best-effort behavior for exceptional recovery, cancellation, and streaming cases.

Example: A CLI executable changes after successful inference completes.

  • Before: Finalization can discard the completed answer because the executable fingerprint changed.
  • After: The completed answer remains successful while launch and execution authority retain their existing checks.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The direction is justified, but the missing-store regression and confirmed failing tests prevent a correctness pass.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; supplied evidence consists of static checks and CI harness results rather than a shipped runtime demonstration.
Patch quality 🦪 silver shellfish (2/6) 5 actionable review findings remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Completed agent work can become a failure because redundant bookkeeping rechecks or cleanup protocols outlive the work they describe.
Reason: The maintainer explicitly approves the simplification and exceptional best-effort outcomes; no additional configuration or public capability is introduced.

Regression provenance

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

Merge readiness

⛔ Needs changes before merge - 6 items remain

Keep open: this maintainer-approved simplification has useful scope, but a compaction regression and several diff-caused CI failures need repair before merge.

Priority: P2
Reviewed head: 561cad88fada7c971ea7acd5bef3317ecc1ee1b9

Before merge

  • Reject a missing predecessor store before opening a writer (P2) - For a successful compaction returning a different sessionId, predecessor validation now skips the read-only lookup and enters patchSessionEntryCore directly. If the predecessor database was removed, that path initializes an empty SQLite store before rejecting the missing writer claim. The new missing-store test confirms this: fs.access resolves at line 439. Preserve rejection without creating storage, either through an existing-only writer operation or the read-only admission check.
  • Update retained recovery tests for single-attempt repair (P2) - The shared repair now makes one attempt, but agent-command-recovery-owner.test.ts still expects three immediate calls and a deferred fourth. main-session-restart-recovery.test.ts also awaits scheduled.promise from the removed reservation rollback timer. Exact-head CI reports the call-count failure and timeout. Rewrite those retained cases to assert the accepted single-attempt failure and durable retained facts rather than waiting for removed retries.
  • Align vanished-scope assertions with accepted snapshot replay (P2) - After delivering First and Second, the retained vanished-scope test withdraws the second block with ['First', '']. The new reset appends the remaining full snapshot and emits First again, exactly as CI reports, while the test still expects only the original two outputs and three total callbacks. Update that case's expected replay and subsequent callback count to the explicitly accepted behavior.
  • Resolve the newly failing fence-continuation test (P2) - The replacement fixture now ends the unchanged open-fence checkpoint before continuing with qrstuvwxyz and a closing fence. Exact-head CI fails its chunk.endsWith('\n```') assertion at line 193. This newly introduced test is therefore failing coverage, regardless of whether the same runtime case already failed on the base. Repair the fixture or its owning fence handling so this scenario passes before replacing the previous regression case.
  • Shrink the retired session-history assertion allowance (P2) - The renderer changes remove the two HistoryMessage casts, reducing this file's unannotated assertions from three to one, but its baseline remains three. runPerFileCountRatchet rejects stale decreased allowances, which explains a diff-caused part of the failing assertion-safety check. Reduce this entry to one without adding suppressions or changing unrelated baseline entries.
  • Complete next step - Classify the remaining max-lines failures in checks-fast-baseline-ratchets using matching base evidence; their annotated paths are outside this PR's introduced diff, so unrelated repairs must not be assigned to this author without attribution.

Findings

  • [P2] Reject a missing predecessor store before opening a writer — src/agents/embedded-agent-runner/compaction-successor.ts:216-224
  • [P2] Update retained recovery tests for single-attempt repair — src/agents/main-session-recovery/main-session-recovery-lifecycle.ts:23-26
  • [P2] Align vanished-scope assertions with accepted snapshot replay — src/agents/embedded-agent-subscribe.handlers.messages.snapshot.ts:245-248

Tests

  • Missing end-to-end proof: No shipped-entry-point run or passing base-versus-head comparison is supplied for the failing cases; this maintainer PR is outside the ordinary contributor proof gate.
Agent review details

How this fits together

Agent runners consume admitted turns and credentials, execute tools or inference, and publish transcripts, completion results, recovery state, and child cleanup outcomes.

flowchart TD
A[Admitted turn] --> B[Agent runner]
B --> C[Inference and tools]
C --> D[Completion settlement]
D --> E[Session storage]
D --> F[Replies and observers]
B --> G[Recovery and child cleanup]
Loading

Technical review

Best possible solution:

Preserve the accepted simplifications while preventing missing-store creation and completing the affected test and baseline updates.

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

The missing-store path is traceable through the production writer and confirmed by exact-head CI; the remaining listed failures have matching test inputs and annotations.

Is this the best way to solve the issue?

The simplification follows the repository's ownership guidance and recorded maintainer direction, provided validation does not initialize absent storage and tests follow the accepted contracts.

Full review comments:

  • [P2] Reject a missing predecessor store before opening a writer — src/agents/embedded-agent-runner/compaction-successor.ts:216-224
    For a successful compaction returning a different sessionId, predecessor validation now skips the read-only lookup and enters patchSessionEntryCore directly. If the predecessor database was removed, that path initializes an empty SQLite store before rejecting the missing writer claim. The new missing-store test confirms this: fs.access resolves at line 439. Preserve rejection without creating storage, either through an existing-only writer operation or the read-only admission check.
    Confidence: 0.99
  • [P2] Update retained recovery tests for single-attempt repair — src/agents/main-session-recovery/main-session-recovery-lifecycle.ts:23-26
    The shared repair now makes one attempt, but agent-command-recovery-owner.test.ts still expects three immediate calls and a deferred fourth. main-session-restart-recovery.test.ts also awaits scheduled.promise from the removed reservation rollback timer. Exact-head CI reports the call-count failure and timeout. Rewrite those retained cases to assert the accepted single-attempt failure and durable retained facts rather than waiting for removed retries.
    Confidence: 0.99
  • [P2] Align vanished-scope assertions with accepted snapshot replay — src/agents/embedded-agent-subscribe.handlers.messages.snapshot.ts:245-248
    After delivering First and Second, the retained vanished-scope test withdraws the second block with ['First', '']. The new reset appends the remaining full snapshot and emits First again, exactly as CI reports, while the test still expects only the original two outputs and three total callbacks. Update that case's expected replay and subsequent callback count to the explicitly accepted behavior.
    Confidence: 0.99
  • [P2] Resolve the newly failing fence-continuation test — src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.text-end-reconciliation.test.ts:184-187
    The replacement fixture now ends the unchanged open-fence checkpoint before continuing with qrstuvwxyz and a closing fence. Exact-head CI fails its chunk.endsWith('\n```') assertion at line 193. This newly introduced test is therefore failing coverage, regardless of whether the same runtime case already failed on the base. Repair the fixture or its owning fence handling so this scenario passes before replacing the previous regression case.
    Confidence: 0.96
  • [P2] Shrink the retired session-history assertion allowance — config/assertion-safety-baseline.txt:1159
    The renderer changes remove the two HistoryMessage casts, reducing this file's unannotated assertions from three to one, but its baseline remains three. runPerFileCountRatchet rejects stale decreased allowances, which explains a diff-caused part of the failing assertion-safety check. Reduce this entry to one without adding suppressions or changing unrelated baseline entries.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 1313c3871a21.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -515, Tests -290. Total -805 across 46 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 29 161 676 -515
Tests 17 201 491 -290
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 46 362 1167 -805

Review metrics

Metric Value Why it matters
Production versus test/support LOC Production +161/-676; tests/support +201/-491 The production reduction supports the simplification goal, but removed mechanisms still require coherent retained coverage.

Labels

Label changes:

  • add P2: This is a normal-priority internal refactor with a bounded compaction defect and concrete validation repairs.
  • add merge-risk: 🚨 message-delivery: Full-snapshot reconciliation may replay delivered text, an explicitly accepted maintainer tradeoff that retained tests must accurately represent.
  • add merge-risk: 🚨 session-state: Successor validation can recreate a deleted session database before rejecting the stale predecessor.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This is a normal-priority internal refactor with a bounded compaction defect and concrete validation repairs.
  • merge-risk: 🚨 session-state: Successor validation can recreate a deleted session database before rejecting the stale predecessor.
  • merge-risk: 🚨 message-delivery: Full-snapshot reconciliation may replay delivered text, an explicitly accepted maintainer tradeoff that retained tests must accurately represent.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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.

Reviewed October 16, 2026, 8:04 PM ET / October 17, 2026, 00:04 UTC.

@steipete

Copy link
Copy Markdown
Contributor Author

Landing exception for exact reviewed head 979e9ef50e73b458c60727e18953777e161e90d1 (signed; Peter Steinberger author/committer).

Independent initial and repaired-head reviews completed scoped-clean at P0–P2; repair confidence0.93. Narrow lint/format and suppression audit3/3 pass. Production delta against pinned basefacbe21ddf986047e97c39a5a0de2471f16c5bed is +158/-646:488net lines removed. Security/approval effect boundaries, durable accepted work, FIFO and ordinary shutdown settlement remain. Phase E memory is untouched.

All143 exact-head check runs were individually enumerated.85success,54skipped,1neutral,2failures,1superseded metadata cancellation. The only failing behavior job is inherited:

Exact-head job Classification Evidence
checks-node-changed-compact-small-20-1 /117267817193 Inherited PR run38989171245: two session-row-projection.accepted-facts.test.ts cases (does not accept facts after an awaited projection retirement; does not accept facts after an awaited ACP read failure) fail Drain bypassed the pending ACP read at429. Scheduled main38988964265 /117267060121, head2354224e994429dbb63cd5c09fc96e245aec1488, has both identical failures; full cached log personally inspected. Failing test blob is byte-identical PR↔main.
openclaw/ci-gate /117269579233 Downstream aggregate Summarizes the inherited job above, not an independent product failure.
PR context and evidence /117267450406 Superseded metadata cancellation Successful same-head replacement117267548035/run38989202725; no behavior suite missing.

Security-fast117267816370 passes. Current dependency/security statuses are SUCCESS; required CI status is FAILURE solely for the attributed job. No CI rerun, speculative retry or green-only push was made. The latest six completed scheduled-main runs and current flake registry were inspected; the newest schedule supplies direct matching-signature evidence.

Two native workflow attempts failed before merge intent: review-init first lost its managed-worktree allocation lease when heartbeat startup exceeded60005ms; lock/process cleanup confirmed. The second failed provisioning with EPIPE and reports operation-complete. No managed PR worktree or retained merge outcome exists. Under coordinator-authorized campaign rule10, use direct squash merge pinned to this exact SHA after posting this evidence. This bypasses broken tooling, not security/review gates. CI is not claimed green.

Review comment4300279793's observer-isolation suggestion is declined as an explicitly accepted best-effort case: a plugin violating the observation contract may mutate completed args/results before projection. The hook reference requires explicit modifications rather than relying on in-place mutation; ignored return values and hook shapes stay unchanged. Approval/before-tool isolation and live effect authority remain. No human incident is cited for this particular defensive copy.

@steipete
steipete merged commit f6f54db into main Oct 17, 2026
151 of 155 checks passed
@steipete
steipete deleted the deslop/z24-3-bookkeeping-20261015 branch October 17, 2026 01:53
steipete added a commit that referenced this pull request Oct 17, 2026
Main hourly 38995631641 exposed two stale assertions. The deliberate
f6f54db (#174838) tradeoff no longer reconstructs historical chunk
boundaries after an authoritative native item rewrite. Assert the complete
corrected body exactly while retaining once-only early-prefix checks;
ordinary append, directive, voice and source-occurrence cases stay intact.

c0e26d5 (#174964) intentionally balances unfinished fences during a
forced flush. Expect the synthetic closer at early and terminal delivery,
with the literal MEDIA line preserved as code and no media attachment.
No production behavior changes.

Both original failures reproduced on main 789c8c0. Focused proof:
31 tests pass with --maxWorkers=1; owning agents-root test types,
targeted type-aware lint, formatting, and independent P2 review pass.
No CI dispatch, rerun, skip, retry, or timeout change.
steipete added a commit that referenced this pull request Oct 17, 2026
PR #174838 removed broad session-change invalidation, but retained run
contexts have no admission-release promise. Command cleanup can release
its admission before awaited cleanup clears the run context, leaving a
recovery attempt without its next wake.

Observe only runtime/agent-run changes for retained owners, and schedule
the existing one-second wake once their current ownership ends. Preserve
admission-release wakes, bounded deferred retries and effect authority.
Unsubscribe on reset and account for release during the recovery read.
Extend the existing ownership table with staggered admission/run release.

Main reproduces the retained-run failure; #174838's parent passes both
original cases. Fixed recovery and sweeper files pass 127 tests with
maxWorkers=1 (61.05s and 76.55s wrappers). Targeted types, lint, formatting,
docs MDX and isolated P2 review pass. No CI dispatch or rerun.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
* refactor(agents): simplify completed-run bookkeeping

* refactor(agents): retain native snapshot prefixes and align recovery proof
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
Main hourly 38995631641 exposed two stale assertions. The deliberate
a7855f2 (openclaw#174838) tradeoff no longer reconstructs historical chunk
boundaries after an authoritative native item rewrite. Assert the complete
corrected body exactly while retaining once-only early-prefix checks;
ordinary append, directive, voice and source-occurrence cases stay intact.

367e8a0 (openclaw#174964) intentionally balances unfinished fences during a
forced flush. Expect the synthetic closer at early and terminal delivery,
with the literal MEDIA line preserved as code and no media attachment.
No production behavior changes.

Both original failures reproduced on main 26e1077. Focused proof:
31 tests pass with --maxWorkers=1; owning agents-root test types,
targeted type-aware lint, formatting, and independent P2 review pass.
No CI dispatch, rerun, skip, retry, or timeout change.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…175044)

PR openclaw#174838 removed broad session-change invalidation, but retained run
contexts have no admission-release promise. Command cleanup can release
its admission before awaited cleanup clears the run context, leaving a
recovery attempt without its next wake.

Observe only runtime/agent-run changes for retained owners, and schedule
the existing one-second wake once their current ownership ends. Preserve
admission-release wakes, bounded deferred retries and effect authority.
Unsubscribe on reset and account for release during the recovery read.
Extend the existing ownership table with staggered admission/run release.

Main reproduces the retained-run failure; openclaw#174838's parent passes both
original cases. Fixed recovery and sweeper files pass 127 tests with
maxWorkers=1 (61.05s and 76.55s wrappers). Targeted types, lint, formatting,
docs MDX and isolated P2 review pass. No CI dispatch or rerun.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. security-sensitive-changed size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant