@@ -35,7 +35,7 @@ import type {
3535} from '@agent-device/contracts/client' ;
3636import { tryRunClientBackedCommand } from './cli/commands/router.ts' ;
3737import { runAgentCdpCommand } from './cli/commands/agent-cdp.ts' ;
38- import { readCliBatchStepsJson } from '@agent-device/command-surface' ;
38+ import { getCommandSchema , readCliBatchStepsJson } from '@agent-device/command-surface' ;
3939import {
4040 createRequestId ,
4141 emitDiagnostic ,
@@ -365,14 +365,17 @@ async function resolveRunContextOrExit(
365365 configuredPlatform : parsed . flags . platform ,
366366 configuredSession : parsed . flags . session ,
367367 } ) ;
368- const flags = binding . lockPolicy
369- ? { ...parsed . flags }
370- : applyDefaultPlatformBinding ( parsed . flags , {
371- env : base . host . env ,
372- policyOverrides : parsed . flags ,
373- configuredPlatform : parsed . flags . platform ,
374- configuredSession : parsed . flags . session ,
375- } ) ;
368+ const skipPlatformDefault =
369+ getCommandSchema ( base . command ) ?. explicitOnlyFlags ?. includes ( 'platform' ) === true ;
370+ const flags =
371+ binding . lockPolicy || skipPlatformDefault
372+ ? { ...parsed . flags }
373+ : applyDefaultPlatformBinding ( parsed . flags , {
374+ env : base . host . env ,
375+ policyOverrides : parsed . flags ,
376+ configuredPlatform : parsed . flags . platform ,
377+ configuredSession : parsed . flags . session ,
378+ } ) ;
376379 // A leased remote config, or a connect without one (it always leases through a provider), needs
377380 // an explicit session before anything is resolved or leased (#3931).
378381 const leasedConnect = base . command === 'connect' && ! flags . remoteConfig ;
@@ -785,6 +788,7 @@ function resolveActiveConnectionDefaults(options: {
785788 options . command === 'connection' ||
786789 options . command === 'daemon' ||
787790 options . command === 'plugins' ||
791+ options . command === 'device' ||
788792 options . command === 'proxy'
789793 ) {
790794 return null ;
0 commit comments