Skip to content

perf(agents): reduce repeated SQLite work during agent preparation - #168992

Merged
steipete merged 11 commits into
mainfrom
dbasync/t1agents
Oct 11, 2026
Merged

steipete merged 11 commits into
mainfrom
dbasync/t1agents

Conversation

@steipete

@steipete steipete commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Agent preparation repeats SQLite reads and retains main-thread SQL even when its worker or committed owner facts already hold the answer. This reduces that work without changing persisted data or the public API.

Design and impact

Context-engine outbox SQL now runs exclusively in the existing execution worker, or in the incognito actor. The synchronous fallback is deleted. Recovery returns its pending result directly and publication does not reread state already supplied by the owner. Auth workers read credential and runtime-state cells with one statement. Relay renew/delete/prune use guarded mutations. Sandbox effect guards consume facts installed by worker reads and committed write receipts. Model preparation reuses its admitted session entry; cancellation preparation reuses the session-generation owner; worktree cleanup reuses its existing lease census.

Credential dispatch, tool/command launch, and destructive cleanup retain their real effect-boundary authority checks. No schema, migration, retention, update, Doctor, plugin-loading, service-lifecycle, or SDK surface change.

Main-thread SQLite

Agents T1 inventory: 33 → 12. Sixteen call sites are removed or moved into their worker owner; five retained removal/exit lock call sites are correctly classified as permitted lock primitives, not represented as eliminated SQL.

The twelve remaining T1 sites use the requested escape hatch:

Owner Sites Retained contract / next step
Auth cell readers/writers and transaction owner 6 Released synchronous ensureAuthProfileStore, upsertAuthProfile, and AuthStorage paths must return credentials or finish atomic persistence synchronously. Async bundled paths use workers. Retire these adapters when those SDK contracts migrate.
Plugin model catalog 2 Released synchronous ModelRegistry construction/refresh consumes the catalog immediately. Prepared Gateway runtime already uses the worker-read catalog.
Agent lifecycle 1 Atomic deletion commit couples durable journal/lease authority with destructive cleanup; changing it requires redesigning that owner.
Subagent registry 3 Maintenance protection and descendant-deletion snapshots prevent deleting live child transcripts; changing their synchronous final guard requires the session/registry owner cutover.

Removed checks and accepted edges

  • Outbox recovery and publication rereads: overlapping recovery may redeliver the same idempotent logical turn; the existing engine contract owns deduplication.
  • Auth store/state separate reads: one statement now supplies one snapshot; no stale-read edge is accepted, and malformed legacy cells retain their diagnostics.
  • Relay renewal reread: a delayed renewal from the same PID/token may replace that owner's newer endpoint/expiry. A different owner still fails the mutation predicate.
  • Relay deletion reread: an accepted cleanup may delete that same owner's later renewal; a successor PID/token is protected.
  • Relay prune reread: the mutation compares the captured record and skips a changed candidate until the next sweep.
  • Model setup reread/retry: bookkeeping publication during preparation may require a visible retry at final credential dispatch; dispatch still reads current ownership.
  • Cancellation execution recapture, writer warmup, target reread, and readiness loop: preparation retains the existing generation owner; the actual cancellation effect checks authority.
  • Sandbox host SQL and repeated table checks: reads and write receipts maintain the facts; unknown settlement clears them and refuses the effect until a new owner read.
  • Worktree lease reread: cleanup uses its complete lease snapshot; a later lease may remain unseen until the next pass, while the removal claim checks live leases before deletion.

Measurement

Exact base 7943ae59280f6ffd4bae07e4a877a361e79e654b; candidate 1e94f14a611019ccced1c9e72535e6cbba4d2ef8. Three alternating base/candidate pairs on one isolated AWS host, with the shared harness and unchanged assertions. Values are median [min–max]; warmed rows are per turn. Both native main/worker calibrations must report 8 calls, 2 prepares, 7 SQL statements, and zero failures.

Phase n base/candidate All-thread statements base → candidate Requests base → candidate MAIN statements base → candidate Duration ratio
Boot 3/3 2079 [2079–2080] → 2079 [2079–2079] 58 [58–58] → 58 [58–58] 1900 [1900–1900] → 1900 [1900–1900] 0.92
Connect 3/3 938 [938–939] → 938 [938–938] 43 [43–44] → 43 [43–43] 72 [72–73] → 72 [72–72] 1.00
First turn 3/3 1290 [1287–1317] → 1284 [1283–1285] 200 [199–204] → 200 [199–201] 43 [43–50] → 43 [43–43] 0.98
Warmed turn 3/3 406.2 [403.1–406.5] → 403.5 [403.1–404.1] 92.7 [92.7–93.2] → 93.3 [92.6–93.5] 4.1 [3.3–4.1] → 4.1 [4.1–4.1] 1.00
Second session / child 2/3 1676.5 [1671–1682] → 1669 [1667–1670] 361 [359–363] → 360 [359–362] 65 [62–68] → 68 [68–69] 1.00
Control 2/3 13 [13–13] → 13 [13–14] 3 [3–3] → 3 [3–3] 0 [0–0] → 0 [0–0] 1.00
Cron 2/3 581 [579–583] → 575 [574–575] 122.5 [122–123] → 122 [122–122] 14 [14–14] → 14 [14–14] 1.00
Compaction 2/3 195.5 [194–197] → 193 [192–194] 31 [31–31] → 31 [31–31] 9.5 [9–10] → 9 [9–10] 1.00
Shutdown 2/3 97 [97–97] → 97 [97–97] 14 [14–14] → 14 [14–14] 57.5 [56–59] → 59 [56–59] 0.99
Entire workload 2/3 10931 [10928–10934] → 10880 [10880–10890] 1764 [1762–1766] → 1763 [1760–1765] 2202 [2201–2203] → 2206 [2205–2206] 0.91
Exercised operation Statements per warmed turn Requests per warmed turn
auth-profile-rows 6 → 3 3 → 3

The same auth read falls 10 → 5 statements on the first turn, at 5 unchanged requests. Outbox/relay/sandbox/cleanup behavior is covered by owner regressions; no workload saving is claimed for unexercised paths.

