fix(core): Support streamed reasoning from custom AI endpoints (no-changelog) - #37875
fix(core): Support streamed reasoning from custom AI endpoints (no-changelog)#37875Ryner01 wants to merge 1 commit into
Conversation
PR review overviewBased on ownership of the 5 changed files in this PR:
|
There was a problem hiding this comment.
1 issue found across 5 files
Confidence score: 4/5
- In
packages/@n8n/agents/src/runtime/__tests__/model-factory.test.ts, the Backend regression test bypassescreateModel, so it can pass without verifying that custom endpoints reach the compatible provider; update it to exercisecreateModeland assert the resulting routing.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/@n8n/agents/src/runtime/__tests__/model-factory.test.ts">
<violation number="1" location="packages/@n8n/agents/src/runtime/__tests__/model-factory.test.ts:890">
P2: Custom agent: **Backend**
This regression test bypasses `createModel`, so it does not verify that custom endpoints reach the compatible provider. The test still passes if the n8n registry routes the endpoint through the old provider; exercise `createModel({ id: 'custom/<model>', baseURL, apiKey })` and stream through the returned model.</violation>
</file>
Shadow auto-approve: would not auto-approve because issues were found.
Fix all with cubic | Re-trigger cubic
| expectedDeltas: [{ type: 'text-delta', id: 'txt-0', delta: 'The answer is 391.' }], | ||
| }, | ||
| ])('$name', async ({ content, expectedDeltas }) => { | ||
| const { createOpenAICompatible } = await vi.importActual< |
There was a problem hiding this comment.
P2: Custom agent: Backend
This regression test bypasses createModel, so it does not verify that custom endpoints reach the compatible provider. The test still passes if the n8n registry routes the endpoint through the old provider; exercise createModel({ id: 'custom/<model>', baseURL, apiKey }) and stream through the returned model.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/@n8n/agents/src/runtime/__tests__/model-factory.test.ts, line 890:
<comment>This regression test bypasses `createModel`, so it does not verify that custom endpoints reach the compatible provider. The test still passes if the n8n registry routes the endpoint through the old provider; exercise `createModel({ id: 'custom/<model>', baseURL, apiKey })` and stream through the returned model.</comment>
<file context>
@@ -864,6 +864,80 @@ describe('createModel', () => {
+ expectedDeltas: [{ type: 'text-delta', id: 'txt-0', delta: 'The answer is 391.' }],
+ },
+ ])('$name', async ({ content, expectedDeltas }) => {
+ const { createOpenAICompatible } = await vi.importActual<
+ typeof import('@ai-sdk/openai-compatible')
+ >('@ai-sdk/openai-compatible');
</file context>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Instance AI Discovery Eval ✅Branch: Eval output |
Summary
Route custom OpenAI-compatible endpoints through the compatible provider. This lets Instance AI process streams that contain reasoning and text parts.
How to test
Related Linear tickets, Github issues, and Community forum posts
Review / Merge checklist
Backport to Beta,Backport to Stable, orBackport to v1(if the PR is an urgent fix that needs to be backported)🤖 PR Summary generated by AI