Skip to content

perf(agents): revalidate question authority through session readers (session authority B2) - #165552

Merged
steipete merged 19 commits into
mainfrom
dbasync/sessauthq
Oct 6, 2026
Merged

steipete merged 19 commits into
mainfrom
dbasync/sessauthq

Conversation

@steipete

@steipete steipete commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Question answers and cancellations still projected session policy on the Gateway thread, and a matching fingerprint did not establish current authority at the final effect. Compatibility dispatch could also accept a replaced classification session with equivalent policy.

User Impact

Ordinary prepared question resolution and cancellation move their caller-policy session reads off the Gateway thread while retaining live creator, caller, backend, and session-incarnation checks. Released synchronous dispatchers remain compatible. There is no schema, configuration, retention, durability, permission, or update migration, and no new OPENCLAW_* name.

Why This Change Was Made

Compose caller-policy reads with the existing question session-reader batch and consume them immediately before the effect. Secret commits acquire retained readers before worker grants and keep their existing short indexed other-owner checks. Uncertain dispatch outcomes retain custody and are never replayed.

Integrated main 98262d8b5fda with a merge commit after B1 #165370 and native creation writes #165819 landed. The resolution preserves main's complete alias/source read plans, partial-capture compatibility, native/incognito behavior, FIFO preparation, and final queue guards. Retained native reads now reuse the same alias-selection owner. The two Codex question handlers live beside their authority helper in the existing steering module.

Released SDK check: compared v2026.10.1-beta.1 and v2026.9.8 public harness/runtime contracts. Existing synchronous callbacks and parameters remain intact; async question companions are optional, documented in the compatibility record, and type-tested. The new async reply projector was absent from the latest tag; its closure-bound signature needs no receiver, and two landed fixtures now capture it directly.

Follow-up native-read debt remains at src/auto-reply/reply/reply-tool-authority.ts:660, src/gateway/session-utils-store-worker.ts:367, and src/gateway/question-session-access.ts:616 / :625. These pre-existing short indexed other-owner reads retain current authority during secret grants; readers are acquired before grants, with no maintenance re-admission or snapshot subprocess inside them. Released custom dispatchers and process-native incognito compatibility are excluded from the moved-path zero-SQL claim.

Overlap: #146847 (question ingress/authority), #165122 (compatible input steering/runtime), and #162433 (umbrella design). Integration retains their landed semantics and keeps this delta focused on question authority.

Evidence

  • Integrated production proof: 319 distinct tests in 21 files passed, including question authority, embedded/Codex adapters, indirect auto-reply callers, released SDK types, worker import closures, runtime-process build graph, and compiled-wrapper inventory. The combined pnpm test <listed files> --maxWorkers=1 invocation took 1,232.37s; a duplicated tooling summary is excluded from the count. The two indirect auto-reply suites passed in their existing routes, so no worker-routing change was needed.
  • The earlier integrated Gateway run passed 37 question access/hosted-caller sibling cases on unchanged Gateway production code. Its new retained-reader fixture exposed an invalid maintenance-scope assumption and invalid persisted sandbox value. The corrected fixture passed against the canonical offline-maintenance fence, including current alias policy and released/closed-handle refusal. Initial combined run: 1,317.17s. pnpm test src/gateway/session-utils-store-worker.test.ts --maxWorkers=1 then passed all three cases in 288.61s wall (Vitest 230.20s, 92% transform; new retained-reader case 2.429s). CI seconds are not isolated from the shared test shard.
  • All four post-integration type lanes passed: core production, all 27 core-test graphs, extension production, and extension tests. Core-test completion reused successful graphs and continued after fixing two stale fixture .bind(operation) calls; no production contract was widened or cast. Core lint, extension lint, fixture lint, formatting, and git diff --check passed. The final extension type replays took 11.89s and 10.51s; core lint took 334.66s and extension lint 631.53s, including artifact ownership and SDK declaration preparation.
  • Fresh P2 reviews of the integrated delta and correction delta found no accepted/actionable findings. Final-source Madge reports 0 cycles (85.46s). Line-cap, max-lines, assertion, SQLite-worker, timeout-race, and environment guards passed; environment names remain 464/464, with zero added names in this production delta.
  • Local SDK API comparison 98262d8b5fda → integration commit 06a51f5af5a3 passed in 1,607.73s, acknowledgement digest 64b79729. No entrypoints or exports were removed. The direct callGatewayTool signature change preserves its existing authority fields and adds optional preparation; other rows describe reachable declaration changes. Later corrections only move private Codex implementation and fix tests; SDK source and public signatures are unchanged from that report.

