2727 * a directory name under `$DSH_HOME/acp-sessions/<project>/` — and `--cwd` must
2828 * name the workspace it was created in.
2929 *
30- * Usage: `node scripts/smoke.mjs [--mode code] [--load <id>] [--prompt "…"] [--reject] [--cancel-after 3000]`
30+ * Usage: `node scripts/smoke.mjs [--mode code] [--model deepseek-official/deepseek-v4]
31+ * [--load <id>] [--prompt "…"] [--reject] [--cancel-after 3000]`
3132 */
3233
3334import { spawn } from 'node:child_process'
@@ -45,6 +46,7 @@ const { values } = parseArgs({
4546 prompt : { type : 'string' } ,
4647 load : { type : 'string' } ,
4748 mode : { type : 'string' } ,
49+ model : { type : 'string' } ,
4850 profile : { type : 'string' } ,
4951 cwd : { type : 'string' } ,
5052 reject : { type : 'boolean' } ,
@@ -99,8 +101,13 @@ function describe(update) {
99101function describeOptions ( configOptions ) {
100102 if ( configOptions === undefined || configOptions . length === 0 ) return '(none)'
101103 return configOptions . map ( option => {
104+ // A select's values are either flat or grouped by provider; a picker
105+ // renders both as one list, so this flattens the grouped form too.
102106 const values = option . type === 'select'
103- ? option . options . map ( value => ( value . value === option . currentValue ? `[${ value . value } ]` : value . value ) ) . join ( ' ' )
107+ ? option . options
108+ . flatMap ( entry => ( entry . options === undefined ? [ entry ] : entry . options ) )
109+ . map ( value => ( value . value === option . currentValue ? `[${ value . value } ]` : value . value ) )
110+ . join ( ' ' )
104111 : String ( option . currentValue )
105112 return `${ option . id } (${ option . category ?? '-' } ): ${ values } `
106113 } ) . join ( ' | ' )
@@ -133,7 +140,7 @@ try {
133140 : { sessionId : values . load , ...await client . loadSession ( { sessionId : values . load , cwd : WORKSPACE , mcpServers : [ ] } ) }
134141 const sessionId = session . sessionId
135142 process . stdout . write ( `${ values . load === undefined ? 'newSession' : 'loadSession' } : ${ sessionId } \n` )
136- process . stdout . write ( `modes : ${ describeOptions ( session . configOptions ) } \n` )
143+ process . stdout . write ( `options : ${ describeOptions ( session . configOptions ) } \n` )
137144
138145 if ( values . mode !== undefined ) {
139146 const switched = await client . setSessionConfigOption ( {
@@ -144,6 +151,17 @@ try {
144151 process . stdout . write ( `mode ${ values . mode } : ${ describeOptions ( switched . configOptions ) } \n` )
145152 }
146153
154+ // `--model provider/model` is the composer's model dropdown: unlike the mode
155+ // it stays live for the whole session, so this can follow a prompt too.
156+ if ( values . model !== undefined ) {
157+ const switched = await client . setSessionConfigOption ( {
158+ sessionId,
159+ configId : 'model' ,
160+ value : values . model ,
161+ } )
162+ process . stdout . write ( `model ${ values . model } : ${ describeOptions ( switched . configOptions ) } \n` )
163+ }
164+
147165 if ( values . prompt !== undefined ) {
148166 const pending = client . prompt ( { sessionId, prompt : [ { type : 'text' , text : values . prompt } ] } )
149167 if ( values [ 'cancel-after' ] !== undefined ) {
0 commit comments