Skip to content

fix: reduce completion churn and preserve first-chat authorization - #200966

Merged
steipete merged 8 commits into
mainfrom
steipete/perf-micro-prepared-model-runtime-per-completion-20260919
Nov 18, 2026
Merged

steipete merged 8 commits into
mainfrom
steipete/perf-micro-prepared-model-runtime-per-completion-20260919

Conversation

@steipete

@steipete steipete commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Each isolated title, summary, or side question copied the whole prepared model catalog even though it selected one model. A 500-model catalog meant 100,000 copied model rows for 200 short completions.

User Impact

Simple completions use less CPU and allocate less memory. Model selection, provider routing, host authorization, credentials, and prompt-cache identity retain their existing behavior. No configuration or migration is required.

Why This Change Was Made

ModelRegistry can now materialize only the normalized selected row from its captured generation while keeping fresh request-local AuthStorage. A different-model lookup, inventory access, or model registration promotes that local registry to its full captured catalog, preserving the already-exposed row. Agent runs, provider-stream preparation, and custom SDK resolvers retain their full mutable stores by default. No registry instances or mutable rows are shared between requests.

The production change adds 62 lines to carry selection through existing owners and preserve mutable SDK contracts. Existing runtime row materialization moves to its sibling module to respect the registry module's line cap. No new cache or configuration is introduced.

Evidence

The single-row regression fails against the base registry and passes with this change. Focused tests cover alias normalization through agent, worker, and actual isolated completion paths; two overlapping HTTP completions with distinct credentials; mutable registry isolation; and captured catalog generation replacement. All 133 focused consumer tests pass, including isolated authorization/fallback and prompt-prefix stability. pnpm check:changed passes on head 9670e9d37e73598560f566ec28066836ff3a8c31. Another 26 selection/generation/prefix tests pass after integration. Codex autoreview is scoped-clean with no actionable P0–P2 findings, including the materializer extraction; separate Codex passes also cleared the mechanical lint corrections and the CI measurement repair.

The committed synthetic workload makes 200 actual isolated completions to a loopback SSE provider with 500 catalog rows, after five warmup requests. A1/A2 load the base registry owner into the same completion pipeline; B uses the candidate owner. Five serial, counterbalanced rounds per arm; timing and GC-inclusive V8 main-isolate allocation sampling use separate processes. Acceptance: identical selections/replies, 200 copied rows, lower allocation/CPU, and no measured latency regression.

Median / p95 per 200 completions (p95 is the maximum of five samples):

Metric A1 A2 B
Copied model rows, count run 100,000 — 200
Registry CPU ms 190.57 / 204.21 190.07 / 207.56 8.55 / 9.09
Registry wall ms 193.02 / 206.68 192.23 / 210.34 10.21 / 10.77
Whole loop CPU ms 2219.61 / 2382.76 2138.02 / 2218.33 1776.33 / 1972.11
Whole loop wall ms 1039.81 / 1163.63 1015.57 / 1023.30 814.60 / 894.31
Sampled allocation MB 585.35 / 610.06 588.64 / 612.80 512.70 / 543.52
First five requests wall ms, separate 2778.58 / 3401.22 2779.99 / 3595.40 2655.95 / 2922.68

Against mean A medians: registry CPU -95.5%, whole-loop CPU -18.5%, allocation -12.7% (~74.3 MB), wall time -20.7%. A/A allocation medians differ 0.6%; process CPU 3.7%. Allocation ranges: A1 584.4–610.1 MB, A2 585.0–612.8 MB, B 499.7–543.5 MB. Host load rose during allocation runs; all samples are retained and profiler-run timings are excluded from the timing results. Independent CPU profiles show inclusive fork time falling from 199.8 to 10.2 ms.

This is a synthetic catalog/isolated-request benchmark, not a full large-state Gateway benchmark. The first-five metric excludes explicit catalog refresh. No production data is used. Responses fingerprint representation is untouched; the prior incremental work is already present in #189796, #193553, and #200715.

Reproduce with Node 26 and the repository dependencies:

git show 0ca4e7d3db4b83fd82bd74f43844e25605b52b85:src/agents/sessions/model-registry.core.ts > /tmp/model-registry-base.ts
node --expose-gc --import ./scripts/tsx.mjs scripts/perf/isolated-completion-registry-measure.ts --owner /tmp/model-registry-base.ts
node --expose-gc --import ./scripts/tsx.mjs scripts/perf/isolated-completion-registry-measure.ts

Repeat serial A1/A2/B five times; run --allocation and --counts separately. Timing was repeated with the final receiver-bound instrumentation. Allocation/count arms do not enable that instrumentation; their measured runtime inputs are unchanged and their existing proof is reused. The final materializer extraction is outside the measured warm fork path; final-source count proof confirms one copied row per completion.

The first local check exposed two main-parent dead-export regressions, reproduced unchanged on exact parent 0ca4e7d3db4b83fd82bd74f43844e25605b52b85: describeSpawnAuth introduced by #191324, and ADVANCED_FIELDS introduced by #200808. They were already fixed on main by #200943 (abdff0b25697f) and #200935 (e592d76967f3e). This branch incorporates main through the latter commit for that named failing gate. Patch-caused line-cap and lint errors were corrected. Those earlier failures were repaired through main integration, with no exception for them.

PR CI on 9670e9d37e735 exposed one patch-caused test failure: the measurement script introduced a lint suppression not on the production allowlist. The script now binds the actual registry instance and instruments its factory result, removing the suppression entirely. The receiver-independent fromCapturedSources factory declares this: void, matching the existing static factories. The exact failed guard, core/scripts typechecks, targeted core/scripts lint, and formatting pass locally on 84046ad961f2cb474e55ebc35d36fae0fedacb5f; the timing rerun asserts all 200 owner calls are observed. No test baseline or suppression allowlist was changed.

Main CI repairs included in this PR

CI run 44237078089 exposed two main regressions on its exact main parent, 97b03f7428d3711fb4b5653beeac5f0a62ab8afe. Both are repaired here in separate commits rather than waived as inherited failures.

The participant-custody expectations were stale after #200952 (e235b2b983b63c4365895fd87cb8fac72cb9658d). Alice requests these spawns; choosing Bob's execution authority does not transfer ownership away from Alice. The test now expects Alice in both cases. The production ownership rule is unchanged, and autonomous agent ownership remains covered. All 174 spawn-boundary, child-custody, and provenance tests pass.

The runtime reload test intermittently rejected its first chat when background catalog persistence created the initially absent agent database. The native registry publication invalidated retained missing-session facts even though no session row had changed. The session-facts acquisition now accepts the selected absent database's first registration, with matching agent and schema; actual session creation, row/lifecycle changes, unknown publications, and physical replacement keep their existing invalidation. Catalog persistence remains intact, preserving #197784's restart behavior. The small registration setup moves into the existing fact-acquisition owner to keep the preparation module within its line cap.

A local git bisect run of the focused real-runtime test, followed by direct qualification of the earlier observed boundary, identifies 2c4413a6abbfeb4ac23cd07b775a105586548af1 (#197510) as the first failing commit for first-chat authorization. Its parent 636454ee16af5d125bfe3c680e66bbcf371efe75 admitted the warmup in three trials; those historical full tests then failed a separate later capability assertion, which is not claimed as a passing suite. The introducing commit fails during first-chat fact acquisition; the current main failure occurs when the retained facts are consumed. #199565 had already repaired other cold-registration orderings. The new deterministic owner regression fails before this repair and proves both empty-store continuity and invalidation on actual session creation.

Repairs are separate commits: custody b9e54e551ddb5, first-chat authorization 617f4d97ce36eb18dc099238a365722acc824bad. On the final source, all 66 session-facts/creation-settlement tests and three complete real Gateway reload trials pass. Codex autoreview with the complete authorization/publication owners is scoped-clean through P0–P2. The repair adds 26 production lines; total production delta is 88 lines, preserving the narrow registry and authorization contracts. No configuration, schema, cache representation, or prompt-prefix identity changes.

pnpm check:changed --base 97b03f7428d3711fb4b5653beeac5f0a62ab8afe completed: all typechecks, lint, format, line caps, database guards, import-cycle checks, and remaining guards pass. Its only failure is the unused-export scan: 6 production and 7 full-tree entries, 9 distinct symbols. Running the same export owner on untouched exact parent 97b03f7428d3711fb4b5653beeac5f0a62ab8afe reproduces both lists identically. These are main regressions, not a passing-check claim:

Prior-head CI run 44249719486 tests head 617f4d97ce36eb18dc099238a365722acc824bad in merge 49cc7ff2a26d94630dc5230d2f0d04722c363609, with main parent 75a31ed2854cd7c3448cb35d4b6b4b9a547ef1cb. Its build, extension-boundary, and typecheck jobs encounter a newly introduced main regression from #201017 (62a9ca09124d408b1db45a9148f7048b04338c31): six plugin types became private while src/plugin-sdk/plugin-entry.ts still re-exports them. The same six TS2724/TS2459 errors reproduce on that exact untouched main parent with node scripts/run-tsgo.mjs --noEmit -p test/tsconfig/tsconfig.core.test.templates.json. The three source files are identical between parent and tested merge. This is a main regression requiring owner repair, not a passing check or a defect introduced by this PR. Final accounting: 39 successful jobs, 27 skipped, nine root failures plus the failed aggregate. All nine root failures contain the same six SDK errors; the automatic comparison calls them unknown because its scheduled-main run has no comparable jobs, so inheritance is established by the exact-parent reproduction and source attribution above. Hosted Codex and ClawSweeper on 617f4d9 report zero findings/open items. The prepared landing route was the authorized native inherited-failure route for this separate main regression; the two specifically requested custody/first-chat failures are fixed, not waived.

Final conflict integration

Final head 99c28cbb350b8f1d6a8967bd6bd0eeb11682f179 integrates main ee3f5a72fb75f26a55ac200a18839751c4cd9c3d because #201027 independently landed the identical custody expectation immediately before landing. The only conflict was the explanatory comment; main wording is retained and the custody helper now has no diff against main. All 18 other PR files are byte-identical to reviewed 617f4d9. All four participant cases pass again, and a fresh full-candidate Codex review is scoped-clean P0–P2. Prior performance and first-chat proof remain valid for unchanged inputs; exact-head CI and ClawSweeper were refreshed before landing. The two original repairs remain separate commits in branch history.

The reconciled run 44252803204 tests merge 2661349b0ea0b3cc07b7539e1684d4be1f48ed89 against exact main parent ee3f5a72fb75f26a55ac200a18839751c4cd9c3d. The same six SDK errors reproduce on that parent; all nine failed build/type jobs match them. ClawSweeper reviewed 99c28cbb350b8 with zero findings/open items. Final accounting: 39 jobs passed, 27 skipped, nine attributed root failures plus aggregate. The automated comparison labels these new against older scheduled main 08cb881bf7ed1751c6f61a9197cb13099b6add83 (05:26Z, before #201017); inheritance is established by the exact-parent reproduction and identical source blobs. Extension lint is skipped downstream of the failed SDK-boundary artifact. Security and hosted review are clear. The native inherited-failure route merged this exact reviewed head as 8610cd65622cd34b32f4e42b12b422734260c146.

On 99c28cbb350b8, pnpm check:changed --base ee3f5a72fb75f26a55ac200a18839751c4cd9c3d completes with all guards, lint, and formatting passing. Its failures are the six attributed SDK type errors and 19 unused exports (3 production, 16 full-tree), whose ordered lists reproduce identically on the exact untouched parent. New main export regressions: #200987 (0ff7e2772eb15ce38f28f030c90e12fabba0c2f7) added attestsGbrainRelease with only local production use; #197553 (34d6c288fe1c46a369ff4171a103226b8c6059e3) replaced external consumers of buildMessageToolSchema and resolveMessageToolActionSchemaActions; #198916 (ee3e16ecca7216d99547ee5acd614ced7e245fff) removed/folded the consumers of 16 retained test-helper/type exports in attempt context, terminal preparation, model fallback, and catalog-worker test support. These are additional main regressions for owner repair, not passing-check claims. No suppression or baseline exception was added.

@clawsweeper

clawsweeper Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts agents Agent runtime and tooling size: L labels Nov 18, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

Please review head 9670e9d37e73598560f566ec28066836ff3a8c31, especially request-local credentials, alias/fallback resolution, captured catalog generations, and promotion from the selected row to mutable full inventory. The PR includes the A/A/B allocation and CPU evidence; local focused tests and Codex review pass. The complete changed-file check is still running, and landing remains gated on its result and the final-head review.

@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR reduces model-catalog copying for isolated completions and preserves missing-session authorization facts across initial database registration.

Example: Run 200 isolated completions selecting model-0 from a 500-model catalog.

  • Before: The registry copies 100,000 model rows.
  • After: The registry copies 200 model rows while returning the same selections and replies.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation is focused and source-consistent; supplied evidence is strongest at production-owner and synthetic transport boundaries rather than a full user-facing workload.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the contributor proof gate; supplied evidence exercises actual isolated completions over loopback HTTP/SSE and reports Gateway reload trials, with unchanged changed-file bytes supporting reuse after integration.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Short utility completions copy unused catalog rows, and a first chat can lose authorization facts when background catalog persistence creates its database.
Reason: The measured reduction and concrete startup failure justify the change, and the maintainer-authored direction requires no additional product approval.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: the changes provide measurable value, preserve the reviewed ownership boundaries, and introduce no actionable defect found in this review.

Priority: P2
Reviewed head: 99c28cbb350b8f1d6a8967bd6bd0eeb11682f179

Before merge

None.

Findings

None.

Agent review details

How this fits together

Prepared model generations supply catalog facts and credentials to completion requests; session-fact preparation supplies current storage and authorization facts to Gateway operations.

flowchart TD
  A[Completion request] --> B[Captured model generation]
  B --> C[Request-local credentials and selected row]
  C --> D[Provider HTTP transport]
  C --> E[Full inventory on demand]
  F[Gateway chat request] --> G[Session fact acquisition]
  G --> H[Database and row publications]
Loading

Technical review

Best possible solution:

Retain the existing registry and fact-acquisition owners, their narrow optimizations, and the preserved mutable and authorization contracts.

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

Current-main source shows full-catalog cloning on each fork and rejection of the selected absent database’s registration; supplied regressions and benchmark results support both paths, without this review executing target code.

Is this the best way to solve the issue?

The patch removes unnecessary copying at the registry owner and corrects registration classification at fact acquisition while retaining existing persistence, credential, and revocation owners.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Registry catalog cloning and row materialization keeps the original intent (625945b: Keep catalog execution off cold startup paths while preserving prepared snapshots and mutable request-local stores.)
  • Completion resolver scope keeps the original intent (3b3af11: Keep selection, auth, model preparation, and execution on one captured plugin generation.)
  • Captured model stores keeps the original intent (fba079c: Avoid redundant admission-time catalog copies while preserving per-runtime mutation and credential isolation.)
  • Session registry invalidation changes intended behavior with a stated reason (2c4413a: Carry worker-prepared session facts forward without synchronous filesystem polling; this PR explains and narrowly corrects invalidation when empty-store creation changes no session row.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +88, Tests +110, Docs +6, Other +240. Total +444 across 18 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 11 168 80 +88
Tests 4 157 47 +110
Docs 1 6 0 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 2 240 0 +240
Total 18 571 127 +444

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus regression-test delta Production +168/−80; tests +157/−47. Net production growth preserves lazy-to-full registry promotion and empty-database authorization continuity within existing owners; the added tests cover distinct isolation, normalization, generation, and registration failures.

Labels

Label changes:

  • remove proof: sufficient: Current real behavior proof status is not_applicable, not sufficient.

Label justifications:

  • P2: This is a measured allocation improvement plus a focused first-chat startup repair.
  • merge-risk: 🚨 compatibility: The optional ModelRegistry fork argument and lazy materialization touch an SDK-visible mutable contract; the maintainer-authored direction retains full-store defaults and explicitly preserves row identity on promotion.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

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

Workflow

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

History

Review history (3 earlier review cycles)
  • reviewed 2026-11-18T03:58:18.636Z sha 9670e9d :: needs maintainer review before merge. :: none
  • reviewed 2026-11-18T04:30:27.291Z sha 84046ad :: needs maintainer review before merge. :: none
  • reviewed 2026-11-18T06:20:06.335Z sha 617f4d9 :: needs maintainer review before merge. :: none

Reviewed November 18, 2026, 1:45 AM ET / 06:45 UTC (Revision 4).

@steipete
steipete marked this pull request as ready for review November 18, 2026 04:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T06:41:10.106035Z 99c28cb New commits
ℹ️ About Codex in GitHub

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

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

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

@steipete

Copy link
Copy Markdown
Contributor Author

The prior review on 9670e9d37e735 has zero open findings. Final head 84046ad961f2cb474e55ebc35d36fae0fedacb5f repairs the one PR-caused CI failure without changing a suppression allowlist: scripts/perf/isolated-completion-registry-measure.ts:68 now binds and observes each concrete registry, verifies all 200 owner calls at line 207, and restores the factories at line 236. src/agents/sessions/model-registry.core.ts:234 declares the receiver-independent factory's existing contract with this: void.

The exact failed suppression guard, core/scripts typechecks, targeted lint/format, and Codex delta review pass. Five final A/A/B timing rounds are complete; the PR body contains the current measurements and reuse limits for allocation/count proof.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Follow #200952: Alice owns sessions she requests even when Bob supplies execution authority. Preserve autonomous agent ownership expectations. All 174 spawn-boundary, child-custody, and provenance tests pass; Codex scoped review is clean.
Preserve first-chat authorization when catalog persistence opens the selected absent database. Keep session-row, lifecycle, routing, and source-revocation guards intact. The focused bisect identifies #197510 as the first failing first-chat authorization boundary; #199565 had repaired other cold-registration orderings.

The deterministic regression is red before this fix. All 66 owning tests and three complete real Gateway reload trials pass; Codex review is clean through P2. check:changed passes every check except nine unused exports reproduced identically on exact main parent 97b03f7 and attributed to #200533, #198455, and #200817. Preserve peer cleanup scope in #201019.
@steipete steipete changed the title fix: reduce memory churn for isolated completions fix: reduce completion churn and preserve first-chat authorization Nov 18, 2026
@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Nov 18, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review final head 617f4d97ce36eb18dc099238a365722acc824bad, including the two separately committed main-CI repairs: requester-owned spawn expectations from #200952, and first-chat authorization across creation of the selected empty agent database. The latter keeps actual session-row/lifecycle/routing/source-revocation guards intact and preserves catalog persistence.

Local proof: 174 custody/provenance tests, 66 session-facts/creation-settlement tests, three complete real Gateway reload trials, and full-context Codex P0–P2 review. check:changed passes all checks except exact-parent-reproduced unused exports attributed in the updated PR body. The preceding review had zero open items; please assess the changed head afresh.

@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review final head 99c28cbb350b8f1d6a8967bd6bd0eeb11682f179. Main #201027 independently landed the same custody expectation, creating a comment-only conflict. The merge retains main wording; all 18 other PR files are byte-identical to your cleared 617f4d9 review. Four participant cases pass again, and a fresh Codex full-candidate P0–P2 review is scoped-clean. No open items existed in the preceding review. The PR body distinguishes the prior CI attribution from new-head checks; exact-head CI is starting.

@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit 8610cd6 into main Nov 18, 2026
133 of 146 checks passed
@steipete
steipete deleted the steipete/perf-micro-prepared-model-runtime-per-completion-20260919 branch November 18, 2026 06:58
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 19, 2026
…penclaw#200966)

* perf(agents): materialize selected rows for simple completions

* style: satisfy selected completion lint checks

* test: bind isolated registry measurement to concrete instances

* test: align participant custody with requester ownership

Follow openclaw#200952: Alice owns sessions she requests even when Bob supplies execution authority. Preserve autonomous agent ownership expectations. All 174 spawn-boundary, child-custody, and provenance tests pass; Codex scoped review is clean.

* fix: retain missing-session facts across database creation

Preserve first-chat authorization when catalog persistence opens the selected absent database. Keep session-row, lifecycle, routing, and source-revocation guards intact. The focused bisect identifies openclaw#197510 as the first failing first-chat authorization boundary; openclaw#199565 had repaired other cold-registration orderings.

The deterministic regression is red before this fix. All 66 owning tests and three complete real Gateway reload trials pass; Codex review is clean through P2. check:changed passes every check except nine unused exports reproduced identically on exact main parent 4dca39a and attributed to openclaw#200533, openclaw#198455, and openclaw#200817. Preserve peer cleanup scope in openclaw#201019.
RomneyDa added a commit that referenced this pull request Nov 19, 2026
…200966)

* perf(agents): materialize selected rows for simple completions

* style: satisfy selected completion lint checks

* test: bind isolated registry measurement to concrete instances

* test: align participant custody with requester ownership

Follow #200952: Alice owns sessions she requests even when Bob supplies execution authority. Preserve autonomous agent ownership expectations. All 174 spawn-boundary, child-custody, and provenance tests pass; Codex scoped review is clean.

* fix: retain missing-session facts across database creation

Preserve first-chat authorization when catalog persistence opens the selected absent database. Keep session-row, lifecycle, routing, and source-revocation guards intact. The focused bisect identifies #197510 as the first failing first-chat authorization boundary; #199565 had repaired other cold-registration orderings.

The deterministic regression is red before this fix. All 66 owning tests and three complete real Gateway reload trials pass; Codex review is clean through P2. check:changed passes every check except nine unused exports reproduced identically on exact main parent 97b03f7 and attributed to #200533, #198455, and #200817. Preserve peer cleanup scope in #201019.

(cherry picked from commit 8610cd6)

Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to clawhaven/openclaw that referenced this pull request Nov 23, 2026
…penclaw#200966)

* perf(agents): materialize selected rows for simple completions

* style: satisfy selected completion lint checks

* test: bind isolated registry measurement to concrete instances

* test: align participant custody with requester ownership

Follow openclaw#200952: Alice owns sessions she requests even when Bob supplies execution authority. Preserve autonomous agent ownership expectations. All 174 spawn-boundary, child-custody, and provenance tests pass; Codex scoped review is clean.

* fix: retain missing-session facts across database creation

Preserve first-chat authorization when catalog persistence opens the selected absent database. Keep session-row, lifecycle, routing, and source-revocation guards intact. The focused bisect identifies openclaw#197510 as the first failing first-chat authorization boundary; openclaw#199565 had repaired other cold-registration orderings.

The deterministic regression is red before this fix. All 66 owning tests and three complete real Gateway reload trials pass; Codex review is clean through P2. check:changed passes every check except nine unused exports reproduced identically on exact main parent 97b03f7 and attributed to openclaw#200533, openclaw#198455, and openclaw#200817. Preserve peer cleanup scope in openclaw#201019.

(cherry picked from commit 8610cd6)
Release adaptation: approved 2026.11.7 models replay; see models-hook-safe-v2/REPORT.md.
Co-authored-by: RomneyDa <[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 gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: L 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