The warmed raw statement median falls 2.7 (0.66%); the first turn falls 6. Warmed requests rise 0.6 (0.65%), while the available entire-workload request median falls 1764 → 1763. Operation attribution shows that the warmed request difference comes from existing session-owner timing, not an added auth request: per-pair total request deltas are +0.3, +0.6, −0.1. These are existing session entry reads, actor completion/delivery, shared facts, corpus inventory, exact-entry, and tombstone operations. Auth stays exactly 3 requests in every warmed observation; separate operation medians are not additive.

All six first/warmed observations and twelve native calibration streams passed. No fourth pair was run; the full-workload comparison has the sampling limitation below. Later phases have two complete baseline workloads and three candidate workloads: M3 was interrupted after all warmed turns by the inherited settlement failure. Those later statistics are reported as n=2/3, not as three complete pairs. No full third baseline workload is claimed.

Final validation/landing head is ca20afdebb1536d44bd16a476d7a0f893e3f5f5c, integrated with main parent 30469f450063ebd23e6a731fcc95019a785d28ed. The final main integration conflicted only in generated inventory; it contains no lane runtime-code resolution. SQL measurements are retained at the exact revisions above under the campaign's proof-reuse rule. Integration combined main's model-preparation simplification with this lane's admitted-entry reuse; the final credential-dispatch read remains. Other integration conflicts were generated inventory. Subsequent changes align test-export ownership, remove an unused export, shrink the assertion baseline, format the resolved test, and prevent an empty sandbox reservation receipt from discarding the returned row. None adds SQL or worker requests.

Validation and landing

Focused coverage: all 48 selected test files completed, including changed tests and consumers mocking changed exports. The first selected run took 880.48 s and exposed two obsolete initial-read race expectations; those were deleted, and the ownership suite passed. The remaining 27 files plus the changed relay test passed in 722.56 s (node scripts/run-vitest.mjs ... --maxWorkers=2). After the final model-setup integration, node scripts/run-vitest.mjs src/agents/embedded-agent-runner/run/model-setup.ownership.test.ts --maxWorkers=1 passed 31 tests, 115.18 s Vitest / 149.74 s command wall time. CI execution seconds are not separately profiled.

The remote lease expired during the initial focused run. Completed SQL artifacts were recovered, the lease and slot were released, and focused/static proof continued locally through campaign proof slots. The incomplete remote test run is not counted as a pass.

The integrated 36-step check:changed plan was executed through a continuation runner so inherited failures did not hide later checks. Core and all test type graphs, type-aware core/script lint, mock-export checks, import cycles, and both database ratchets passed. Madge passed in 152.74 s; final export-collision validation passed in 41.96 s. Final formatting and assertion-ratchet reruns passed after fixing a stale allowance and one blank line.

Two static exceptions reproduce on untouched source at main 6e06137f85ef3262f47dae63626d97f14c2f1ca1: the max-lines suppression in src/web-search/runtime.test.ts, and Knip findings for isCodeModeExecToolKind, readVoiceSessionFacts, renderSettingsSecretInput, and loadSubagentMaintenanceCandidatesInDatabase. Both full-tree and production Knip scans were run on main and candidate. All four reported source files and the Knip configuration are unchanged between the verified main revision and the final main parent. The old outbox test-only export declaration was moved to the new kernel filename, and the unused sandbox row-reader export was removed; no lane-specific Knip finding remains.

Final-head CI exposed a real sandbox cache defect: a no-op reservation receipt advanced the cache revision despite carrying no changed rows, discarding the returned reservation after database reopen. The existing two reopen cases reproduced locally. Empty receipts now leave row facts unchanged; no additional query or request is introduced. All four sandbox verification files passed afterward (35 tests, 89.60 s command wall time), followed by scoped type-aware lint, core types, formatting, and both database ratchets. Other completed proof was reused.

Two Codex autoreview rounds completed with no actionable P0/P1 findings. The implementation was reviewed in the first round; the second round covered the lock-classification correction. Retained lock callers and the final conflict resolution were inspected separately. No third review round.

An earlier CI head found lint annotations and three stale FIFO-test observations; those were fixed in the final push. The queue tests now observe actual worker submission and verify the callback cannot enter or mutate durable state while blocked, then verify the committed result. No production retry or weakened assertion was added. Two further tests that intercepted the removed initial preparation read were deleted as requested; current-writer, cancellation, replacement, and final-dispatch tests remain.

One candidate attempt and two attempts of the third baseline measurement returned agent.wait: error despite a successful visible reply, executionSettled: true, and no session error. The same visible-reply/error-status signature is present on main in run 38122045725, sqlite-sessions-transcripts-flip-proof.built-cli.e2e.test.ts. The failed attempts were preserved and excluded from complete-workload statistics. The candidate replacement passed unchanged; the third baseline failed again, so its valid first/warmed windows are included and its incomplete downstream phases are excluded. This PR does not claim to fix that inherited intermittent settlement failure.

Native review initialization stalled for over 20 minutes without completing. Its owned process was stopped and stale lock recovered. Landing uses the explicitly authorized head-pinned REST squash fallback under relaxed landing v4; static gates remain mandatory. Final-head CI and security status are recorded below rather than inferred from older runs.

At head 0aedb5671c69b2ab1a755784e210ae42fa73cd07, all security checks passed. Aggregate CI failed on the two sandbox-reopen cases now fixed and on the inherited built-CLI agent.wait failure described above (run 38132298826). The final four-line sandbox fix is pushed as d518acde1fceda54ae482727d65b165067b94b89; focused proof and static checks passed. Relaxed landing v4 permits the head-pinned admin/REST route without waiting for another full CI cycle. The inherited Knip findings are recorded explicitly, not represented as passing checks. The final main integration includes the upstream max-lines repair; the final inventory, worker/dialect ratchets, max-lines ratchet, assertion ratchet, and generated-file formatting checks all pass. Prior runtime tests, type-aware lint, type graphs, export-collision, Madge, and Knip evidence are reused for the unchanged lane code.