Current published candidate: b927127394324734a3eabdef971ea12858a29499. Exact-head CI run 37429456950 passed on attempt 1, with no failed checks or reruns. ClawSweeper revision 6 completed on this head at 2026-10-06 07:37 UTC with no actionable correctness or security findings and no before-merge items. All execution evidence above is local; earlier performance measurements below retain their original revision scope and are not new latency claims.

Historical proof on the original approved head, retained for context

Evidence

The initial three failures were fixture failures: the real claim returned true, the real handler ran once, and all six intercepted reads used the independent policy key. The fixture had waited for the execution key. Correcting that gate retained refusal, pending-state, and zero-SQL assertions. The original three cases then passed in 121.25s.

The session-incarnation regression uses the real session writer during awaited persistence and explicitly proves the policy fingerprint remains equal. Both legacy-function and custom V2 cases failed before the pinned check (accepted true; 140.41s wall). A raw SQL prototype was discarded as evidence because canonical admission rejected its missing writer proof before the intended identity boundary.

Focused Vitest commands use --maxWorkers=1; timings include shared-host worker preparation and cleanup.

Proof Result Wall time
Final gateway-question.authority-worker.test.ts All 16 passed after correcting fixture types and using valid persisted sandbox values 132.10s
gateway-question.test.ts and server-methods/question.test.ts 60 sibling tests passed, including actual secret-write boundaries; run alongside the then-current authority fixture (76 total), on identical production code 1,071.79s combined
Routing/stream/steering/recovery plus explicit shared-registry imports 11 files, 165 passed (overlaps some focused cases) 1,918.51s
Embedded/Codex backend and attempt queue-message suites 4 files, 227 passed 510.87s
Existing reader ordering/invalidation cases 4 passed, 16 unrelated cases filtered 201.06s
Fresh independent Codex autoreview through P2, pinned to B1, including final fixture fixes Scoped-clean, no accepted/actionable findings 190.10s

Explicit import gate: test/scripts/runtime-process-build-graph.test.ts, src/auto-reply/reply/get-reply.imports.test.ts, src/state/openclaw-state.worker.imports.test.ts, src/worker/worker.runtime-imports.test.ts, src/gateway/worker-environments/worker-turn-launcher.imports.test.ts, and test/scripts/eager-import-closure.test.ts. Indirect callers were exercised; the existing host-owned/fork routing already covers this cutover, so no routing change was needed. CI seconds are not yet measured.

Final SQLite worker ratchet passed against B1 1e2b52ce7b1aebdf1f7fab6f432ef50dcdf52d9c; final-source Madge reports 0 cycles (183.49s wall). Line-cap, max-lines, assertion, timeout-race, and environment-name guards passed; the environment count remains 473/473.

Final SDK comparison passed in 2,604.47s against B1 1e2b52ce, acknowledgement digest eb6b7c20, with no removed entrypoints or exports. Public named changes are the intended optional preparation and async claim/cancel companions. Its * module closures include pre-existing internal worker types; those are not new callable SDK dispatch inputs. Production sources remain identical to that SDK candidate after the final fixture type corrections.

