refactor(ai): activate the Vercel AI SDK through Orchestrion #11316
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 200 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.317
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #11316"
general
weight: 0.35
rochdev
What does this PR do?
Migrates the
aiintegration to Orchestrion setup and removes the module-load hooks. Setup registers subscribers synchronously before plugin activation, once per process, without loading the SDK. The v7 stream observer still attaches throughpipeThroughwithout replacingctx.result.stream.Motivation
Revisits #10712 using the current activation and bundler rewrite paths. Published v4–v6 CommonJS and ESM entry points, and v7’s shared ESM entry point, all produce real rewrites. No fallback hook is needed.
Additional Notes
Regression tests use real SDK entry points to verify first-call tracing, subscriber deduplication, model interception, and v7 chunk and completion reporting. Webpack’s existing ESM limitation remains unchanged; the real-SDK webpack smoke test covers v6 CommonJS.
PLUGINS=ai npm run test:instrumentations: 23 passed each on Node 22.19.0 and 24.15.0; focused activation, rewriter, and bundler helper specs: 199 passed.PLUGINS=ai npm run test:plugins: 178 passed, 16 pending;PLUGINS=ai npm run test:llmobs:plugins: 298 passed, 56 pending.npm run test:aiguard: 446 passed;npm run test:integration:aiguard: 58 passed.npm run lintreported an OpenFeature fixture outside the test globs.