@@ -26,6 +26,7 @@ const RUNTIME_CONFIG_OPTION_ALIASES = {
2626 thinking : [ "thinking" , "effort" , "reasoning_effort" , "thought_level" ] ,
2727 permissionProfile : [ "approval_policy" , "permission_profile" , "permissions" , "permission_mode" ] ,
2828 timeoutSeconds : [ "timeout" , "timeout_seconds" ] ,
29+ fastMode : [ "fast_mode" , "fast-mode" , "fastMode" ] ,
2930} as const ;
3031
3132function failInvalidOption ( message : string ) : never {
@@ -167,6 +168,7 @@ export function validateRuntimeOptionPatch(
167168 "cwd" ,
168169 "permissionProfile" ,
169170 "timeoutSeconds" ,
171+ "fastMode" ,
170172 "backendExtras" ,
171173 ] ) ;
172174 for ( const key of Object . keys ( rawPatch ) ) {
@@ -218,6 +220,15 @@ export function validateRuntimeOptionPatch(
218220 next . timeoutSeconds = validateRuntimeTimeoutSecondsInput ( rawPatch . timeoutSeconds ) ;
219221 }
220222 }
223+ if ( Object . hasOwn ( rawPatch , "fastMode" ) ) {
224+ if ( rawPatch . fastMode === undefined ) {
225+ next . fastMode = undefined ;
226+ } else if ( typeof rawPatch . fastMode === "boolean" ) {
227+ next . fastMode = rawPatch . fastMode ;
228+ } else {
229+ failInvalidOption ( "Fast mode must be a boolean." ) ;
230+ }
231+ }
221232 if ( Object . hasOwn ( rawPatch , "backendExtras" ) ) {
222233 const rawExtras = rawPatch . backendExtras ;
223234 if ( rawExtras === undefined ) {
@@ -268,6 +279,7 @@ export function normalizeRuntimeOptions(
268279 ...( cwd ? { cwd } : { } ) ,
269280 ...( permissionProfile ? { permissionProfile } : { } ) ,
270281 ...( typeof timeoutSeconds === "number" ? { timeoutSeconds } : { } ) ,
282+ ...( typeof options ?. fastMode === "boolean" ? { fastMode : options . fastMode } : { } ) ,
271283 ...( backendExtras ? { backendExtras } : { } ) ,
272284 } ;
273285}
@@ -318,6 +330,7 @@ export function buildRuntimeControlSignature(options: AcpSessionRuntimeOptions):
318330 thinking : normalized . thinking ?? null ,
319331 permissionProfile : normalized . permissionProfile ?? null ,
320332 timeoutSeconds : normalized . timeoutSeconds ?? null ,
333+ fastMode : normalized . fastMode ?? null ,
321334 backendExtras : extras ,
322335 } ) ;
323336}
@@ -352,6 +365,12 @@ export function buildRuntimeConfigOptionPairs(
352365 String ( normalized . timeoutSeconds ) ,
353366 ) ;
354367 }
368+ if ( typeof normalized . fastMode === "boolean" ) {
369+ pairs . set (
370+ resolveRuntimeConfigOptionKey ( "fast_mode" , advertisedConfigOptionKeys ) ,
371+ String ( normalized . fastMode ) ,
372+ ) ;
373+ }
355374 for ( const [ key , value ] of Object . entries ( normalized . backendExtras ?? { } ) ) {
356375 const wireKey = resolveRuntimeConfigOptionKey ( key , advertisedConfigOptionKeys ) ;
357376 if ( ! pairs . has ( wireKey ) ) {
@@ -446,6 +465,13 @@ export function inferRuntimeOptionPatchFromConfigOption(
446465 if ( normalizedKey === "timeout" || normalizedKey === "timeout_seconds" ) {
447466 return { timeoutSeconds : parseRuntimeTimeoutSecondsInput ( validated . value ) } ;
448467 }
468+ if (
469+ normalizedKey === "fast_mode" ||
470+ normalizedKey === "fast-mode" ||
471+ normalizedKey === "fastmode"
472+ ) {
473+ return { fastMode : normalizeLowercaseStringOrEmpty ( validated . value ) === "true" } ;
474+ }
449475 if ( normalizedKey === "cwd" ) {
450476 return { cwd : validateRuntimeCwdInput ( validated . value ) } ;
451477 }
0 commit comments