Move orchestration ID logic to constructor for efficiency

Co-authored-by: TingluoHuang <[email protected]>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-06 17:30:28 +00:00
co-authored by TingluoHuang
parent 1dc58e3080
commit af6de2cb95
+3 -2
View File
@@ -148,6 +148,8 @@ export class HttpClient {
requestOptions?: ifm.RequestOptions requestOptions?: ifm.RequestOptions
) { ) {
this.userAgent = userAgent this.userAgent = userAgent
? this._getUserAgentWithOrchestrationId(userAgent)
: undefined
this.handlers = handlers || [] this.handlers = handlers || []
this.requestOptions = requestOptions this.requestOptions = requestOptions
if (requestOptions) { if (requestOptions) {
@@ -599,8 +601,7 @@ export class HttpClient {
info.options.method = method info.options.method = method
info.options.headers = this._mergeHeaders(headers) info.options.headers = this._mergeHeaders(headers)
if (this.userAgent != null) { if (this.userAgent != null) {
info.options.headers['user-agent'] = info.options.headers['user-agent'] = this.userAgent
this._getUserAgentWithOrchestrationId(this.userAgent)
} }
info.options.agent = this._getAgent(info.parsedUrl) info.options.agent = this._getAgent(info.parsedUrl)