All selected check-changed steps passed across the full run and its same-source continuation. The full invocation took 2,029.08s and passed all four type lanes, dead-export scans (zero entries), and core lint before SDK declaration preparation hit its 300-second build deadline. Using the existing OPENCLAW_PLUGIN_SDK_BOUNDARY_ROOT_SHIMS_TIMEOUT_MS=1800000 setting, extension lint passed in 1,310.20s; every remaining command from the unchanged dry-run plan then passed. The complete continuation took 2,153.83s. No source, test timeout, assertion, or guard changed for this recovery, and no selected check was skipped.

Testbox, AWS, and Hetzner attempts stalled in local source-capsule preparation before native provider allocation. They ran no remote checks and created no leases; all task-owned processes were stopped. All execution evidence above is local.

Measurement scope: exact B1 aee090ace971e77b8a39279939d7bad8b131449e versus an earlier B2 source snapshot, using the same question fixture. Executed caller-thread session SELECTs 27 → 0; both revisions accepted the input and answered through the real handler. This attributes statements, not latency. Final question regressions independently assert zero caller-thread SQL for the moved paths. Current static scanner T1 inventory: 887 → 887; the earlier 895 count used a stale inventory.

The ordinary Gateway workload does not exercise questions. Its B1 production baseline b2b681b644732ce05e0421b138c112b073dd1dc4 (production-identical to aee090a) versus B2 tree 64fd998534336097a24082534c925b733b689015 measured warmed MAIN 160.7 → 161.1 statements/turn, whole MAIN 7,029 → 6,961, all threads 51,942 → 51,965. All 13 turns and 37 RPCs, child spawn, cron, compaction, and clean shutdown passed; three failed BEGIN IMMEDIATE lock attempts were excluded under the existing counting method. Build 658.49s; workload 277.59s. These measurements predate the final compatibility/ordering refinements and are not presented as a final-head latency benchmark.

Landing verification

Released SDK source comparison: checked v2026.9.8 public agent-harness-runtime exports, question dispatcher, and V2 reply injection contracts. Released synchronous callbacks and parameters remain intact; the async companions and preparation fields are optional. The existing compatibility record and public-subpath type tests cover this boundary.

Rechecked final question authority: ordinary resolution/cancellation and embedded/local settlement consume fresh caller-policy reads immediately before the effect. Secret-store commits retain the agent-database reader before the shared-state grant; their documented short indexed other-owner reads do not reacquire maintenance admission or invoke snapshot fallback inside the grant. Same-fingerprint session replacement is rejected by session identity and lifecycle revision.

Additional indirect-worker routing proof on 3f5ef914cf4357afcc4185e51d144dc9ef5260b8, each with --maxWorkers=1: src/gateway/mcp-http.question-authority.test.ts passed all 12 tests (474.28s wall); src/auto-reply/dispatch.question-input.test.ts plus src/auto-reply/reply/agent-runner-steer-adoption.question-recovery.test.ts passed all 31 tests (167.80s wall). All passed in their existing project routes; no route or assertion changed. These timings include worker preparation/imports and cleanup; additional CI seconds are not measured.

… workers

Move current chat admission, reply authority, lifecycle preparation, verbosity, and maintenance reads through existing workers. Retain physical source identity and foreign-commit freshness, preserve accepted lifecycle settlement through close, and carry prepared transcript selection facts.
Join accepted event batches and listener settlement in fixtures. Keep restart metadata preparation with the work-admission owner and make callback this contracts explicit.
Merge main to resolve session admission and event-test conflicts. Preserve the qualified worker-backed admission owner from #164682 and main's consolidated tests, awaiting asynchronous event handling where required. Reuse internal-effects filtering across both Gateway read paths.\n\nThe complete candidate is clean through P2 autoreview. Focused conflict tests and remaining changed-check and published-driver update gates are tracked on #165028.
Use the existing async-aware event subscription helper in the consolidated
verbosity test. The previous merge retained the plain unsubscribe callback
while awaiting its drain method, causing a TypeError before the assertions.

