feat(server-utils): Migrate OpenAI integration to orchestrion#21877
feat(server-utils): Migrate OpenAI integration to orchestrion#21877nicohrubec wants to merge 7 commits into
Conversation
b53ebd6 to
8149b88
Compare
size-limit report 📦
|
e03ecce to
856774b
Compare
| mysqlChannelIntegration(), | ||
| lruMemoizerChannelIntegration(), | ||
| openaiChannelIntegration(), | ||
| ] as const; |
There was a problem hiding this comment.
Integration options dropped on swap
Medium Severity
With diagnostics-channel injection enabled, default integrations drop the OTel OpenAI integration and append openaiChannelIntegration() with no options. Any recordInputs, recordOutputs, or enableTruncation passed to openAIIntegration(...) are ignored unless the same values are set via dataCollection.genAI or a manually configured channel integration.
Reviewed by Cursor Bugbot for commit 856774b. Configure here.
There was a problem hiding this comment.
I think this is fine. Users can still configure this using the global dataCollection object and the integration itself is already configurable so once this is the default this should work again
856774b to
bf560d7
Compare
Add a diagnostics-channel (orchestrion) instrumentation path for `chat.completions.create` (non-streaming) alongside the existing proxy/OTel path. Reuses the core attribute helpers and `bindTracingChannelToSpan`; the browser/edge keep the proxy `instrumentOpenAiClient`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
c758392 to
127e3b2
Compare
127e3b2 to
c9ec0e1
Compare
Adds a diagnostics-channel (orchestrion) path for non-streaming `responses.create`, alongside the existing `chat.completions.create`. Reuses the shared core attribute helpers (responses shape already handled) and generalizes the subscriber to a per-channel operation table. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds a diagnostics-channel path for `embeddings.create` (operation `embeddings`), reusing the shared core attribute helpers and the per-channel operation table. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds a diagnostics-channel path for `conversations.create`, reusing the shared core attribute helpers (conversation-id capture) and the per-channel operation table. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Instruments streaming `chat.completions.create` / `responses.create` by patching the returned `Stream`'s async iterator in place (via `bindTracingChannelToSpan`'s `deferSpanEnd`) so the reused `instrumentStream` accumulates chunk state and ends the span when iteration completes. Exports `instrumentStream` from core. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9ca6a54. Configure here.


Adds an orchestrion based OpenAI integration to server-utils, covering all the APIs and both streaming and non-streaming mode. Leaves the core integration intact and only exports the necessary utils that are needed for the orchestrion integration.