LOC against the final main parent: production +746 / −784 (net −38), tests +314 / −150, docs/config/tools +188 / −128. Most production churn is moving the outbox implementation into its worker kernel. No changelog edit: release-note context is in this PR.

… facts

Reuse admitted model and cancellation facts, batch auth reads, keep outbox SQL worker-only, and replace relay read-then-write checks with guarded mutations. Sandbox effects consume committed registry facts. Retain released synchronous SDK and destructive cleanup contracts.
@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 docs Improvements or additions to documentation scripts Repository scripts agents Agent runtime and tooling size: XL labels Oct 11, 2026
@github-actions

github-actions Bot commented Oct 11, 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: ca20afdebb1536d44bd16a476d7a0f893e3f5f5c
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/auth-profiles/sqlite-json.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/sandbox/registry-currentness.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/sandbox/registry.kernel.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/agents/sandbox/registry.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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 Oct 11, 2026
@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR batches auth reads, moves outbox SQL into its worker, and reuses prepared session, sandbox, and worktree facts.

Example: Agent preparation reads both persisted auth rows.

  • Before: Credential and runtime-state cells require two statements.
  • After: Both cells are read in one statement.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) Useful direction, but the reservation regression is confirmed and the changed authority boundary lacks successful final-effect evidence; no schema or serialized-format migration is introduced.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦪 silver shellfish (2/6) Security review found an item that needs attention.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Agent preparation performs redundant database work and retains avoidable host-thread SQL.
Reason: The maintainer-authored direction has clear value and uses existing owners; the recorded replay and renewal tradeoffs do not require another product decision.

Merge readiness

⛔ Blocked before merge - 6 items remain

Keep this PR open for its useful performance work, but block merge on the remaining reservation regression. Exact-head CI confirms the previously reported hydration defect; the relay test-ratchet finding is fixed.

Priority: P2
Reviewed head: 0aedb5671c69b2ab1a755784e210ae42fa73cd07

Before merge

  • Add real behavior proof - Authority-chain proof required: Exercise the changed sandbox facts owner through final command launch or workspace I/O with a valid persisted generation after restart, then removed or reassigned generations, supported native mutations, and unknown settlement. The complete body and discussion provide a relay unit-test result and pending validation, without this after-fix trace. Supply redacted logs, live output, or a recording, removing IPs, API keys, phone numbers, and non-public endpoints. 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 hydration on empty reservation settlement receipts (P1) - This previous finding remains unresolved. After restart or database reopen, reserving an existing pending or ready runtime can return its row without writing anything. The worker publishes an empty successful settlement receipt, but this subscriber still increments facts.revision. The installer captured before reserveSandboxRegistryEntry then skips the returned row because the revision changed, leaving no cached generation. createSandboxBackend rejects the valid reservation as removed before calling its provider. Exact-head CI confirms both retained-ID reopen cases fail through this path. Do not advance the revision for empty successful receipts, or publish the returned authoritative reservation fact while preserving replacement and unknown-settlement invalidation.
  • Resolve security concern: Establish complete final-effect invalidation coverage - The new guard consumes process-local facts instead of reading the authoritative row. Typed mutation publications are present, but the prior boundary explicitly retained native reads for incomplete receipt coverage. Establish rejection of a removed or reassigned generation before provider launch or workspace I/O, including supported native mutations and unknown settlement.
  • Resolve merge risk - Before merge, establish that supported native and worker registry mutations invalidate removed or reassigned sandbox authority before command launch or workspace I/O; the replaced guard explicitly retained a native read for incomplete receipt coverage.
  • Complete next step - Resolve GitHub's reported merge conflict and investigate the built-CLI lifecycle failure, fixing any patch-caused defect or establishing its external cause.
  • Improve patch quality - Prove valid-generation execution and rejection of removed or reassigned generations before final I/O, including supported native mutations and unknown settlement.

Findings

  • [P1] Preserve hydration on empty reservation settlement receipts — src/agents/sandbox/registry-currentness.ts:38-39
  • [high] Establish complete final-effect invalidation coverage — src/agents/sandbox/registry-currentness.ts:79

Tests

  • Missing end-to-end proof: Show successful sandbox reuse after restart and rejection of removed or reassigned generations before final command launch or workspace I/O through the changed owner.
Agent review details

How this fits together

Agent preparation consumes admitted session and database state, uses SQLite workers for persistence, and supplies model ownership and sandbox authority to execution.

flowchart TD
  A[Agent preparation] --> B[Admitted session facts]
  A --> C[SQLite worker operations]
  C --> D[Agent and shared databases]
  D --> E[Committed registry facts]
  B --> F[Model and sandbox effects]
  E --> F
Loading

Technical review

Best possible solution:

Keep the worker cutover while allowing unchanged persisted reservations to hydrate without weakening replacement or unknown-settlement rejection.

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

Current-main source shows repeated preparation reads, and exact-head CI independently confirms the introduced reservation hydration failure; no target code was run during this review.

Is this the best way to solve the issue?

The existing workers and publication owners are appropriate places for these reductions, but the facts guard must preserve cold reservation hydration and current authority at final effects.

Full review comments:

  • [P1] Preserve hydration on empty reservation settlement receipts — src/agents/sandbox/registry-currentness.ts:38-39
    This previous finding remains unresolved. After restart or database reopen, reserving an existing pending or ready runtime can return its row without writing anything. The worker publishes an empty successful settlement receipt, but this subscriber still increments facts.revision. The installer captured before reserveSandboxRegistryEntry then skips the returned row because the revision changed, leaving no cached generation. createSandboxBackend rejects the valid reservation as removed before calling its provider. Exact-head CI confirms both retained-ID reopen cases fail through this path. Do not advance the revision for empty successful receipts, or publish the returned authoritative reservation fact while preserving replacement and unknown-settlement invalidation.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Merge-risk options

Maintainer options:

  1. Complete the receipt guard cutover (recommended)
    Repair empty-receipt hydration and demonstrate that valid persisted generations work while removed or reassigned generations cannot reach final effects.
  2. Retain the existing final guard
    Keep the native final registry read temporarily and land the independent auth, relay, outbox, and preparation reductions.