The corrected event-handler file passes all 82 tests. Together with the four
unchanged passing files, the integrated focused group covers 163 cases.
The one-line fixture correction is clean through P2 autoreview.
Merge main's transcript-context lane while retaining its prepared-start
validation and released callback compatibility. Use the captured session
initialization binding instead of a caller-thread session read, and combine
context validation with lifecycle facts in the final anchor snapshot.

Focused reply, anchor, context, runtime-build and import checks pass. P2 review
raised a conditional global-alias concern, rejected after independent source
tracing: the final read uses an admission receipt created from the selected
stored key, and mismatched admission/session keys are refused beforehand.
No actionable review finding remains.
Await asynchronous agent-event consumers and projection disposal. Move lifecycle fault injection to prepared callbacks, and track accepted writes through owner-controlled persistence before fixture cleanup. Initialize runtime config before observing row publications.
Use partial mocks for lifecycle preparation, session entry writes, and worker reads. Remove the three obsolete mock-factory baseline entries. The five affected tests, typed core lint, mock-export scanner, and P2 review pass.
Merge main 228ff57 to incorporate the
host-owned cron test routing fix.

Read session currentness before the final transcript anchor snapshot, then
recheck live routing and run authority without another worker lookup. A
real branch switch during the old final lookup returned stale delivered
state; the new regression proves the repair.

Move the unchanged transcript reply text helper and its existing tests to
the reply-input owner, updating every internal caller. Released callback
contracts remain unchanged.
Merge main dc518bf for the real
session-store conflicts introduced by snapshot-only entry hydration.
Retain main's projection types and selection defaults alongside physical
source identity retention and internal-effect filtering.

The four focused worker/currentness/anchor cases, typed core lint,
diff checks, and fresh P2 review pass. Earlier unchanged proof retains
its original source attribution.
Join the physical-store writer queue before inserting the malformed fixture
row. Session replacement starts asynchronous maintenance; an uncoordinated
synchronous host write can block the admission callback a worker needs to
release its SQLite lock.

Preserve the raw bytes, post-admission position, lack of publication, and
all assertions. The original lock reproduced in CI and one of five head
controls; the targeted repaired case, typed lint, formatting, and P2 review
pass. The separate slow handle-cap case remains recorded in local controls.
Keep run-owned policy preparation separate from caller lifetime bindings so released unbound V1 backends remain usable. Explicit caller assertions still require the guarded path, and legacy dispatch revalidates current owner and policy.

Retain terminal availability classification and update indirect fixtures for real fingerprints, awaited question registration, and optional steering preparation. Focused proof: 299 tests in 11 files passed in 535.58 seconds; fresh P2 autoreview is clean. No schema, retention, durability, or configuration change.
Treat completion or abortion of the captured target during fingerprint preparation as follow-up admission. Keep caller revocation and live-target route changes fenced, and let the existing completion barrier settle before draining the next turn.

Deferred-read regressions fail on the prior head and prove exactly-once follow-up at both await boundaries, revoked caller rejection, and aborted-owner settlement. All 26 focused tests, production/messaging types, lint and formatting pass; fresh P2 autoreview is clean.
Compose fresh question policy reads with the existing final session-reader
boundary and migrate bundled input adapters to awaited preparation. Retain
live creator, caller, backend, physical-store, and session-generation checks
before resolving or cancelling a question.

Keep released synchronous/custom dispatch contracts with pinned native
assertions. Refuse a replacement policy session even when its fingerprint
matches, and preserve unknown-answer custody without replay.
@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

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

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling extensions: codex size: XL labels Oct 5, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 5, 2026
@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 6, 2026, 3:51 AM ET / 07:51 UTC (Revision 7).

ClawSweeper review

What this changes

The branch moves question-answer and cancellation policy reads into session workers, rechecks current authority before effects, and adds optional asynchronous plugin callbacks while preserving released synchronous contracts.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main does not cover its remaining work. The pinned diff has no actionable correctness or security findings, and the supplied boundary evidence supports normal merge review.

