From 4777b1b6f67bc2ba6d3fc6d3cc93d6b352d596e5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 6 Jan 2026 17:30:28 +0000 Subject: [PATCH] Move orchestration ID logic to constructor for efficiency Co-authored-by: TingluoHuang <1750815+TingluoHuang@users.noreply.github.com> --- src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index d216277..d3c2c95 100644 --- a/src/index.ts +++ b/src/index.ts @@ -148,6 +148,8 @@ export class HttpClient { requestOptions?: ifm.RequestOptions ) { this.userAgent = userAgent + ? this._getUserAgentWithOrchestrationId(userAgent) + : undefined this.handlers = handlers || [] this.requestOptions = requestOptions if (requestOptions) { @@ -599,8 +601,7 @@ export class HttpClient { info.options.method = method info.options.headers = this._mergeHeaders(headers) if (this.userAgent != null) { - info.options.headers['user-agent'] = - this._getUserAgentWithOrchestrationId(this.userAgent) + info.options.headers['user-agent'] = this.userAgent } info.options.agent = this._getAgent(info.parsedUrl)