Skip to content

Commit 3778a64

Browse files
committed
feat(dlx): pass SOCKET_CALLER_USER_AGENT when spawning coana
Adds the CLI's full user agent string to the env vars forwarded to the coana subprocess. Coana reads SOCKET_CALLER_USER_AGENT and appends it to its own base UA, producing a chain like: coana-tech-cli/15.3.0 node/v22.0.0 linux/arm64 socket/1.1.96 node/v22.0.0 linux/arm64
1 parent 49eeea3 commit 3778a64

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/utils/dlx.mts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import constants, {
3333
} from '../constants.mts'
3434
import { getErrorCause } from './errors.mts'
3535
import { findUp } from './fs.mts'
36-
import { getDefaultApiToken, getDefaultProxyUrl } from './sdk.mts'
36+
import { getCliUserAgent, getDefaultApiToken, getDefaultProxyUrl } from './sdk.mts'
3737
import { isYarnBerry } from './yarn-version.mts'
3838

3939
import type { ShadowBinOptions, ShadowBinResult } from '../shadow/npm-base.mts'
@@ -207,6 +207,8 @@ export async function spawnCoanaDlx(
207207

208208
const mixinsEnv: Record<string, string> = {
209209
SOCKET_CLI_VERSION: constants.ENV.INLINED_SOCKET_CLI_VERSION,
210+
// Pass the CLI's full user agent so coana can append it to its own UA.
211+
SOCKET_CALLER_USER_AGENT: getCliUserAgent(),
210212
}
211213
const defaultApiToken = getDefaultApiToken()
212214
if (defaultApiToken) {

0 commit comments

Comments
 (0)