Skip to content

refactor: simplify session bookkeeping and transcript workers - #169458

Merged
steipete merged 2 commits into
mainfrom
deslop/w02-sessions-rest-20261011
Oct 12, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/w02-sessions-rest-20261011

Conversation

@steipete

@steipete steipete commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The requested second sessions cleanup removes speculative bookkeeping and parallel implementations that survived the first pass.

User Impact

No session feature, public API, config key, stored shape, retention rule, or durability policy changes. Ordinary transcript writes, authorization, restart recovery, and accepted-work settlement retain their owners. Advisory bookkeeping accepts the explicitly listed rare races instead of carrying separate protocols for them.

Why This Change Was Made

Baseline capture now has one in-flight operation and one guarded persistence instead of a separate reservation write. Private reconcile requests trust their typed producer instead of mirroring its schema. Notice sweeping retains cursor reconciliation and delivery authority without retaining every watcher's read custody. Archive staging/encoding and transcript-statistics projection each have a shared implementation; statistics retain a cheap indexed point shape for small requests.

Net production reduction: 491 lines (+341/-832), excluding tests, fixtures, support, inventories and generated files. The maintainer explicitly waived the floor for this completed honest pass. The coverage log below records both removals and retained candidates.

Best-effort tradeoffs accepted

  • A new operator session no longer writes a second baseline-capture reservation before reading Git. Existing creator/reset claims still work, first workspace work awaits capture/persistence, and final persistence checks the session ID. The extra reservation and missing-row legacy reread came from synthetic claim/interleaving tests in fix: new sessions open promptly in Git workspaces #124796, not a human incident. A process interruption before capture persistence leaves no newly started workspace work to lose; the next attempt captures again.
  • If one of two read-only Git inventory commands rejects, optional baseline capture may finish failing while its sibling completes naturally. improve: reduce idle time during session baseline capture #151548 explicitly introduced synthetic sibling-join tests, not a reported user failure. Both commands still start together; no write or child process is killed or replayed.
  • A failed combined raw/numstat Git inventory is not retried as separate name-status and numstat commands. improve: reduce Git work when loading session diffs #150018's fallback was exercised by a synthetic command failure; ordinary rename, binary, path and count handling remains. A failed request reports an error instead of repeating the same failing Git operation or silently appearing clean.
  • A replaced upstream link may leave an advisory missing-count entry until the next scan. refactor(scheduler): scope upstream session polling #162518 added the preflight around a synthetic provider-scan replacement. The retained linkUpdatedAt comparison resets counts for a changed link; event insertion and settlement still match the exact expected upstream.
  • A watcher changed during notice-sweep discovery may receive a stale notice or miss that sweep. perf(gateway): move post-ready notice sweeping off the main thread #165331 describes a synthetic startup/interleaving workload. The worker still rereads cursor bindings/watermarks, and delivery still enforces current target/store authority; an ordinary turn or later sweep reconciles.
  • Partial SDK consumption between notice coalescing and adoption no longer starts a shrinking-subset retry protocol. refactor: run immediate notifications through ordinary session execution #167113 describes the synthetic partial-consumption negative control. Unconsumed original occurrences remain queued for an ordinary turn or sweep; whole-batch cancellation still does not restart work.
  • A warning logger throwing while reporting prune failure is no longer swallowed by a second catch. The guard in refactor(sessions): record creation, compaction and spawn signals through workers #164367 protected an abnormal diagnostic sink, not a human-reported runtime failure. Normal pruning failure still warns; a broken logger may propagate its error.
  • Malformed private reconcile payloads/continue/release messages no longer receive a duplicate handwritten schema check. They originate from the typed pool on its private port (fix: curb Gateway memory growth after large fleets start #150354 and later extensions), not an external trust boundary. Port validation, source authority, bounded work and lease/write settlement remain; malformed internal messages fail in the owning operation.

Evidence

The corrected head is 1a1c2176d91727847c645126ee1633b8da583180. It restores sparse SQL output after the first hosted run caught a row-transfer budget regression, and removes only the obsolete partial-consumption retry and foreign-DDL-between-chunks test cases. All 19 cold-read cases (including the unchanged sparse row budget), all 20 retained notice/permission cases, and all 3 lint-suppression cases pass. Fresh correction review is clean through P2; core and affected test types, lint and both cycle checks pass. The PR was reopened under the maintainer's explicit floor waiver. Exact-head CI completed with only the inherited creation-snapshot and Board permission failures; sequential clean-main-versus-candidate proof and every failed job are recorded in the evidence comment. The requested pinned inherited-failure exception landed squash 8444ad628bdaef99beabc2eb7042d41437431486; fresh origin/main ancestry verification passed. This is a verified merge, not a green-CI claim.

Core production types and the core/root test type graphs passed. The isolated runtime build passed. Changed checks passed formatting, SQLite/ownership/line-count/assertion/mock ratchets, dependency and plugin boundaries, and wrapper shadowing. The native production and full-tree unused-export scans passed sequentially after parallel scans timed out. Full-core lint exceeded its existing 900-second tool limit; changed-file lint passed separately. Runtime import cycles and Madge cycles are both zero. Limits were not changed.

The broad scope attempt recorded 653 passing cases. Its two failures were the removed legacy reread expectation (corrected; baseline suite then passed 10/10) and the untouched large-shared-branch fixture exceeding its existing 15-second timeout. The corrected Gateway groups passed all 78 cases, including 46/46 diff tests. Archive and worker-lane focused tests passed. A separate worker group hit the existing 30-second fleet/backoff deadlines, then cascaded through a deleted timed-out fixture. In fresh processes, temporary timing markers showed the fleet case still seeding agent 5 of 8 at its 30.15s deadline, before reaching its queue assertion; the backoff case spent 18.65s seeding, paused at 24.64s, and completed its seven passes at 31.49s after the 30.01s deadline. Those timing markers were removed and the lifecycle test is unchanged. This narrows the failures to insufficient wall-clock headroom on the loaded host, not a passing replay or proof that every assertion ran. No timeout, retry or skip changed.

The native statistics API probe passes cold-only/raw-orphan/missing/duplicate IDs, NUL/USV binding and >400-ID chunking on the final SQL projection. This is correctness evidence, not a production performance claim. The point-query fast path remains. Remaining full-scope tests were not all executed locally; a Testbox allocation never obtained a runner and was stopped at the 20-minute queue limit. No remote execution is claimed. Hosted CI must attach to the exact published head.

Single-worker cost evidence: baseline file 92.61s / wrapper 214.07s; final metadata file 91.60s, final user-turn file 144.75s, combined wrapper 377.33s; Gateway diff file 207.56s. These are loaded-host measurements, not budgets or measured CI seconds. The added metadata batch case took 2.562s on the final projection. Exact hosted CI seconds are pending publication.

Review found a real simplification bug before publication: an already-existing caller could bypass an active first-turn baseline capture. The extended concurrency test failed with an absent baseline, then the owner was corrected to join before the early return. Settlement also preserves an authoritative terminal unavailable marker. The Git-error regression initially left its injected failure installed and broke 28 later cases; its mock now restores in finally. No product retry, timeout increase, skip, or weaker assertion was used to repair either issue.

Fresh independent review of the final substantive candidate is clean through P2. The user-turn suite passes 27/27 on the final media projection.

Final media-specific tests pass 11/11 and test/scripts/lint-suppressions.test.ts passes. Final core types, changed-file lint, formatting and git diff --check also pass after the message-wait helper cleanup.

Coverage log

The lane inspected current origin/main rules, fourteen-day additions/net growth, and the previous p16/p17 ledgers. Positive-growth config/session files remained with w01; all src/sessions files were eligible.

Cluster Decision
Baseline capture / read-only Git inventory Collapse reservation and forwarding layers; remove synthetic failed-command retry/join paths.
Upstream monitor Remove duplicate current-link RPC; keep link-version counters, post-provider idle/session check and final event/settlement predicates.
Notice sweep / coalescing / prune logging Remove per-watcher retained read custody and partial-cancellation retry; keep delivery authority, ambient-disclosure invalidation, cursor rereads and retention.
History runtime / reconcile worker Clone typed RPC facts together, consolidate target/inventory dispatch, remove private schema mirrors. Keep worker bounds, FIFO opportunities and accepted host-write/lease settlement.
Archive materialization One snapshot/staging/encoding path for ordinary and history-eviction plans; keep exact snapshot/ref/recency/integrity checks and byte bounds.
Transcript stats One parameterized prepared projection for indexed points and bounded joined batches; keep cold-only, raw-only, missing/duplicate ID, byte and mutation-clock semantics.
Model overrides / user-turn persistence Reuse existing field helpers and direct persistence export; remove global-symbol test bridge and repeated forwarding boilerplate. Keep public defaults, auth-profile semantics, redaction and exact prompt bytes.
Lifecycle/work admission Keep ordinary parallel-session locks, accepted-write settlement, Stop/reset/delete and security-effect authority.
Provider review / communication / background results Keep human-continuation capabilities, approvals, durable output idempotency and media settlement.
Row changes / participant recording Keep committed-fact authorization invalidation and persistence before human contributor-credit snapshots.
Exact accessors / model context / suffix mutation Keep source/permission predicates, coherent snapshots, exact mutation bytes and idempotency ownership.
Projection rebuild / resource retirement Keep bounded memory/workers, real write settlement and complete projections across ordinary appends/resets.
Disk budget / prompt blobs / import staging Keep durable index-before-artifact deletion, real migration data, bounded disk spooling and existing retention.
Combined stores / snapshot merge Keep logical/physical federation, sentinel behavior, measured reuse and current-row security/model/recovery conflict handling.

Consolidate archive and transcript statistics paths, share typed worker message handling, and remove speculative advisory retries and duplicate capture bookkeeping. Preserve first-write ordering, authorization, transcript durability, and accepted-write settlement.
@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XL labels Oct 11, 2026
@steipete
steipete marked this pull request as ready for review October 11, 2026 23:58
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR consolidates transcript statistics and archive workers while simplifying baseline capture, notice reconciliation, and upstream bookkeeping.

Example: A session has an edited tracked.txt file, but the combined Git inventory command fails.

  • Before: OpenClaw retries separate filename and statistics commands and may return a partial diff.
  • After: OpenClaw reports the inventory failure without retrying those commands.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The corrected patch is coherent and the earlier findings are resolved; current validation is strongest at the production-owner harness boundary, and CI failure attribution remains unsettled.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; reported native statistics and integration validation support the refactor, while the inspected screenshots belong to historical baseline-capture proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Duplicate session bookkeeping and worker implementations increase maintenance complexity.
Reason: The maintainer-authored direction is established, and the patch reduces production code while preserving the central persistence and delivery owners.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: it is a maintainer-directed simplification, the three prior findings are resolved, and no new blocking code defect was found; current-head CI failures still need attribution.

Priority: P3
Reviewed head: 1a1c2176d91727847c645126ee1633b8da583180

Before merge

  • Complete next step - Establish whether the Board directory-mode failure and both creation-snapshot failures also occur on the pinned base; repair any diff-caused failure, or document verified inherited failures for the native landing workflow.

Findings

None.

Agent review details

How this fits together

Gateway session requests and background maintenance enter session owners, which delegate SQLite and Git work to workers and return transcript statistics, archives, baselines, and queued notices.

flowchart TD
  A[Gateway requests and maintenance] --> B[Session owners]
  B --> C[Transcript workers]
  C --> D[Canonical SQLite stores]
  B --> E[Git read workers]
  E --> F[Session diff baseline]
  B --> G[Notice queue and delivery owner]
Loading

Technical review

Best possible solution:

Retain the consolidated owners and accepted bookkeeping tradeoffs, then land through the normal workflow after the current CI failures are attributed.

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

This is a refactor rather than a bug report; source inspection verifies the changed paths, and no target code or tests were executed during this review.

Is this the best way to solve the issue?

The consolidation follows the existing owners and the maintainer's explicit tradeoffs; restoring the retired advisory protocols would contradict that recorded direction.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Baseline capture changes intended behavior with a stated reason (91d3f53: Keep first workspace writes behind baseline settlement while allowing prompt session creation.)
  • Tracked Git inventory fallback changes intended behavior with a stated reason (3916ace: Combine tracked inventories while retaining filename-only recovery when statistics collection fails.)
  • Baseline inventory sibling settlement changes intended behavior with a stated reason (a4091c2: Start independent inventories together and join both command lifetimes on failure.)
  • Watcher discovery custody changes intended behavior with a stated reason (cebf83f: Move sweeping to workers while checking watcher identity and cursor facts.)
  • Partial-notice retry changes intended behavior with a stated reason (753a7a5: Preserve surviving original notices after partial consumption before adoption.)
  • Upstream current-link preflight changes intended behavior with a stated reason (ff51e00: Bind advisory missing counters to the scanned upstream link.)
  • Private reconcile message validation changes intended behavior with a stated reason (7d71d7c: Move bounded transcript projection work to workers with an explicit message protocol.)
  • Transcript statistics keeps the original intent (95763a1: Reduce repeated statistics work while preserving sparse reads, partial stores, and cheap indexed points.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 95763a1 adds src/config/sessions/session-accessor.sqlite-transcript-stats.ts:13 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 95763a1fb5f8; files: src/config/sessions/session-accessor.sqlite-transcript-stats.ts)

PR surface

Source -491, Tests -137, Other -1. Total -629 across 33 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 22 333 824 -491
Tests 9 51 188 -137
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 1 2 -1
Total 33 385 1014 -629

Review metrics

Metric Value Why it matters
Production versus tests Production +333/-824; tests +49/-164 The pinned diff removes 491 net production lines by consolidating existing owners; support, inventories, and generated files are excluded.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P3: This is an intentional internal simplification without an established urgent user-facing regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-12T00:07:16.146Z sha 754a403 :: needs changes before merge. :: [P2] Update the statistics budget for the dense result projection | [P2] Retarget the table-loss injection to the joined statistics query | [P2] Migrate the cancellation test away from immediate retry

Reviewed October 11, 2026, 9:01 PM ET / October 12, 2026, 01:01 UTC (Revision 2).

Keep SQL results sparse and reconstruct missing and duplicate inputs by ordinal. Remove only synthetic foreign-DDL and partial-notice-retry test paths retired by the sessions cleanup; retain ordinary cancellation, permissions, snapshot and row-budget coverage.
@steipete steipete closed this Oct 12, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Closing under the campaign's BELOW-500 rule; this PR is not merged.

The required sparse-statistics correction reduces the production cut from 501 to 491 lines (+341/-832). The corrected work is pushed as 1a1c2176d91727847c645126ee1633b8da583180 on deslop/w02-sessions-rest-20261011 for the coordinator; no filler was added to cross the publication threshold. This corrected head has local proof below, not a claim of hosted green CI.

Exact original head 754a403a19fdf6f01376f6b2ce9a4553a3b24a06, CI run https://github.com/openclaw/openclaw/actions/runs/38186259944:

  • checks-node-changed-compact-small-1: obsolete partial-consumption retry test timed out, followed by fixture-cleanup failures. Remove only that retired retry case; retain ordinary FIFO, permissions, full-batch/request cancellation and acknowledgment coverage.
  • checks-node-changed-compact-small-9: valid sparse row-budget regression (824 rows vs <=4), plus a synthetic foreign table-drop-between-chunks test. Restore sparse SQL output and reconstruct requested positions; retain initial missing-table behavior. The foreign-DDL interleaving is outside the supported single-Gateway database owner and was only synthetic coverage (fix: speed up session lists and transcript diagnostics #148918, refactored in test(sessions,config,outbound): remove low-value tests (batch d132) #162725).
  • checks-node-changed-compact-small-7: two creation-snapshot corruption cases and Board directory-mode repair (01700 vs 0700) fail in untouched owners. Matching main failures were not verified; these are not claimed as proven main-red.
  • openclaw/ci-gate: aggregate of those three failed shards. No other failing, cancelled or timed-out check run was present in the exact-head census.

The corrective diff has fresh clean independent P2 review, passing core and affected test types, changed-file lint, zero runtime/Madge cycles, and passing statistics API correctness/Unicode/chunking proof. All 19 cold-read cases (including the unchanged sparse-row budget), all 20 retained notice/permission cases, and all 3 lint-suppression cases pass. The combined isolated command took 924.21s on the loaded host. No hosted jobs were rerun or dispatched to seek green.

@steipete steipete reopened this Oct 12, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Oct 12, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Exact-head CI attribution and inherited-failure landing

Candidate: 1a1c2176d91727847c645126ee1633b8da583180 (491 net production lines removed). The maintainer explicitly waived the floor and requested the inherited-failure exception. CI run: https://github.com/openclaw/openclaw/actions/runs/38189250128. No CI rerun, dispatch, or green-seeking push was performed.

Every failed CI job is accounted for:

Job Failure Attribution
checks-node-changed-compact-small-15 (114618491103) session-accessor.creation-snapshot.test.ts: mismatched-time and nul cases expect a corruption rejection but receive { ok: false, error: "unreachable", phase: "entry" }. Both failures reproduced sequentially on clean current-main snapshot 9359fe2f39a88dc6670a8283f88547ff044cfaff; both pass on the exact candidate. The test and creation/validation owners are unmodified by this PR.
checks-node-changed-compact-small-10 (114618491151) sqlite-board-store.worker.test.ts: executes Board mutations off the host and publishes each committed change once observes directory mode 01700 instead of 0700. Same failure reproduced on that clean main snapshot; the case passes on the exact candidate. Board and database-permission/transaction owners are unmodified by this PR.
openclaw/ci-gate (114619666093) Selected CI lanes failed. Aggregate of the two jobs above, not another product failure.

Main and candidate comparisons ran on the same machine, in that order, with independent isolated HOME, OPENCLAW_HOME, OPENCLAW_STATE_DIR, OPENCLAW_CONFIG_PATH, TMPDIR and XDG directories. The clean main checkout used its own frozen-lockfile install. Both failed test files are byte-identical between main and candidate. No test, assertion, timeout, retry or skip was changed for this comparison.

Commands on each checkout, sequentially:

node scripts/run-vitest.mjs src/boards/sqlite-board-store.worker.test.ts -t 'executes Board mutations' --maxWorkers=1
node scripts/run-vitest.mjs src/config/sessions/session-accessor.creation-snapshot.test.ts -t 'preserves native warm listing' --maxWorkers=1

Main: Board 1 failed (149.80s wrapper); creation 2 failed (105.99s). Candidate: Board 1 passed (254.93s); creation 2 passed (128.45s). Filtered-out cases were not claimed as coverage.

No selected CI test job was cancelled or timed out. Two older metadata-automation jobs (label and PR context and evidence) were cancelled during same-head event supersession; the newer context/evidence check succeeds and the newer label job is intentionally skipped. These are not missing test-suite executions. Security-fast and independent security/dependency review checks pass. The security review's aggregate CI status remains red solely because of the inherited jobs above.

The earlier PR-caused sparse-statistics and obsolete partial-consumption expectations were corrected in this head. The unchanged sparse-row budget and all retained notice/FIFO/permission cases pass locally and no longer fail in hosted CI. Proceeding with the requested exact-head inherited-failure squash exception, not claiming green CI.

@steipete
steipete merged commit 8444ad6 into main Oct 12, 2026
145 of 151 checks passed
@steipete
steipete deleted the deslop/w02-sessions-rest-20261011 branch October 12, 2026 01:18
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
…aw#169458)

* refactor: simplify session bookkeeping and transcript workers

Consolidate archive and transcript statistics paths, share typed worker message handling, and remove speculative advisory retries and duplicate capture bookkeeping. Preserve first-write ordering, authorization, transcript durability, and accepted-write settlement.

* fix(sessions): preserve sparse transcript statistics

Keep SQL results sparse and reconstruct missing and duplicate inputs by ordinal. Remove only synthetic foreign-DDL and partial-notice-retry test paths retired by the sessions cleanup; retain ordinary cancellation, permissions, snapshot and row-budget coverage.
steipete added a commit that referenced this pull request Oct 12, 2026
Repair the sessions-rewind failure from hourlies 38216343022
(c2fe11f, checks-node-compact-large-4) and 38220958692
(5a1f8c6, checks-node-compact-large-3,
agentic-gateway-methods-hosted-5).

Culprit: af0c38c (#169579), whose stated intent is:
"Raw event appends use the existing event operation, including entry-less
events and active-branch parent selection."
The fixture's event appends now stay in workers instead of warming the
host's shared-state reader. A cold fork therefore executes the existing
transaction-admission and candidate-commit upstream SELECTs separately.
These are authority reads, not duplicate cuts, history, or session rows.

Assert both exact keyed SELECTs and exactly the source and returned fork
keys after fork plus rewind. Keep the rewind one-read assertion and all
editor/media/provenance/sandbox checks. No production behavior changes.

Attribution: the culprit parent passes (92.77s); the culprit fails with the
original 2-versus-1 assertion (98.02s). Both parents and merged commits for
#169458 and #169513 pass. Baseline full file: 24 pass, 1 fail (90.61s).
Reverting only this fix reproduces that same failure (86.66s).

Proof: 10 full-file runs, 25/25 each: 100.71s, 82.57s, 110.16s, 72.92s, 55.99s, 58.74s, 93.46s, 55.29s, 58.21s, 57.20s.
Owning gateway-methods config shard 98/128: 3 files, 53/53 (189.90s).
Targeted gateway-methods tsgo passed (72.48s wrapper, 13.8s graph);
type-aware oxlint (33.02s), boundary-guards (1.35s), oxfmt (0.33s),
git diff --check and fresh independent P2 review passed.

check-changed (422.73s) passed its selected guards/types but failed the
production unused-export scan on renderPublicSessionCardSvg. The same
scan fails identically on clean origin/main 044f8ea (150.38s);
full-tree and script scans pass on both. No baseline or suppression changes.

Peer recheck: no landed fix. Open #169566 removes these SQL counters in a
broader cutover; this focused main repair preserves their exact contract.
DasX added a commit to DasX/openclaw that referenced this pull request Oct 12, 2026
Integrate origin/main f13b3cd (533 commits after d220cac).

Four production files conflicted:
- attempt-auth-selection.ts: take main's async credential store
  (ensureAuthProfileStoreAsync, openclaw#169111) and keep this branch's import for
  the CLI auth-forwarding helper.
- attempt-execution.ts: runAgentAttempt becomes async as on main (openclaw#169111,
  openclaw#169449) and keeps its RunAgentAttemptParams type; main's inline parameter
  type is otherwise unchanged since the previous merge.
- sessions-patch.ts: keep the fallback policy patch step ahead of main's
  narrower explicit-thinkingLevel validation (openclaw#169435).
- model-overrides.ts: keep the session fallback policy block and take main's
  bookkeeping simplification and comment removal (openclaw#169458).

docs/.generated/config-baseline.{counts.json,sha256} were regenerated with
pnpm config:docs:gen instead of merged by hand: core 2507 -> 2511, the four
added entries are this branch's fallbackPriority paths.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
Repair the sessions-rewind failure from hourlies 38216343022
(9000810, checks-node-compact-large-4) and 38220958692
(8da3099, checks-node-compact-large-3,
agentic-gateway-methods-hosted-5).

Culprit: ae4267e (openclaw#169579), whose stated intent is:
"Raw event appends use the existing event operation, including entry-less
events and active-branch parent selection."
The fixture's event appends now stay in workers instead of warming the
host's shared-state reader. A cold fork therefore executes the existing
transaction-admission and candidate-commit upstream SELECTs separately.
These are authority reads, not duplicate cuts, history, or session rows.

Assert both exact keyed SELECTs and exactly the source and returned fork
keys after fork plus rewind. Keep the rewind one-read assertion and all
editor/media/provenance/sandbox checks. No production behavior changes.

Attribution: the culprit parent passes (92.77s); the culprit fails with the
original 2-versus-1 assertion (98.02s). Both parents and merged commits for
openclaw#169458 and openclaw#169513 pass. Baseline full file: 24 pass, 1 fail (90.61s).
Reverting only this fix reproduces that same failure (86.66s).

Proof: 10 full-file runs, 25/25 each: 100.71s, 82.57s, 110.16s, 72.92s, 55.99s, 58.74s, 93.46s, 55.29s, 58.21s, 57.20s.
Owning gateway-methods config shard 98/128: 3 files, 53/53 (189.90s).
Targeted gateway-methods tsgo passed (72.48s wrapper, 13.8s graph);
type-aware oxlint (33.02s), boundary-guards (1.35s), oxfmt (0.33s),
git diff --check and fresh independent P2 review passed.

check-changed (422.73s) passed its selected guards/types but failed the
production unused-export scan on renderPublicSessionCardSvg. The same
scan fails identically on clean origin/main 85f4c3f (150.38s);
full-tree and script scans pass on both. No baseline or suppression changes.

Peer recheck: no landed fix. Open openclaw#169566 removes these SQL counters in a
broader cutover; this focused main repair preserves their exact contract.
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 20, 2026
First-parent upstream 84a834e..2b9aa2e (112 commits, including
openclaw#169327 actor memory storage for incognito consumers, openclaw#169458 session
bookkeeping/transcript workers, openclaw#169449 gateway read paths, openclaw#169364 cron
worker queue, openclaw#168401 remote compaction V2, openclaw#169467 transcript backlog).

Conflicts:
- session-reset-service.ts: upstream moved ensureSessionRuntimeCleanup into
  session-reset-runtime-cleanup.ts. Took upstream's form and ported our
  delta into the new module: the `reason` parameter and the awaited
  clearSessionScopeRuntimeState (continuation cancellation that cannot
  persist returns UNAVAILABLE). Callers keep passing `reason`.
- attempt-execution.ts: upstream made the Claude CLI fallback prelude async;
  ported the await into our extracted resolveClaudeCliFallbackPrelude.
- session-accessor.sqlite-lifecycle.ts: upstream's two actor-storage
  imports; the eviction kick import stays where the fork moved its caller.
- status-message.ts: upstream threads preparedTtsPreferences into the voice
  line; ported into our status-session-lines.ts helper.
- plugin-sdk-surface-report.mts budgets; worker inventory regenerated.

Also: session-actor-memory-collaboration-contract.ts (new upstream file)
excludes the fork's sharing `authority.capture` op from actor memory
commands (it runs only on the sharing writer's owner), as at step 26.

Refs #1475

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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