Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"eslint-plugin-jest": "^29.0.0",
"eslint-plugin-jsdoc": "^48.11.0",
"execa": "^4.0.0",
"jest": "^29.6.2",
"jest": "^29.7.0",
"jest-junit": "^16.0.0",
"neostandard": "^0",
"oclif": "^4.0.0",
Expand Down
13 changes: 13 additions & 0 deletions src/RuntimeBaseCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,19 @@ class RuntimeBaseCommand extends Command {
} else if (flags.debug) {
createDebug.enable(flags.debug)
}

// set User-Agent for runtime calls
// ex. aio-cli-plugin-runtime/@adobe/aio-cli/10.3.1 (darwin-arm64; node-v18.20.4; zsh)

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example UA in the comment doesn’t match what the code generates (example includes @adobe/aio-cli/... and a node-v... format, while the actual string is aio-cli-plugin-runtime/${vs?.cliVersion} (...)). Update the comment to reflect the real output so it stays useful as documentation.

Suggested change
// ex. aio-cli-plugin-runtime/@adobe/aio-cli/10.3.1 (darwin-arm64; node-v18.20.4; zsh)
// ex. aio-cli-plugin-runtime/10.3.1 (darwin-arm64; 18.20.4; zsh)

Copilot uses AI. Check for mistakes.
const vs = this.config.versionDetails
const baseUserAgent = `aio-cli-plugin-runtime/${vs?.cliVersion || 'unknown'}`
const userAgentDetails = [vs?.architecture, vs?.nodeVersion, vs?.shell]
.filter(detail => typeof detail === 'string' && detail.trim())
// console.log('init ', this.config.versionDetails)
process.env.__OW_USER_AGENT = userAgentDetails.length > 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented-out console.log debug statement should be removed before merging to keep the code clean.

? `${baseUserAgent} (${userAgentDetails.join('; ')})`
: baseUserAgent

debug('init ', process.env.__OW_USER_AGENT)
Comment on lines +89 to +100

Copilot AI Apr 16, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New user-agent construction in init() isn’t asserted in unit tests (e.g., does not override a pre-set __OW_USER_AGENT, honors --useragent, and produces a string without "undefined" parts). Adding focused tests here would prevent regressions and clarify the intended precedence rules.

Copilot uses AI. Check for mistakes.
}

async handleError (msg, err) {
Expand Down
Loading