Provenance checked

  • Sandbox effect guards changes intended behavior with a stated reason (83ce140: Final native generation reads protected retained sandbox callbacks while receipt coverage remained incomplete; fix(storage): publish sandbox, worktree, and GitHub authority receipts #168025 subsequently added typed publications without retiring those guards.)
  • Outbox worker placement and recovery keeps the original intent (fix(agents): replies stall when a chat is marked read as a turn starts #158209: Worker execution avoided a host-thread SQLite busy wait that stalled replies; this PR retains that owner and the existing idempotent logical-turn contract.)
  • Relay ownership mutations changes intended behavior with a stated reason (refactor(hooks): run bridge storage off the calling thread #149397: Publication and renewal validated the live registration, while pruning compared complete snapshots; guarded SQL retains ownership checks and the body accepts same-owner timestamp supersession.)
  • Auth-row reader keeps the original intent (d3d2d2e: Runtime auth rows used admitted read ownership and cache invalidation; batching preserves independent cell classification and existing malformed-legacy handling.)
  • Native model preparation changes intended behavior with a stated reason (00daeeb: Preparation and dispatch were bound to current session ownership; the admitted entry replaces the initial reread while dispatch still refreshes ownership.)
  • Subagent cancellation preparation keeps the original intent (fix(swarm): reduce cancellation stalls during session writes #163485: Cancellation reused ready session generations to avoid unrelated writer stalls; this PR retains the session-generation owner and removes an additional preparation writer.)
  • Worktree lease census keeps the original intent (06cbb34: Cleanup read leases without the state write lock; the complete worker census now supplies the lookup while destructive removal keeps its authoritative lock checks.)

Testing

Proof path: in-process harness.

Security

Needs attention: The sandbox authority cutover needs final-effect validation; inspection found no concrete authorization bypass or supply-chain regression.

Evidence

Security concerns:

  • [high] Establish complete final-effect invalidation coverage — src/agents/sandbox/registry-currentness.ts:79
    The new guard consumes process-local facts instead of reading the authoritative row. Typed mutation publications are present, but the prior boundary explicitly retained native reads for incomplete receipt coverage. Establish rejection of a removed or reassigned generation before provider launch or workspace I/O, including supported native mutations and unknown settlement.
    Confidence: 0.93

What I checked:

  • Pinned introduction: Reviewed the introduced changes from 6e06137 to 0aedb56; current main still retains the native sandbox generation read and the older outbox preparation path. (src/agents/sandbox/registry.ts:182, 0aedb5671c69)
  • Confirmed reservation failure: The exact-head CI annotations show both database-reopen reservation cases failing at runtime-reservation.test.ts:430 through registry-currentness.ts:86. An empty successful reservation receipt increments the revision without installing the returned entry, so hydration is skipped. (src/agents/sandbox/registry-currentness.ts:39, 0aedb5671c69)
  • Prior finding resolution: Comparison with the previous reviewed head shows the sandbox hydration code unchanged, while the permission fixture now lives in native-hook-relay.test-support.ts alongside cleanup. (src/agents/harness/native-hook-relay.test-support.ts:4, 0aedb5671c69)
  • Original receipt boundary: fix(storage): publish sandbox, worktree, and GitHub authority receipts #168025 established typed registry receipts but expressly retained final guards because arbitrary raw SQL and trigger effects were not certified; this PR replaces those guards with cached facts. (src/agents/sandbox/registry-publication.ts:92, cbff5bd23456)
  • Recorded direction and evidence: The complete current body records the accepted idempotent outbox replay and same-owner renewal tradeoffs, a relay unit-test result, and pending validation; it supplies no sandbox final-effect authority trace. The security comment verifies the author has repository admin access. Captured body source identity: a6a83f3f55201e93408720d0903477fc06bb57c7ec7c475079da06a0d7297eed. (0aedb5671c69)
  • Live conflict: A fresh REST read confirms the reviewed head remains open and unmerged with mergeable=false and mergeable_state=dirty. (0aedb5671c69)

Likely related people:

  • Peter Steinberger: Raw commit cbff5bd adds src/agents/sandbox/registry-publication.ts:39 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: cbff5bd23456; files: src/agents/sandbox/registry-publication.ts)
  • Shakker: Raw commit 08f5fb8 adds src/agents/sandbox/registry.kernel.ts:40 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 08f5fb80f301; files: src/agents/sandbox/registry.kernel.ts)
  • Yuval Dinodia: Raw commit 7cd2e48 adds src/agents/worktrees/run-lease.ts:104 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 7cd2e482d16b; files: src/agents/worktrees/run-lease.ts)

PR surface

Source -42, Tests +164, Docs +15, Other +44. Total +181 across 41 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 16 742 784 -42
Tests 20 314 150 +164
Docs 2 143 128 +15
Config 0 0 0 0
Generated 0 0 0 0
Other 3 49 5 +44
Total 41 1248 1067 +181

Review metrics

Metric Value Why it matters
Auth-row read statements 2 → 1 The combined query reads credential and runtime-state cells in one SQLite snapshot; this is a source-level operation reduction, not a measured latency claim.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a normal-priority internal performance improvement; the introduced reservation defect blocks merging.
  • merge-risk: 🚨 compatibility: Existing persisted sandbox reservations fail after database reopen under the new facts guard.
  • merge-risk: 🚨 security-boundary: Cached registry facts replace the final native authority read before sandbox effects.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • 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 need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (5 earlier review cycles)
  • reviewed 2026-10-11T08:03:35.664Z sha 81f2d83 :: needs real behavior proof before merge. :: [P1] Preserve hydration on empty reservation settlement receipts
  • reviewed 2026-10-11T08:28:07.823Z sha e56e04c :: needs real behavior proof before merge. :: [P1] Preserve hydration on empty reservation settlement receipts | [P2] Update the outbox queue regression for deferred admission | [P2] Keep the relay cleanup migration within the test ratchet
  • reviewed 2026-10-11T09:04:43.727Z sha 1e94f14 :: needs real behavior proof before merge. :: [P1] Preserve hydration on empty reservation settlement receipts | [P2] Keep the relay cleanup migration within the test ratchet
  • reviewed 2026-10-11T09:43:02.147Z sha d764212 :: needs real behavior proof before merge. :: [P1] Preserve hydration on empty reservation settlement receipts | [P2] Keep the relay cleanup migration within the test ratchet
  • reviewed 2026-10-11T10:16:01.188Z sha 7903f60 :: needs real behavior proof before merge. :: [P1] Preserve hydration on empty reservation settlement receipts | [P2] Keep the relay cleanup migration within the test ratchet

Reviewed October 11, 2026, 6:48 AM ET / 10:48 UTC (Revision 6).

@openclaw-barnacle openclaw-barnacle Bot reopened this Oct 11, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. and removed P1 High-priority user-facing bug, regression, or broken workflow. labels Oct 11, 2026
@steipete
steipete merged commit e63b5a0 into main Oct 11, 2026
135 of 138 checks passed
@steipete
steipete deleted the dbasync/t1agents branch October 11, 2026 10:59
RomneyDa added a commit that referenced this pull request Oct 11, 2026
…mission (#169101)

#168992 (e63b5a0) reused the run-admission session snapshot for the first
native ownership read. Admission runs in prepareEmbeddedRunSession, before
the lane controller claims the session writer, so the snapshot never carries
the claimed activeWriterRunId. Every pinned native harness run with a writer
claim then failed with "Native model ownership changed during run
preparation" (run.harness-auth-failover.test.ts, 5 tests).

Reuse the admitted snapshot only when it already carries the expected writer;
otherwise take the existing worker read.
steipete added a commit that referenced this pull request Oct 11, 2026
The paired auth read introduced by e63b5a0 (#168992) no longer
prepares the old single-cell query, so the corruption fixture never fired.
Inject the same native corruption error into the paired query instead.
Keep every unreadable, cacheability and shared-handle eviction assertion.
No production behavior changes.

Linux proof: focused file 20/20 (58.12s Vitest, 60.67s wrapper);
original infra shard 57 files / 854 tests (578.34s). Disabling eviction
in the isolated negative control fails at the retained-handle assertion.
The original fixture fails at injected=false on the unchanged base.
P2 review is clean. Core test types, lint and boundary checks pass.
check-changed retains inherited duplicate-scan coverage and unrelated
unused-export failures; no scanner configuration or baseline is changed.
Use the original CI shard for this test-only matcher fix rather than the
whole unsliced infra config; no shared helper or runtime owner changed.
obviyus added a commit that referenced this pull request Oct 12, 2026
…mpaction V2) (#168401)

Closes #168088. Related: #168164.

## What Problem This Solves

With ChatGPT sign-in, every automatic compaction in OpenClaw ran a client-side summary: separate summarization requests with 0 cached tokens, and a lossy text summary in place of the conversation. Codex compacts the same route server-side ("remote compaction V2"): the next normal model request carries a trailing `{"type":"compaction_trigger"}` item, and the provider returns one opaque `compaction` item that stands in for the history.

## Fix

- **Request:** automatic compaction on the ChatGPT route (preflight before a turn, and mid-turn between tool rounds) sends V2 as the next normal request, through the same attempt pipeline and native ChatGPT stream, with `compaction_trigger` appended last. Tools, instructions, parameters, cache key and the full input prefix are the turn's own, so the compaction request reads the warm prompt cache.
- **Result:** exactly one non-empty `compaction` item is accepted, only after a successful terminal response and never after an abort. Collection resets for each provider attempt.
- **Checkpoint:** real user messages are retained newest-first within 64k tokens, plus the item, matching Codex `compact_remote_v2.rs`. Users retained from an earlier window stay eligible, so repeated compactions keep them.
- **Fallback:** every fallback to client compaction logs a WARN with its reason. Overflow recovery, `/compact <focus>` and manual `/compact` stay client-side; manual V2 needs session-writer ownership work and is a follow-up.
- **Fixed during live testing** (each with a regression that fails on the defect):
  1. V2 never ran: the compact request was checked before the async provider adapter dispatched it.
  2. V2 ran only in the managed client; real ChatGPT turns use the native stream. V2 now runs there.
  3. Replay normalization dropped the checkpoint turn as an empty failed turn, so the next request grew back to full history. It now keeps successful compaction checkpoints; error turns and suppression markers are still dropped.

## User Impact

ChatGPT sign-in sessions compact server-side with no extra summarization requests. Compaction reads 87–100% of its input from cache, and later turns stay at about 14–22k input tokens instead of about 91k. `params.responsesCompactEndpoint: false` turns it off.

## Evidence

Live, real ChatGPT OAuth login, `openai/gpt-6-astra`, isolated Gateway, synthetic corpus, three facts seeded before compaction. The host was loaded, so wall times are upper bounds.

| Compaction | Compaction input / cached / output | Wall | Input before → after | Next user turn input / cached | Recall |
|---|---:|---:|---:|---:|---:|
| Preflight | 90,999 / 73,856 / 885 | 20.2 s | 90,999 → 22,308 | 22,439 / 22,144 | 3/3 |
| Mid-turn, first | 91,075 / 82,560 / 575 | 12.3 s | 91,075 → 13,904 | 14,121 / 12,928 | 3/3 |
| Mid-turn, second | 76,486 / 58,880 / 716 | 17.4 s | 76,486 → 14,476 | 14,709 / 14,336 | 3/3 |

Request parity, compaction request vs the preceding normal turn:

| Compaction | Tools | Instruction chars | Input prefix | Cached vs previous input |
|---|---|---|---|---:|
| Preflight | 6 → 6 | 35,857 → 35,857 | 26/26 items identical | 89.3% |
| Mid-turn, first | 6 → 6 | 35,855 → 35,855 | 26/26 items identical | 99.8% |
| Mid-turn, second | 6 → 6 | 35,855 → 35,855 | 39/39 items identical | 86.7% |

The tool schemas, instructions, parameters and cache-key hashes were identical in all three. The final head sent exactly 3 `compaction_trigger` requests, all HTTP 200, and no client-summary requests.

**Client comparison (same route, before this change):** one client compaction of a 117.9k-token session took two summary calls (9,777 input, 0 cached, 961 output, 24.4 s). The next turn read 33,967 input with 12,800 cached. Trigger points were not matched to the V2 runs, so this is a reference, not a head-to-head benchmark.

**Tests:** fetch-boundary regressions across the managed and native ChatGPT streams cover:
- request parity;
- failed, cancelled and incomplete terminal responses;
- aborts;
- duplicate or empty items;
- multilingual retention;
- two consecutive persisted compactions;
- the async-dispatch case and replay normalization through the real `SessionManager`.

Negative controls fail on each defect. tsgo core/src/packages pass; `check-changed` passes.


## Release-landing follow-ups (2026.10.2)

- **ClawSweeper P2 fix (budget anchor), commit e902124:** V2 used to price the outgoing request with the conservative preflight estimator. That estimator counts unchanged instructions twice, because measured usage already includes them. The V2 boundary now uses the same accounting as the mid-turn precheck it replaces:
  - The shared code is `resolveProjectedRequestPressure`, split out of `checkMidTurnPrecheck`.
  - The stream guard's request observation now returns the matching measured predecessor. The foreground request is observed before V2 decides, so both price the same anchor. A checkpoint request is then observed again as its own request.
  - Requests with no anchor keep the conservative estimate.
  - Regression test: `chatgpt-v2-compaction.test.ts` "prices a matching measured prefix once before deciding to compact". It uses the 15,000-token / 12,000-char / 24,576 numbers from `attempt-midturn-precheck.test.ts`. It fails on the previous head (the boundary throws `MidTurnPrecheckSignal`) and passes now.
  - Production LOC: +45/-27. Most of that is the function split plus contract comments.
- **Test-only fixture fix, commit 018c9bc:** three Gateway e2e fixtures counted the labeled `OpenClaw runtime context:` carrier as a user turn: `gateway-rpc-chat`, `gateway-provider-review-product-proof` and `gateway-completion-replay`. These fail the same way on `main` (#168843; same fix as #168961).
- **Rollback to v2026.10.1:** that release's replay normalization drops the empty, zero-usage V2 checkpoint carrier. The raw transcript is never rewritten, so v2026.10.1 replays the full raw history, and its own client compaction applies if that history is too large. Rollback loses no data; it just loses the provider checkpoint. The stored checkpoint format already shipped in v2026.10.1, and its reader ignores the added optional `outputTokens` (details in the compatibility comment).

### Unrelated failures that also happen on `main` (proof scoped to the tests involved)

Both failures reproduce on a clean `origin/main` checkout at `ce5b795128e` with no PR code. Checking out commits around one change shows that both start at 5843d60 (#168539, "route transcript appends through the session actor"):

| Test | `5843d60c^` | `5843d60c` | `origin/main` `ce5b795128e` |
|---|---|---|---|
| `src/agents/embedded-agent-runner.prompt-cache.test.ts` | 4/4 pass | 2 fail (`SqliteTranscriptMutationConflictError` from `appendSessionManagerActor`) | 2 fail |
| `test/gateway-steer-fifo.e2e.test.ts` | 7/7 pass | 3 fail (1 model request where 2 are expected) | 3 fail |

- #168981 independently reports the prompt-cache failure on clean main.
- #169006 (steering diagnostics) landed and did not fix the steer-fifo failures.
- CI selects these tests for this PR only through the shared embedded-runner files. Neither failing path is touched here.

### Local proof on the current head

All runs below were local and focused on the touched files:
- `chatgpt-v2-compaction`: 13/13.
- The other affected `src/agents/embedded-agent-runner/run/` unit files: 208/208. These are `attempt-midturn-precheck`, `attempt-prompt-submit.*`, `attempt-stream-*`, `preemptive-compaction*`, `attempt-execution-phase`, `attempt-prompt-preflight` and `attempt-context-guards`.
- `agent-runner.runreplyagent.e2e`: 231/231.
- The 3 repaired Gateway e2e files: all passed.
- `node scripts/check-changed.mjs -- <touched files>` exited 0. That run includes `tsgo` for core and core tests.
- Codex protocol check (read directly in `../codex`): `codex-rs/core/src/compact_remote_v2_attempt.rs:70-84` and `compact_remote_v2.rs:65,398-450`.


### Unrelated failures on the current head (b3a7405, which merges `origin/main` at `ff6f58a8c32`)

The two failures above (prompt-cache and steer-fifo) no longer fail on this head; main has since landed actor-append fixes. Two other unrelated failures remain:

1. **`src/agents/embedded-agent-runner/run.harness-auth-failover.test.ts`** (5 tests, `checks-node-changed-compact-large-4`):
   - Fails the same way on a clean `origin/main` checkout at `ff6f58a8c32`, and passes at `bdcbb2d8870` (10/10).
   - `git bisect` names `e63b5a01cf26` as the first bad commit: #168992, "perf(agents): reduce repeated SQLite work during agent preparation".
   - This PR does not touch native harness auth.
2. **`extensions/codex/src/app-server/run-attempt.steering-settlement.test.ts`** (`checks-node-changed-extensions-bundle-3`, 180s hook timeout):
   - Also fails on the unrelated PR #169026 (CI run 38137511377).
   - Passes locally (2/2) on this head, on clean `origin/main` `ff6f58a8c32`, and on this branch merged with that main.
   - This PR touches no `extensions/codex` files.

Two other failures were flaky: `build-artifacts` (`sqlite-sessions-transcripts-flip-proof.built-cli`) and `gateway-completion-replay`. Each passed on rerun, and each passes locally after `pnpm build` on this head.

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: Dallin Romney <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
…penclaw#168992)

Move context-engine outbox persistence to its existing execution worker and remove duplicate preparation reads. Batch auth store/state reads, use committed sandbox facts at effects, and retain credential, command, and destructive-cleanup authority checks.

Agents T1 inventory: 33 to 12, with twelve documented synchronous-contract and destructive-cleanup exceptions. Five lock primitives are reclassified, not claimed as eliminated SQL. Three paired warmed measurements: 406.2 to 403.5 all-thread statements per turn; auth reads 6 to 3 statements at unchanged 3 requests. Aggregate requests 92.7 to 93.3 reflect existing session-operation variance.

Includes focused regression coverage, two Codex review rounds, and the scoped static checks recorded in the PR. No schema or public API change.

Keep no-op sandbox reservation receipts from invalidating returned row facts; existing database-reopen regressions pass.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
…mission (openclaw#169101)

openclaw#168992 (70e895e) reused the run-admission session snapshot for the first
native ownership read. Admission runs in prepareEmbeddedRunSession, before
the lane controller claims the session writer, so the snapshot never carries
the claimed activeWriterRunId. Every pinned native harness run with a writer
claim then failed with "Native model ownership changed during run
preparation" (run.harness-auth-failover.test.ts, 5 tests).

Reuse the admitted snapshot only when it already carries the expected writer;
otherwise take the existing worker read.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
The paired auth read introduced by 70e895e (openclaw#168992) no longer
prepares the old single-cell query, so the corruption fixture never fired.
Inject the same native corruption error into the paired query instead.
Keep every unreadable, cacheability and shared-handle eviction assertion.
No production behavior changes.

Linux proof: focused file 20/20 (58.12s Vitest, 60.67s wrapper);
original infra shard 57 files / 854 tests (578.34s). Disabling eviction
in the isolated negative control fails at the retained-handle assertion.
The original fixture fails at injected=false on the unchanged base.
P2 review is clean. Core test types, lint and boundary checks pass.
check-changed retains inherited duplicate-scan coverage and unrelated
unused-export failures; no scanner configuration or baseline is changed.
Use the original CI shard for this test-only matcher fix rather than the
whole unsliced infra config; no shared helper or runtime owner changed.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
…mpaction V2) (openclaw#168401)

Closes openclaw#168088. Related: openclaw#168164.

## What Problem This Solves

With ChatGPT sign-in, every automatic compaction in OpenClaw ran a client-side summary: separate summarization requests with 0 cached tokens, and a lossy text summary in place of the conversation. Codex compacts the same route server-side ("remote compaction V2"): the next normal model request carries a trailing `{"type":"compaction_trigger"}` item, and the provider returns one opaque `compaction` item that stands in for the history.

## Fix

- **Request:** automatic compaction on the ChatGPT route (preflight before a turn, and mid-turn between tool rounds) sends V2 as the next normal request, through the same attempt pipeline and native ChatGPT stream, with `compaction_trigger` appended last. Tools, instructions, parameters, cache key and the full input prefix are the turn's own, so the compaction request reads the warm prompt cache.
- **Result:** exactly one non-empty `compaction` item is accepted, only after a successful terminal response and never after an abort. Collection resets for each provider attempt.
- **Checkpoint:** real user messages are retained newest-first within 64k tokens, plus the item, matching Codex `compact_remote_v2.rs`. Users retained from an earlier window stay eligible, so repeated compactions keep them.
- **Fallback:** every fallback to client compaction logs a WARN with its reason. Overflow recovery, `/compact <focus>` and manual `/compact` stay client-side; manual V2 needs session-writer ownership work and is a follow-up.
- **Fixed during live testing** (each with a regression that fails on the defect):
  1. V2 never ran: the compact request was checked before the async provider adapter dispatched it.
  2. V2 ran only in the managed client; real ChatGPT turns use the native stream. V2 now runs there.
  3. Replay normalization dropped the checkpoint turn as an empty failed turn, so the next request grew back to full history. It now keeps successful compaction checkpoints; error turns and suppression markers are still dropped.

## User Impact

ChatGPT sign-in sessions compact server-side with no extra summarization requests. Compaction reads 87–100% of its input from cache, and later turns stay at about 14–22k input tokens instead of about 91k. `params.responsesCompactEndpoint: false` turns it off.

## Evidence

Live, real ChatGPT OAuth login, `openai/gpt-6-astra`, isolated Gateway, synthetic corpus, three facts seeded before compaction. The host was loaded, so wall times are upper bounds.

| Compaction | Compaction input / cached / output | Wall | Input before → after | Next user turn input / cached | Recall |
|---|---:|---:|---:|---:|---:|
| Preflight | 90,999 / 73,856 / 885 | 20.2 s | 90,999 → 22,308 | 22,439 / 22,144 | 3/3 |
| Mid-turn, first | 91,075 / 82,560 / 575 | 12.3 s | 91,075 → 13,904 | 14,121 / 12,928 | 3/3 |
| Mid-turn, second | 76,486 / 58,880 / 716 | 17.4 s | 76,486 → 14,476 | 14,709 / 14,336 | 3/3 |

Request parity, compaction request vs the preceding normal turn:

| Compaction | Tools | Instruction chars | Input prefix | Cached vs previous input |
|---|---|---|---|---:|
| Preflight | 6 → 6 | 35,857 → 35,857 | 26/26 items identical | 89.3% |
| Mid-turn, first | 6 → 6 | 35,855 → 35,855 | 26/26 items identical | 99.8% |
| Mid-turn, second | 6 → 6 | 35,855 → 35,855 | 39/39 items identical | 86.7% |

The tool schemas, instructions, parameters and cache-key hashes were identical in all three. The final head sent exactly 3 `compaction_trigger` requests, all HTTP 200, and no client-summary requests.

**Client comparison (same route, before this change):** one client compaction of a 117.9k-token session took two summary calls (9,777 input, 0 cached, 961 output, 24.4 s). The next turn read 33,967 input with 12,800 cached. Trigger points were not matched to the V2 runs, so this is a reference, not a head-to-head benchmark.

**Tests:** fetch-boundary regressions across the managed and native ChatGPT streams cover:
- request parity;
- failed, cancelled and incomplete terminal responses;
- aborts;
- duplicate or empty items;
- multilingual retention;
- two consecutive persisted compactions;
- the async-dispatch case and replay normalization through the real `SessionManager`.

Negative controls fail on each defect. tsgo core/src/packages pass; `check-changed` passes.


## Release-landing follow-ups (2026.10.2)

- **ClawSweeper P2 fix (budget anchor), commit e902124:** V2 used to price the outgoing request with the conservative preflight estimator. That estimator counts unchanged instructions twice, because measured usage already includes them. The V2 boundary now uses the same accounting as the mid-turn precheck it replaces:
  - The shared code is `resolveProjectedRequestPressure`, split out of `checkMidTurnPrecheck`.
  - The stream guard's request observation now returns the matching measured predecessor. The foreground request is observed before V2 decides, so both price the same anchor. A checkpoint request is then observed again as its own request.
  - Requests with no anchor keep the conservative estimate.
  - Regression test: `chatgpt-v2-compaction.test.ts` "prices a matching measured prefix once before deciding to compact". It uses the 15,000-token / 12,000-char / 24,576 numbers from `attempt-midturn-precheck.test.ts`. It fails on the previous head (the boundary throws `MidTurnPrecheckSignal`) and passes now.
  - Production LOC: +45/-27. Most of that is the function split plus contract comments.
- **Test-only fixture fix, commit 018c9bc:** three Gateway e2e fixtures counted the labeled `OpenClaw runtime context:` carrier as a user turn: `gateway-rpc-chat`, `gateway-provider-review-product-proof` and `gateway-completion-replay`. These fail the same way on `main` (openclaw#168843; same fix as openclaw#168961).
- **Rollback to v2026.10.1:** that release's replay normalization drops the empty, zero-usage V2 checkpoint carrier. The raw transcript is never rewritten, so v2026.10.1 replays the full raw history, and its own client compaction applies if that history is too large. Rollback loses no data; it just loses the provider checkpoint. The stored checkpoint format already shipped in v2026.10.1, and its reader ignores the added optional `outputTokens` (details in the compatibility comment).

### Unrelated failures that also happen on `main` (proof scoped to the tests involved)

Both failures reproduce on a clean `origin/main` checkout at `02040ecbc92` with no PR code. Checking out commits around one change shows that both start at 9657a374 (openclaw#168539, "route transcript appends through the session actor"):

| Test | `9657a374^` | `9657a374` | `origin/main` `02040ecbc92` |
|---|---|---|---|
| `src/agents/embedded-agent-runner.prompt-cache.test.ts` | 4/4 pass | 2 fail (`SqliteTranscriptMutationConflictError` from `appendSessionManagerActor`) | 2 fail |
| `test/gateway-steer-fifo.e2e.test.ts` | 7/7 pass | 3 fail (1 model request where 2 are expected) | 3 fail |

- openclaw#168981 independently reports the prompt-cache failure on clean main.
- openclaw#169006 (steering diagnostics) landed and did not fix the steer-fifo failures.
- CI selects these tests for this PR only through the shared embedded-runner files. Neither failing path is touched here.

### Local proof on the current head

All runs below were local and focused on the touched files:
- `chatgpt-v2-compaction`: 13/13.
- The other affected `src/agents/embedded-agent-runner/run/` unit files: 208/208. These are `attempt-midturn-precheck`, `attempt-prompt-submit.*`, `attempt-stream-*`, `preemptive-compaction*`, `attempt-execution-phase`, `attempt-prompt-preflight` and `attempt-context-guards`.
- `agent-runner.runreplyagent.e2e`: 231/231.
- The 3 repaired Gateway e2e files: all passed.
- `node scripts/check-changed.mjs -- <touched files>` exited 0. That run includes `tsgo` for core and core tests.
- Codex protocol check (read directly in `../codex`): `codex-rs/core/src/compact_remote_v2_attempt.rs:70-84` and `compact_remote_v2.rs:65,398-450`.


### Unrelated failures on the current head (b3a7405, which merges `origin/main` at `3dc543d9ee8`)

The two failures above (prompt-cache and steer-fifo) no longer fail on this head; main has since landed actor-append fixes. Two other unrelated failures remain:

1. **`src/agents/embedded-agent-runner/run.harness-auth-failover.test.ts`** (5 tests, `checks-node-changed-compact-large-4`):
   - Fails the same way on a clean `origin/main` checkout at `3dc543d9ee8`, and passes at `596e31d1764` (10/10).
   - `git bisect` names `70e895e21606` as the first bad commit: openclaw#168992, "perf(agents): reduce repeated SQLite work during agent preparation".
   - This PR does not touch native harness auth.
2. **`extensions/codex/src/app-server/run-attempt.steering-settlement.test.ts`** (`checks-node-changed-extensions-bundle-3`, 180s hook timeout):
   - Also fails on the unrelated PR openclaw#169026 (CI run 38137511377).
   - Passes locally (2/2) on this head, on clean `origin/main` `3dc543d9ee8`, and on this branch merged with that main.
   - This PR touches no `extensions/codex` files.

Two other failures were flaky: `build-artifacts` (`sqlite-sessions-transcripts-flip-proof.built-cli`) and `gateway-completion-replay`. Each passed on rerun, and each passes locally after `pnpm build` on this head.

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: Dallin Romney <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 19, 2026
First-parent upstream 069a5b8..75df19c (17 commits, including
openclaw#169043 entry lifecycle queries, openclaw#169034, openclaw#169058 memory index facts,
openclaw#168950, openclaw#169019 telegram queued history replies, openclaw#168790/openclaw#168756/
openclaw#168759/openclaw#168739 Solid UI ports, openclaw#168813 codex metadata/startup
lifecycles, openclaw#168981, openclaw#168992 agent preparation SQLite work).

Only conflict: worker-access inventory, regenerated (631 files, 2436
calls). Auto-merged files carrying our overlay, reviewed: snapshot.ts
(upstream's block-reply reconcile reads through index-1; our per-part
continuation-marker strip in extractAssistantStreamSnapshot unchanged),
codex side-question.ts (upstream's request-scoped client lease; our
disableContinuationTools and the extracted dynamic-tool-call helper
unaffected), subagent-registry-restore.ts, session-sharing-store.native.ts.

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

agents Agent runtime and tooling docs Improvements or additions to documentation 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. P2 Normal backlog priority with limited blast radius. 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.

1 participant