@@ -35,6 +35,7 @@ import {
3535 partListUnionToString ,
3636 LlmRole ,
3737 ApprovalMode ,
38+ checkExhaustive ,
3839 getVersion ,
3940 convertSessionToClientHistory ,
4041 DEFAULT_GEMINI_MODEL ,
@@ -1080,7 +1081,7 @@ export class Session {
10801081
10811082 await confirmationDetails . onConfirm (
10821083 ToolConfirmationOutcome . ProceedOnce ,
1083- mapExitPlanModeAnswers ( output . answers ?? { } ) ,
1084+ mapExitPlanModeAnswers ( output . answers ) ,
10841085 ) ;
10851086 return ToolConfirmationOutcome . ProceedOnce ;
10861087 }
@@ -2066,11 +2067,11 @@ function toPermissionOptions(
20662067 break ;
20672068 case 'ask_user' :
20682069 case 'exit_plan_mode' :
2070+ case 'sandbox_expansion' :
20692071 // askuser and exit_plan_mode don't need "always allow" options
20702072 break ;
20712073 default :
2072- // No "always allow" options for other types.
2073- break ;
2074+ return checkExhaustive ( confirmation ) ;
20742075 }
20752076 }
20762077
@@ -2087,18 +2088,12 @@ function toPermissionOptions(
20872088 case 'sandbox_expansion' :
20882089 break ;
20892090 default :
2090- return assertUnreachableConfirmation ( confirmation ) ;
2091+ return checkExhaustive ( confirmation ) ;
20912092 }
20922093
20932094 return options ;
20942095}
20952096
2096- function assertUnreachableConfirmation ( value : never ) : never {
2097- throw new Error (
2098- `Unhandled tool confirmation details: ${ JSON . stringify ( value ) } ` ,
2099- ) ;
2100- }
2101-
21022097/**
21032098 * Maps our internal tool kind to the ACP ToolKind.
21042099 * Fallback to 'other' for kinds that are not supported by the ACP protocol.
0 commit comments