@@ -107,47 +107,7 @@ describe('Approval Events', () => {
107107 await promptPromise ;
108108 } ) ;
109109
110- it ( 'should map available execpolicy amendment approval to Codex decision' , async ( ) => {
111- const { promptPromise, completeTurn } = setupSessionWithPendingPrompt ( ) ;
112- const execpolicyAmendment = [ 'env' , 'GRADLE_USER_HOME=/workspace/.gradle-home' , './gradlew' , 'build' ] ;
113- fixture . setPermissionResponse ( {
114- outcome : { outcome : 'selected' , optionId : 'allow_command_prefix_rule' }
115- } ) ;
116-
117- const params : CommandExecutionRequestApprovalParams = {
118- threadId : sessionId ,
119- turnId : 'turn-1' ,
120- itemId : 'item-prefix-rule' ,
121- reason : 'Build the project' ,
122- proposedExecpolicyAmendment : [ 'ignored-fallback' ] ,
123- availableDecisions : [
124- 'accept' ,
125- { acceptWithExecpolicyAmendment : { execpolicy_amendment : execpolicyAmendment } } ,
126- 'decline' ,
127- ] ,
128- } ;
129-
130- const response = await fixture . sendServerRequest (
131- 'item/commandExecution/requestApproval' ,
132- params
133- ) ;
134-
135- expect ( response ) . toEqual ( {
136- decision : {
137- acceptWithExecpolicyAmendment : {
138- execpolicy_amendment : execpolicyAmendment ,
139- } ,
140- } ,
141- } ) ;
142- await expect ( fixture . getAcpConnectionDump ( [ '_meta' ] ) ) . toMatchFileSnapshot (
143- 'data/approval-command-prefix-rule.json'
144- ) ;
145-
146- completeTurn ( ) ;
147- await promptPromise ;
148- } ) ;
149-
150- it ( 'should add fallback execpolicy amendment option when availableDecisions is absent' , async ( ) => {
110+ it ( 'should map execpolicy amendment approval to Codex decision' , async ( ) => {
151111 const { promptPromise, completeTurn } = setupSessionWithPendingPrompt ( ) ;
152112 const execpolicyAmendment = [ 'npm' , 'run' ] ;
153113 fixture . setPermissionResponse ( {
@@ -179,34 +139,6 @@ describe('Approval Events', () => {
179139 await promptPromise ;
180140 } ) ;
181141
182- it ( 'should respect availableDecisions when prefix-rule approval is omitted' , async ( ) => {
183- const { promptPromise, completeTurn } = setupSessionWithPendingPrompt ( ) ;
184- fixture . setPermissionResponse ( {
185- outcome : { outcome : 'selected' , optionId : 'allow_once' }
186- } ) ;
187-
188- const params : CommandExecutionRequestApprovalParams = {
189- threadId : sessionId ,
190- turnId : 'turn-1' ,
191- itemId : 'item-no-prefix-rule' ,
192- reason : 'Run exact command only' ,
193- proposedExecpolicyAmendment : [ 'npm' , 'run' ] ,
194- availableDecisions : [ 'accept' , 'decline' ] ,
195- } ;
196-
197- await fixture . sendServerRequest (
198- 'item/commandExecution/requestApproval' ,
199- params
200- ) ;
201-
202- await expect ( fixture . getAcpConnectionDump ( [ '_meta' ] ) ) . toMatchFileSnapshot (
203- 'data/approval-command-available-decisions-without-prefix.json'
204- ) ;
205-
206- completeTurn ( ) ;
207- await promptPromise ;
208- } ) ;
209-
210142 it ( 'should map network policy amendment approval to Codex decision' , async ( ) => {
211143 const { promptPromise, completeTurn } = setupSessionWithPendingPrompt ( ) ;
212144 const networkPolicyAmendment = { host : 'registry.npmjs.org' , action : 'allow' } as const ;
@@ -220,11 +152,7 @@ describe('Approval Events', () => {
220152 itemId : 'item-network-policy' ,
221153 reason : 'Allow network access' ,
222154 proposedExecpolicyAmendment : null ,
223- availableDecisions : [
224- 'accept' ,
225- { applyNetworkPolicyAmendment : { network_policy_amendment : networkPolicyAmendment } } ,
226- 'cancel' ,
227- ] ,
155+ proposedNetworkPolicyAmendments : [ networkPolicyAmendment ] ,
228156 } ;
229157
230158 const response = await fixture . sendServerRequest (
@@ -247,32 +175,6 @@ describe('Approval Events', () => {
247175 await promptPromise ;
248176 } ) ;
249177
250- it ( 'should map explicit cancel option to cancel when advertised' , async ( ) => {
251- const { promptPromise, completeTurn } = setupSessionWithPendingPrompt ( ) ;
252- fixture . setPermissionResponse ( {
253- outcome : { outcome : 'selected' , optionId : 'cancel' }
254- } ) ;
255-
256- const params : CommandExecutionRequestApprovalParams = {
257- threadId : sessionId ,
258- turnId : 'turn-1' ,
259- itemId : 'item-explicit-cancel' ,
260- reason : 'Test command' ,
261- proposedExecpolicyAmendment : null ,
262- availableDecisions : [ 'accept' , 'cancel' ] ,
263- } ;
264-
265- const response = await fixture . sendServerRequest (
266- 'item/commandExecution/requestApproval' ,
267- params
268- ) ;
269-
270- expect ( response ) . toEqual ( { decision : 'cancel' } ) ;
271-
272- completeTurn ( ) ;
273- await promptPromise ;
274- } ) ;
275-
276178 it ( 'should return cancel when no handler registered' , async ( ) => {
277179 const params : CommandExecutionRequestApprovalParams = {
278180 threadId : 'non-existent-session' ,
0 commit comments