Repository navigation
Conversation
…t1cut-state # Conflicts: # src/gateway/server-methods/push-authority-router.test.ts # src/gateway/server-methods/push.ts
…t1cut-state-complete # Conflicts: # src/gateway/server-methods/push-authority-router.test.ts # src/gateway/server-methods/push.ts
…t1cut-state-complete
|
🦞👀 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. |
# Conflicts: # extensions/qa-lab/test/runtime-tool-fixture-helpers.ts # packages/memory-host-sdk/src/host/embeddings-remote-client.ts # src/config/sessions/session-accessor.transcript-turn.ts # src/gateway/server.cron.test.ts # src/plugins/openai-compatible-embedding-provider.ts
|
|
Closing this broad migration experiment. It does not establish an additional end-to-end performance improvement, later main changes already cover parts of the asynchronous migration, and the remaining candidate still has unresolved compatibility and lifecycle regressions. Any remaining fix should be isolated and measured against current main. Closed in a sweep of maintainer PRs open longer than a week. Reopen with a current reproduction if this still matters. |
What Problem This Solves
Cold discovery, model policy and whole-store auth saves still reached native SQLite through synchronous contracts. Bundled callers now prepare through existing worker owners and derive policy from captured facts. Released SDK APIs remain available with bounded deprecation warnings and documented async replacements. Internal discovery requires preparation; named native adapters serve boot, offline administration and deprecated compatibility. This follows #169580 and changes no schema, format, retention or dependency.
saveAuthProfileStoreAsyncpreserves whole-store replacement, including removal of omitted profiles and bookkeeping, and waits for committed-state publication. It captures input before awaiting; the auth owner retains shared/local ownership and external-profile filtering. UseupdateAuthProfileStoreWithLockfor partial mutation. Credential callbacks prepare before writer admission and then consume the transaction-current store. Synchronous saves retain one bounded deprecation warning.Model policy carries the pinned account's prepared provider. Discovery carries captured metadata through loader awaits and scopes facts by state root. Concurrent same-key loads queue through the existing loader; effect owners retain credential, activation and execution authority. Supplied config skips cold default capture; otherwise
resolvePluginRuntimeLoadContextAsyncawaitscaptureRuntimeConfigAsyncReader()and carries that exact config into the metadata owner. No new cache or authority guard is introduced.Provider hooks, TTS/speech, embeddings, media, web tools, Gateway and CLI consumers await existing metadata/registry owners. Model parsing offers an awaited one-shot API and prepared resolver. Bundled callers reuse their prepared result; internal cold fallbacks are removed. Native incognito removal is preserved.
The final cold-path fixes prepare the existing runtime owner before agent-command execution, channel discovery/install setup and Workshop work. Security audit remains config-only with manifest normalization disabled. Provider-auth input and Doctor install-candidate preparation carry their exact environment into the existing owner; helper lifetimes keep those prepared facts alive through consumption. These are supported entry-point repairs, with no added warm-path SQL claimed and no new measurement. Later cold-path fixes initialize the provider singleton through the existing default runtime, prepare the secrets-audit metadata scope, await the existing
addDoctorLegacyIssuesowner and Doctor catalog collection, and migrate the bundled node-native caller tosnapshotAsync. These later fixes are unmeasured; no additional T1 or per-turn saving is claimed.SDK migration
agent-runtimesaveAuthProfileStoresaveAuthProfileStoreAsyncagent-runtimeparseModelRefparseModelRefAsync/prepareModelRefResolveragent-runtimeresolveModelRefFromStringprepareModelRefResolver(...).resolveModelRefFromStringmodel-session-runtimeapplyModelOverrideWithAuthProfileCompatibilityapplyModelOverrideWithAuthProfileCompatibilityAsyncsession-transcript-runtimecreateSessionCatalogSourceActorProjectorprepareSessionCatalogSourceActorProjectorsession-transcript-runtimecreateSessionCatalogGitHubLinkerprepareSessionCatalogGitHubLinkermedia-runtimeresolveAutoMediaKeyProvidersresolveAutoMediaKeyProvidersAsyncmedia-runtimeresolveDefaultMediaModelresolveDefaultMediaModelAsyncprovider-catalog-runtimeresolvePluginProvidersresolvePluginProvidersAsyncmemory-core-host-engine-foundationresolveMemorySearchConfigresolveMemorySearchConfigAsyncrealtime-voicegetRealtimeVoiceProvider,listRealtimeVoiceProviders,canonicalizeRealtimeVoiceProviderId,resolveConfiguredRealtimeVoiceProviderAsyncoperationsrealtime-transcriptiongetRealtimeTranscriptionProvider,listRealtimeTranscriptionProvidersgetRealtimeTranscriptionProviderAsync,listRealtimeTranscriptionProvidersAsyncprovider-http,provider-model-sharedprepareModelProviderRequestRouteFactsand capturedproviderMetadataOwnersThe transcription sync pair is deprecated with bounded warnings and consumes already loaded providers; its async replacement pair owns cold provider preparation. Bundled callers await those replacements.
Legacy auth-save, model-reference, provider HTTP and realtime-voice signatures, immediate results and mutation timing remain available until a later stable release, including their named cold native adapters. Generic provider-catalog, speech and embedding discovery APIs consume an already prepared registry; their async replacements own cold discovery. Calls use the existing bounded
DEP_PLUGIN_SDKwarning per plugin/capability family. The async save does not accept a native transaction handle; transaction-local kernels retain their owner API. Media callers can supply a prepared registry. The catalog preparation helpers already existed; this change documents and registers the old factories' deprecation. Bundled callers use the async APIs. External plugins use the typed-publicagent-runtimeexports; bundled callers may use the existing privatemodel-ref-parseseam. The earlier five public declarations and two deprecations, plus the two new public provider/memory pairs, have explicit named surface allowances. The shipped release snapshot is unchanged.Removed checks and accepted edges
5b242) retired held pending-read freshness; the retained delayed-read scaffolding is removed. Status preparation racing completion may require a refresh. Confirmation checks the live receipt before effects, and direct terminal-confirmation/no-extra-commands regression coverage remains.AbortSignalrecheck: a derivation racing retirement may finish with its captured policy; real-effect owners retain current authority checks.preparePluginCacheFacthas already asserted the same fact with no intervening await; its returned guard still runs after async work at activation/effect boundaries. No SQL saving is claimed.339e4f7, with both supported-write and cross-database tests. The returned witness feeds destructive survivor/file planning and final sharing guards, so this is a real user-data/disclosure boundary. No check or SQL reduction is claimed for it.T1 accounting
The discovery cutover removes two transitive native fallback branches. Its directly inventoried SQLite primitives remain 0 → 0. Moving a shared SQL kernel behind its worker is not a statement saving.
Across the original 23 state files and their successors, this follow-up is T1 26 → 26 and worker expressions 38 → 38. The parent state lane's scoped inventory has 25 T1 expressions in original filenames plus one relocated row reader, versus 33 on the source-aware
63a034fbaseline and 54 in the original campaign census. The original comparison includes 21 classification corrections and seven removals/cutovers; it does not mean 28 fewer queries per turn. This follow-up does not claim an additional direct primitive reduction.Remaining mixed kernels serve workers, released synchronous SDK contracts, native administration, or credential authority at a real effect. Boot admission, migrations, Doctor/CLI one-shots, and lock primitives remain allowed synchronous paths. Synchronous auth-save/model-policy, model-reference, HTTP-policy and realtime-voice compatibility remains through explicit native adapters. Generic provider-catalog/speech/embedding discovery consumes prepared facts and has no internal cold fallback. The lane does not claim zero native runtime SQL or count classification changes as eliminated statements.
Measurement
One live baseline/candidate pair under RELAXED TESTING v6, using isolated state and the shared harness. Base
63a034f64e3af869a5affb0968d0d3a199121358; measured candidate1d4c0e3d1ab5d9655d6a3c00c35beb0cb154e70e.The raw increase is real inherited work, not a saving or unexplained noise. Main commit
7aae49e8677b18ca992b72a49221e1b6de4b45e4(#169660) added a transcript-triggered usage-cost sidecar: 122 SQL / 18 requests per warmed turn, plus 3 SQL / 3 plugin-state requests. Its new unscoped cache writes invalidate the session actor. This state lane adds no warmed owner-operation SQL or requests. Later type/fixture/conflict fixes preserve the measured ordinary SQL paths; a cold Dev-update fix removes a read, for which no saving is claimed.Required shared-family means per warmed turn:
The hydration increase is explicitly attributed: nine new borrowed-read and nine delivery-settlement hydrations follow usage-cache writes on the same writer thread; one follows an unchanged memory write; transcript-append hydrations fall by seven. Net: +12 across ten turns. The usage operations use the pre-existing unscoped write transaction, which bumps the revision used by all actor residency tokens. For example, turn 03 usage rollup at monotonic
481807197171208precedes borrowed hydration at481807222625583. This is a separate usage-owner optimization; no claim of a lane hydration saving is made.Whole-workload state operation SQL/requests: machineState.read 0/0→5/5 (cold worker admission); userModelAccounts.links 8/2→4/1; config health/snapshot operations and profile authority/attribution reads unchanged; userProfiles.ensureOwner 34/1→37/1 (cold admission). Registry-deletion snapshot samples fall 60/9→48/7 because a startup maintenance sweep was skipped, so that drop is not credited.
Both runs completed 13 turns, the child flow, cron, compaction and shutdown with exact SQL count conservation. There were zero missing SQL contexts or duplicate sends; request send/receive tracing has two unmatched records on base and three on candidate. On the heavily loaded host, the candidate's first attempt exceeded readiness before any turns. The successful retry used the same build and only raised the copied harness readiness deadline from 300 to 900 seconds; the shared harness and workload deadlines stayed unchanged. No latency claim is made.
Limitations retained: one candidate startup maintenance sweep logged “Agent database registry changed during discovery” and skipped; the later cron workload passed. The existing guard protects deletion/retention against an invalidated registry snapshot and remains. Candidate Workshop review reached an existing synchronous transcript effect guard (130 MAIN SQL during cron/compaction), while base scheduled that same review but rejected its stale anchor before admission. Scheduler, review and guard sources are unchanged; the metadata-preparation await may affect timing, so this is reported as background-flow placement variation rather than zero whole-Gateway MAIN. Warmed MAIN outliers are unchanged secret-store timer work, outside this lane.
Evidence
Current pushed SDK head is
d9c110158faeeea8eeddf89ef3e6625957e93182, based on root8bf0a9ca0b7e75a7ba36cee505646ada2014cd44. The merge adopts main'sisTtsProviderConfiguredAsyncreadiness helper and passes the existing prepared speech registry (6 additions/15 deletions); one deprecation comment also changes. No database operation, cache, request or owner design is added, and no SQL saving is claimed. Current static and behavior gates remain pending; prior results below are not final-head clearance.d9c1101db9c7b4, 38325886820: 7/7 types, 6/6 lint, source/export contracts, Madge, T1/dialect/worker ratchets and runtime API PASS5cf115053329496 by exact message: UI findings only, no new findings at that sourcedb9c7b438325882261 includes the cold-ingress owner hunks; actual survivor result remains pending. Both merges wait for it.LOC at these exact current pins: 1,744 files, +21,756/−10,564 (net +11,192). Production: 605 files +9,369/−4,542; tests: 1,117 +11,918/−5,801; docs: 8 +228/−7; tooling: 14 +241/−214. Test/support/harness files count as tests. Prior
00cede88update 38318174296 passed in 1,302s but is historical, not current qualification.Two Codex review rounds are complete for their recorded scopes; the lane owner reviewed later fixes. The orphaned synchronous registry-ownership helper is removed; its awaited parent guard remains. The ACP assertion keeps exactly two terminal/cancelled records and actor-release barriers. The handoff lock remains unresolved: main passed the matching test, and source identity does not prove behavioral inheritance. No additional direct T1 saving is claimed for late repairs.