Priority: P2
Reviewed head: b927127394324734a3eabdef971ea12858a29499

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent owner-boundary change with meaningful refusal coverage, preserved released contracts, and successful exact-head CI.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): Reported production-boundary runs exercise Gateway question resolution with real session workers: allowed answers succeed, foreign policy changes and creator closure refuse before resolution, and equal-fingerprint session replacement refuses before compatibility dispatch. Source inspection connects those assertions to the changed owners. Historical SQL measurements retain their earlier revision scope; schemas and stored formats are unchanged.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): Reported production-boundary runs exercise Gateway question resolution with real session workers: allowed answers succeed, foreign policy changes and creator closure refuse before resolution, and equal-fingerprint session replacement refuses before compatibility dispatch. Source inspection connects those assertions to the changed owners. Historical SQL measurements retain their earlier revision scope; schemas and stored formats are unchanged.
Evidence reviewed 10 items Pinned introduction: Reviewed the complete introduced delta from 98262d8 to b927127. The supplied test merge has stale parentage and was not used to attribute removal of current-main behavior.
Final policy consumption: Caller-policy reads join the question session batch; their prepared assertions and current operation checks execute synchronously before the consumer. Answer and cancellation handlers also reassert authority immediately before changing question state.
Secret commit authority: Secret answers retain caller readers before write grants. The existing secret-write callback composes current caller/session authorization with question currentness; the introduced delta changes neither secret serialization nor database schemas.
Findings None None.
Security None None.

How this fits together

OpenClaw’s question subsystem receives answers and cancellations from agent and inbound-message adapters. It checks the question creator, caller policy, and session ownership before resolving a question or storing a secret.

flowchart TD
  A[Answer or cancellation] --> B[Agent input adapter]
  B --> C[Question reservation]
  C --> D[Session worker policy reads]
  D --> E[Current authority checks]
  E --> F[Resolve or cancel question]
  E --> G[Guarded secret write]
  E --> H[Refuse stale input]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +648, Tests +404, Docs +32. Total +1084 across 30 files.

View PR surface stats
Area Files Added Removed Net
Source 22 808 160 +648
Tests 5 407 3 +404
Docs 3 38 6 +32
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 30 1253 169 +1084

Review metrics

Metric Value Why it matters
Production versus test growth Production +808/-160, net +648; tests +407/-3, net +404 Production growth implements final authority composition and retained compatibility readers; tests cover effect-boundary refusal and released contracts.
Optional SDK companions 2 asynchronous question sink methods and 1 asynchronous dispatcher assertion These additions preserve the existing synchronous methods and are covered by compatibility documentation and type assertions.

Technical review

Best possible solution:

Keep final question effects under the existing session and question owners, with fresh policy checks and the documented synchronous SDK compatibility window.

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

Yes, a focused boundary regression replaces the classification session during awaited persistence while preserving its policy fingerprint, then checks refusal before resolution. The supplied before/after results support that path; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes, composing fresh reads with the existing final question boundary preserves one authority owner and avoids a competing policy implementation. Released callbacks retain their signatures and compatibility checks.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. Reported production-boundary runs exercise Gateway question resolution with real session workers: allowed answers succeed, foreign policy changes and creator closure refuse before resolution, and equal-fingerprint session replacement refuses before compatibility dispatch. Source inspection connects those assertions to the changed owners. Historical SQL measurements retain their earlier revision scope; schemas and stored formats are unchanged.

Label justifications:

  • P2: This is a bounded session-worker improvement with authority hardening, without evidence of an urgent user-facing regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Reported production-boundary runs exercise Gateway question resolution with real session workers: allowed answers succeed, foreign policy changes and creator closure refuse before resolution, and equal-fingerprint session replacement refuses before compatibility dispatch. Source inspection connects those assertions to the changed owners. Historical SQL measurements retain their earlier revision scope; schemas and stored formats are unchanged.
  • proof: sufficient: Contributor real behavior proof is sufficient. Reported production-boundary runs exercise Gateway question resolution with real session workers: allowed answers succeed, foreign policy changes and creator closure refuse before resolution, and equal-fingerprint session replacement refuses before compatibility dispatch. Source inspection connects those assertions to the changed owners. Historical SQL measurements retain their earlier revision scope; schemas and stored formats are unchanged.

