Repository navigation
fix(talk): avoid full plugin imports during cold catalog discovery - #138483
Merged
Merged
Conversation
Use optional capability catalog entries backed by the same provider factories and native host operations as full registration. Preserve prepared generations, active descriptors, installed-plugin registration, and explicit empty-family semantics. Account for exactly three approved public catalog type exports.
Contributor
|
🦞👀 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. |
steipete
marked this pull request as ready for review
September 4, 2026 18:31
This was referenced Sep 6, 2026
This was referenced Oct 8, 2026
This was referenced Oct 15, 2026
This was referenced Oct 16, 2026
This was referenced Oct 19, 2026
This was referenced Oct 20, 2026
This was referenced Oct 24, 2026
This was referenced Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #138443
What Problem This Solves
Fixes an issue where users opening the Control UI in a cold source checkout can wait roughly 93 seconds for Talk capability discovery. The remaining cost is full voice-plugin runtime import after #130664 repaired discovery-context ownership; that earlier repair remains intact.
Why This Change Was Made
An optional
capabilityCatalogEntrylets plugins construct the same real provider descriptors without full runtime registration. Eighteen voice owners share their existing provider factories through this boundary. Prepared metadata, selected plugin roots, artifact/module caches, and registrars retain ownership; 17 native host operations keep transport, auth, headers, logging, and capture outside synchronous Jiti evaluation during catalog construction.Active runtime descriptors retain priority. A present family, including an empty family, is authoritative. Absent declarations and omitted families retain the shipped installed-plugin
register()contract. Broken declared entries fail visibly, and catalog-only records cannot satisfy full runtime-registration checks. Provider identity and hidden broker methods remain intact.The integration preserves main's realtime call allocation, session retirement and ownership, native control delegation, xAI playback ownership, HTTP body idle deadlines, and normalization-once optimization. It preserves #136998's request-entry repair. The separate bookkeeping proposal in #138111 is not incorporated.
Maintainer decision: Peter authorized landing the descriptor/native-host architecture and public manifest/SDK contract, including exactly three public types:
PluginCapabilityCatalog,PluginCapabilityCatalogEntry, andPluginCapabilityCatalogContext. Pinned main's public-export allowance is 4,428; this candidate allows 4,431. Callable allowance remains 2,616. No other ceiling, operator option, dependency, protocol, persistent-store, or schema change is introduced. No second cache, global binding setter, warmer, or readiness substitute is added.User Impact
Cold Talk discovery can enumerate voice capabilities without importing unrelated full plugin entrypoints. Provider selection, authentication, synthesis/transcription/session factories, installed overrides, and runtime lifecycle remain owned by their existing implementations.
This does not fix the separately assigned background model-refresh event-loop stall. It does not claim authenticated provider audio was tested. The stock multi-agent fixture intentionally returns
AGENT_SELECTION_REQUIREDbecause it has no Talk owner.Evidence
Final source head:
3207194bbe4faabbf1a0bb3949f93750d92db4e4, integrated onf45b2a45f9b764f05199e80c7b4ab17c65485e94. Fresh secretless AWS proof used Node 24.19.0, pinned pnpm 12.1.0, Ubuntu 26.04, and Chrome 152.0.7977.82, with no instance role, Tailnet, credential hydration, or operator/auth stores:ciArtifactsbuild passed in 1m46s, then 1/1 passed, including cleanup; expected ownership rejection at 4,599 ms.The stock assertions and 120-second deadline are unchanged. Integrated main includes #137612, which rejects ambiguous Talk ownership before discovery; these stock timings establish browser behavior, not the same cold-import path as the old baseline. All six final screenshots and all 48 native video frames were inspected and contain only synthetic browser content. The VM was released after proof.
Before-fix evidence: the retained CPU profile attributes 87.695 of 118.030 sampled seconds to Talk ancestry. A fresh baseline at cd8c7488 measured 92,991 ms. Row/card assertions were reached, but cleanup failed with one root instead of zero; that cause is unproven. No valid recording of the entire original stall exists. Before integration, the original candidate source replay passed at 4,502 ms, the built replay at 4,652 ms, and a separate valid-owner native run at 224.231 ms, with the same non-paired caveat.
Local validation passed 1,461 tests/73 files, followed by 121 final registry/catalog cases. The CI repair passed 467 focused tests/14 files, 548 xAI tests/32 files, and 148 DeepInfra tests/17 files. A fresh committed-head compatibility run passed 55 tests/3 files, covering source/built/installed roots, register-only and omitted-family fallback, explicit empty families, broken declarations, and ESM/CJS artifact metadata. The full local build passed in 10m38s; its only subsequent difference is a corrected type-only import in a test. The complete final changed-check driver passed in 13m40s, including all four type graphs, lint, zero dead exports, SDK budgets, and source guards. Runtime and type-inclusive import-cycle checks both found zero cycles. Independent review completed three full-candidate P0 passes and a fresh final CI-repair P0 pass with no actionable findings.
Exact-head CI completed successfully: 123 successful jobs, 12 skipped. The fresh secretless npm artifact proof also passed at the same head: a clean
ciArtifactsbuild, canonical--packfor all eight affected publishable plugins (DeepInfra, Fish Audio, Gradium, Inworld, Mistral, Volcengine, Vydra, and Xiaomi), and native imports of the actual tarball catalog entries. Packed entry paths, provider identities, tarball SHA-256/integrity metadata, and unchanged tracked source were verified. The existing production peer-link helper supplied the built host dependency. No packages were published and no provider credentials or inference were used. This complements the installed-override and register-fallback contract tests above.The first integrated CI run exposed a DeepInfra type back-edge, missing executable roots in Knip, incomplete whole-module test mocks, and an over-broad type dependency path into config-doc selection. The repair moves shared types/constants to their leaf owners, separates descriptor and host-operation types, recognizes manifest-loaded entries, preserves actual exports under existing test overrides, and removes an unused xAI wrapper. All eight transcription behavior tests now use the existing production lazy constructor. Unchanged runtime/type assertions caught missed private imports, which were migrated to the correct owners. No assertions, deadlines, selector policy, or dependency internals were weakened.
Retained limitations and failed attempts: context-only and SDK-narrowing attempts still took roughly 89–93 seconds; ten xAI streaming tests caught the earlier pre-await socket-order regression before it was repaired at the existing lazy execution boundary. Integration exposed a duplicate auth import and the unchanged 700-line owner limit; removing the obsolete import and replacing a merge wrapper with ordered iteration resolved them. Vitest cache-generation failures are separately tracked in #138248. One xAI import test initially exceeded its unchanged 120-second limit and passed the same-order replay in 18.134 seconds; its timeout cause remains unproven. The first CI run also failed an unrelated Settings navigation test added by newer main; this PR does not edit that protected fixture. The final-head Settings job passed; the earlier failure’s cause remains unproven.
The report-only UI startup budget was already over its limit on pinned main: 350,377 bytes against 350,141. The final local build measured 350,431, a 54-byte difference within the existing 64-byte build-variance allowance. UI source and limits are unchanged. This overage remains recorded, not waived.
ClawSweeper follow-through: both Rank-up requests are complete. Maintainer approval is recorded above; exact-head source, built, installed-plugin compatibility, and actual npm tarball catalog proofs all pass. The flagged JSON serialization in
loader-load-context.tscreates a key for the existing in-memory LRU cache using process-local object identities. It introduces no persistent data model or migration, so SQLite downgrade/migration proof is not applicable. The full local diff contains 184 paths; production/test accounting below uses the complete list.Most gross production churn moves existing provider and response-body code into factories and leaf modules. Remaining growth implements the approved descriptor/native-host boundary and artifact selection. Against pinned main: production +7,057/-6,014 (+1,043); tests/support +1,202/-473 (+729); tooling and package/plugin build metadata +96/-16 (+80); docs +62/-3 (+59). Git rename detection discounts moves. The CI follow-up removes 19 net production lines. No generated output, proof media, or changelog changes are committed.
Source replay:
Built replay:
Native successful catalog flow (separate Gateway and recorder):
attachment-3872254697.webm