fix(core): Request helper function support setting agentOptions#28756
Merged
fix(core): Request helper function support setting agentOptions#28756
Conversation
Bundle ReportBundle size has no change ✅ Affected Assets, Files, and Routes:view changes for bundle: editor-ui-esmAssets Changed:
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
No issues found across 3 files
Architecture diagram
sequenceDiagram
participant Node as Node / Credential Logic
participant Helper as Request Helper Functions
participant Converter as convertN8nRequestToAxios
participant Axios as Axios Client
participant Agent as HttpsAgent (Node.js)
participant Target as External API
Note over Node,Target: Request Flow with Custom TLS Options
Node->>Helper: httpRequest(options)
Note right of Node: options may include NEW: agentOptions<br/>(e.g., CA, Cert, Key)
Helper->>Converter: convertN8nRequestToAxios(n8nRequest)
Converter->>Converter: Get host from URL
rect rgb(240, 240, 240)
Note over Converter: Configuration Logic
Converter->>Converter: NEW: Spread n8nRequest.agentOptions into local agentOptions
Converter->>Converter: Set servername from host
opt skipSslCertificateValidation is true
Converter->>Converter: Set rejectUnauthorized = false
end
end
Converter->>Agent: NEW: Instantiate HttpsAgent(agentOptions)
Converter-->>Helper: axiosConfig (includes httpsAgent)
Helper->>Axios: request(axiosConfig)
Axios->>Agent: Use for connection
Agent->>Target: TLS Handshake (using custom mTLS/CA)
Target-->>Axios: Response
Axios-->>Helper: Response data
Helper-->>Node: Response data
Contributor
Performance ComparisonComparing current → latest master → 14-day baseline Idle baseline with Instance AI module loaded
Memory consumption baseline with starter plan resources
docker-stats
How to read this table
|
elsmr
previously approved these changes
Apr 22, 2026
Merging this PR will not alter performance
Comparing Footnotes
|
changed agentOptions?: AgentOptions to agentOptions?: Omit<AgentOptions, 'socket'> in interfaces.ts:518. The socket?: Duplex property on Node.js's AgentOptions caused the chain failure: Duplex.errored → Error | null → Error.cause: unknown → _DeepPartial<unknown> which TypeScript can't resolve in Pinia's store. Since socket is not a serializable config property and is never set via IHttpRequestOptions, omitting it from the interface type is the correct fix. The behavior at runtime is unchanged because the actual spread in request-helper-functions.ts:544 never involves a socket.
elsmr
approved these changes
Apr 23, 2026
Merged
Contributor
|
Got released with |
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.
Summary
Allow setting agentOptions in request-helper-functions, e.g. to set mTLS certificates when developing nodes/credentials.
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)