Evidence

What I checked:

  • Pinned introduction: Reviewed the complete introduced delta from 98262d8 to b927127. The supplied test merge has stale parentage and was not used to attribute removal of current-main behavior. (b92712739432)
  • Final policy consumption: Caller-policy reads join the question session batch; their prepared assertions and current operation checks execute synchronously before the consumer. Answer and cancellation handlers also reassert authority immediately before changing question state. (src/gateway/question-session-access.ts:316, b92712739432)
  • Secret commit authority: Secret answers retain caller readers before write grants. The existing secret-write callback composes current caller/session authorization with question currentness; the introduced delta changes neither secret serialization nor database schemas. (src/gateway/question-session-access.ts:642, b92712739432)
  • Authority boundary regressions: The new suite uses the production Gateway tool call, question handler, manager, and real session readers. Allowed cases resolve or cancel; foreign-policy changes and creator closure leave the question pending. Compatibility cases replace the policy session during persistence, retain an equal fingerprint, and assert refusal before handler invocation. (src/agents/harness/gateway-question.authority-worker.test.ts:299, b92712739432)
  • Complete captured proof context: Read the full body through GitHub and verified its SHA-256 equals the supplied snapshot identity, 0f742630d0d09e603019cd8a4a3e6f84b92b91e05d6d47662189cc61b2b022cd. It reports 319 integrated passing cases, retained negative controls, released-contract checks, and historical real-handler SQL measurements of 27 to zero caller-thread session SELECTs. Historical measurements retain their original revision scope; no reviewer-side execution is claimed. (b92712739432)
  • Released SDK compatibility: GitHub source inspection of v2026.9.8 confirms the released synchronous dispatcher assertion and optional question sink callbacks. The branch retains these signatures and documents additive asynchronous companions and the existing major-version removal gate. The unavailable local release blob was inspected through GitHub instead. (src/agents/harness/gateway-question-dispatch.ts:19, fc23bc864e45)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (6 earlier review cycles)
  • reviewed 2026-10-05T11:55:58.254Z sha 3f5ef91 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-05T12:42:08.515Z sha 3f5ef91 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-06T00:48:07.907Z sha 3f5ef91 :: needs changes before merge. :: none
  • reviewed 2026-10-06T02:15:27.401Z sha 3f5ef91 :: blocked before merge. :: none
  • reviewed 2026-10-06T04:26:39.695Z sha 3f5ef91 :: blocked before merge. :: none
  • reviewed 2026-10-06T07:37:04.848Z sha b927127 :: needs maintainer review before merge. :: none

@github-actions

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

These security sensitive changes were made:

  • src/agents/cli-runner/tool-authority.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/harness/tool-authority.runtime.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Oct 6, 2026
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Oct 6, 2026
Preserve landed session-authority preparation, alias-aware read plans, FIFO input custody, and released synchronous SDK callbacks while composing question policy reads at the final effect boundary. Retain existing other-owner session checks before secret-write grants without reacquiring reader admission. No schema, retention, permissions, or update migration changes.
Keep Codex question handlers beside their authority helper within the existing module. Exercise retained session policy against the canonical offline-maintenance fence, use valid persisted sandbox state, and align landed authority fixtures with the closure-bound async projector. Preserve released synchronous contracts and existing input custody.
@openclaw-barnacle openclaw-barnacle Bot removed the scripts Repository scripts label Oct 6, 2026
@steipete

steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Oct 6, 2026
@steipete
steipete merged commit 5709e38 into main Oct 6, 2026
162 checks passed
@steipete
steipete deleted the dbasync/sessauthq branch October 6, 2026 08:18
@steipete

steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 7, 2026
…session authority B2) (openclaw#165552)

* perf(sessions): serve remaining per-turn session authority reads from workers

Move current chat admission, reply authority, lifecycle preparation, verbosity, and maintenance reads through existing workers. Retain physical source identity and foreign-commit freshness, preserve accepted lifecycle settlement through close, and carry prepared transcript selection facts.

* refactor(sessions): finish async admission cutover

Join accepted event batches and listener settlement in fixtures. Keep restart metadata preparation with the work-admission owner and make callback this contracts explicit.

* test(sessions): drain the merged event subscription fixture

Use the existing async-aware event subscription helper in the consolidated
verbosity test. The previous merge retained the plain unsubscribe callback
while awaiting its drain method, causing a TypeError before the assertions.

The corrected event-handler file passes all 82 tests. Together with the four
unchanged passing files, the integrated focused group covers 163 cases.
The one-line fixture correction is clean through P2 autoreview.

* test(gateway): finish async lifecycle fixture cutover

Await asynchronous agent-event consumers and projection disposal. Move lifecycle fault injection to prepared callbacks, and track accepted writes through owner-controlled persistence before fixture cleanup. Initialize runtime config before observing row publications.

* test(gateway): preserve lifecycle fixture module exports

Use partial mocks for lifecycle preparation, session entry writes, and worker reads. Remove the three obsolete mock-factory baseline entries. The five affected tests, typed core lint, mock-export scanner, and P2 review pass.

* test(gateway): serialize malformed-row fixture writes

Join the physical-store writer queue before inserting the malformed fixture
row. Session replacement starts asynchronous maintenance; an uncoordinated
synchronous host write can block the admission callback a worker needs to
release its SQLite lock.

Preserve the raw bytes, post-admission position, lack of publication, and
all assertions. The original lock reproduced in CI and one of five head
controls; the targeted repaired case, typed lint, formatting, and P2 review
pass. The separate slow handle-cap case remains recorded in local controls.

* perf(agents): prepare tool authority through session readers

* fix(agents): retain all steering guards and exact sandbox reads

* test(gateway): import the steering contract from its owner

* test(reply): retain acceptance coverage with preparation tests

* fix(agents): preserve legacy steering during worker preparation

Keep run-owned policy preparation separate from caller lifetime bindings so released unbound V1 backends remain usable. Explicit caller assertions still require the guarded path, and legacy dispatch revalidates current owner and policy.

Retain terminal availability classification and update indirect fixtures for real fingerprints, awaited question registration, and optional steering preparation. Focused proof: 299 tests in 11 files passed in 535.58 seconds; fresh P2 autoreview is clean. No schema, retention, durability, or configuration change.

* fix(reply): retain input when its steering target completes

Treat completion or abortion of the captured target during fingerprint preparation as follow-up admission. Keep caller revocation and live-target route changes fenced, and let the existing completion barrier settle before draining the next turn.

Deferred-read regressions fail on the prior head and prove exactly-once follow-up at both await boundaries, revoked caller rejection, and aborted-owner settlement. All 26 focused tests, production/messaging types, lint and formatting pass; fresh P2 autoreview is clean.

* perf(agents): revalidate question authority through session readers

Compose fresh question policy reads with the existing final session-reader
boundary and migrate bundled input adapters to awaited preparation. Retain
live creator, caller, backend, physical-store, and session-generation checks
before resolving or cancelling a question.

Keep released synchronous/custom dispatch contracts with pinned native
assertions. Refuse a replacement policy session even when its fingerprint
matches, and preserve unknown-answer custody without replay.

* fix(agents): finish question authority integration

Keep Codex question handlers beside their authority helper within the existing module. Exercise retained session policy against the canonical offline-maintenance fence, use valid persisted sandbox state, and align landed authority fixtures with the closure-bound async projector. Preserve released synchronous contracts and existing input custody.
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 extensions: codex gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security-sensitive-changed size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant