Repository navigation
perf(models): prepare personal model pin authority through workers - #165547
Conversation
Prepare exact account ownership through the existing shared-state reader and retain profile identity authority across awaited selection. Final pin checks consume live owner-held revisions without SQLite; default-link changes preserve explicit pins while identity transfer and store retirement revoke them.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed October 5, 2026, 9:27 AM ET / 13:27 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR moves personal model-account ownership preparation to the existing database worker and retains live identity checks when committing session selections. Merge readiness✅ Ready for maintainer review The PR remains useful: current main still performs synchronous account-ownership reads. The introduced cutover preserves final authorization checks, and no actionable patch defect was found. Priority: P2 Review scores
Verification
How this fits togetherPersonal model accounts let signed-in users select their own provider credentials for a session. Chat directives and Gateway requests prepare account ownership, then session writers recheck that authority before saving the selection. flowchart TD
A[Chat model directive] --> C[Account selection preparation]
B[Gateway model request] --> C
C --> D[Shared-state database worker]
D --> E[Live identity authority]
E --> F{Authority still current}
F -->|Yes| G[Save session selection]
F -->|No| H[Reject selection]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +19, Tests +101, Docs +3, Other +1. Total +124 across 16 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Use the existing worker reader and identity owner for account preparation while preserving synchronous final commit checks and established session-pin semantics. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the synchronous ownership-read path on current main; the PR also reports before/after SQL interception measurements. This read-only review did not execute the path. Is this the best way to solve the issue? Yes, reusing the existing account worker and identity authority is a focused cutover, and the final persistence guards continue to consume live authorization. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b2dfd4e9dc58. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Merge main without rebasing the personal model pin authority branch. Keep the reviewed ownership cutover unchanged and include the extracted deferred migration schema contract in the compiled PR wrapper inventory. The inventory regression failed before that entry and passes afterward. Validation: core and all 27 core-test type graphs, Madge (zero cycles), 27 focused worker/import tests, wrapper inventory regression, and clean P2 autoreview of the integrated candidate. The original SDK report is reused with a fresh reachability audit; the production patch is unchanged.
|
Merged via squash.
|
…penclaw#165547) Prepare exact account ownership through the existing shared-state reader and retain profile identity authority across awaited selection. Final pin checks consume live owner-held revisions without SQLite; default-link changes preserve explicit pins while identity transfer and store retirement revoke them.
What Problem This Solves
Selecting a personal model account queried SQLite on the Gateway thread, and retained selection guards repeated the ownership query after awaited work.
Why This Change Was Made
Prepare ownership through the existing shared-state account reader, anchored to the profile owner's identity revision before the read. Directive selection, explicit Gateway selection, and session-default preparation retain that same live authority for their final checks. Remove the superseded synchronous ownership facade.
User Impact
Personal model selection no longer runs caller-thread SQL for ownership preparation or retained pin validation. Default-account changes preserve explicit pins; identity transfer and database retirement revoke them. Schemas, credential storage, permissions, RPC shapes, and released SDK signatures are unchanged. No new
OPENCLAW_*names are added. OAuth settlement is a separate follow-up.Evidence
e78e965a55e2: 883 → 882 overall; the four scoped runtime sites become three. Administrative SDK kernels retain their separate classification.--maxWorkers=1; 2,869.70 s total wall time on the loaded local host. Includes runtime-process build graph, reply/shared-worker import closure, and the real pin measurement.models-session/sessions-titlesuites: 57 tests passed with--maxWorkers=1, 738.03 s wall.node scripts/check-changed.mjsran for 2,217.13 s and stopped on two base-present Knip findings:GoogleMeetJoinResultinextensions/google-meet/src/transports/types.tsandMeetingRuntimeOwnerinsrc/meeting-bot/runtime-facade-types.ts. Their complete declaration/reference sets and scanner configuration match the pinned base; neither domain is changed here. Core and all 27 core-test type graphs passed. All nine remaining planned checks passed when run directly after that early exit (1231.90 s combined wall time). The unused-export failure remains recorded; no ignore or baseline exception was added.Existing role-policy cache misses can still read the separate profile-role owner at
src/gateway/operator-role-policy.ts:48, reached by the retained Gateway authority guard atsrc/gateway/server-methods/users-model-account-access.ts:108. This pre-existing path is outside the moved account ownership operation.Overlap: #162433 is the existing umbrella ownership draft; this change keeps focused account-selection hunks and does not adopt its redesign. #165288 also touches
session-create-service.tsfor unrelated cleanup; these hunks stay limited to account authority. The landed #165360 updates separate create-target hunks on main.Landing audit: compared the changed signatures and removed ownership facade against
v2026.9.8. They are internal-only, with no SDK barrel, documented subpath, orapi.runtimeexport. The releasedmodelAccountConnectServicemethods and Promise-returningcreateSessionEntryfacade are unchanged; no compatibility shim is needed.Initial CI at
e53b2d21f39d8a573a74b7077122945123b6dd90had one root failure: the Madge guard. The identical 17-module cycle failed independently in scheduled main architecture at the exact CI baseline78e406060b56bac2d09810161ac7b483861e9879; every cycle module is outside this PR's changes. The aggregate CI gate fails downstream. Selected build, test, type, lint, and security jobs passed. Main subsequently fixed that cycle in21901766c534; merge commitf554d535571fintegrates the fix without rebasing. The new head receives fresh CI; the prior failure is not relabeled as passing.ClawSweeper completed its review of
f554d535571fat 2026-10-05 13:27 UTC with no actionable findings. Current-head CI passed with no failed or cancelled CI jobs.Post-integration evidence for
f554d535571f:--maxWorkers=1in 612.00 s. The original 379-test proof remains applicable to the unchanged pin production patch.e78e965a55e2→e53b2d21binding. A fresh integration audit verified identical production patches, unchanged relevant public contracts, and no new SDK reachability for the changed private functions. It is reused evidence, not a relabeled exact-head rerender.The operator-requested published-driver update cell passed on isolated Linux state: published
2026.9.8updated to candidate commitf554d535571f8e52124a6039cb2977afa77208ba. The actual updater exited 0 in 361.706 s, the durable update phase wasfinished, readiness returned 200, and the running build ID matched the candidate. Durable and incognito session after-checks and service shutdown all passed. Full candidate build, tarball integrity, and packaged import-graph checks passed beforehand. Candidate SHA-256:b8321aa7c0a95faea5352eb88a973cdb24953cdb5594d24bb32b26a1b325a35f. This is separate proof because ordinary PR CI does not run that cell.