@@ -13,11 +13,6 @@ import {logger} from "./Logger";
1313import { stripShellPrefix } from "./CodexEventHandler" ;
1414import { ApprovalOptionId } from "./ApprovalOptionId" ;
1515
16- const APPROVAL_OPTIONS : acp . PermissionOption [ ] = [
17- { optionId : ApprovalOptionId . AllowOnce , name : "Allow Once" , kind : "allow_once" } ,
18- { optionId : ApprovalOptionId . AllowForSession , name : "Allow for Session" , kind : "allow_always" } ,
19- { optionId : ApprovalOptionId . RejectOnce , name : "Reject" , kind : "reject_once" } ,
20- ] ;
2116
2217// Pair each displayed ACP option with the exact Codex decision it represents,
2318// so response conversion does not reconstruct decisions from labels or metadata.
@@ -98,7 +93,7 @@ export class CodexApprovalHandler implements ApprovalHandler {
9893 } else if ( typeof decision !== "string" && "applyNetworkPolicyAmendment" in decision ) {
9994 amendmentIndex = networkAmendmentCount ++ ;
10095 }
101- return this . convertCommandDecisionToOption ( decision , amendmentIndex ) ;
96+ return this . convertCommandDecisionToOption ( params , decision , amendmentIndex ) ;
10297 } ) ;
10398 }
10499
@@ -128,12 +123,17 @@ export class CodexApprovalHandler implements ApprovalHandler {
128123 }
129124
130125 private convertCommandDecisionToOption (
126+ params : CommandExecutionRequestApprovalParams ,
131127 decision : CommandExecutionApprovalDecision ,
132128 amendmentIndex : number
133129 ) : CommandDecisionOption {
134130 if ( decision === "accept" ) {
135131 return {
136- option : { optionId : ApprovalOptionId . AllowOnce , name : "Yes, proceed" , kind : "allow_once" } ,
132+ option : {
133+ optionId : ApprovalOptionId . AllowOnce ,
134+ name : params . networkApprovalContext ? "Yes, just this once" : "Yes, proceed" ,
135+ kind : "allow_once"
136+ } ,
137137 decision
138138 } ;
139139 }
@@ -142,7 +142,9 @@ export class CodexApprovalHandler implements ApprovalHandler {
142142 return {
143143 option : {
144144 optionId : ApprovalOptionId . AllowForSession ,
145- name : "Yes, and don't ask again for this exact command" ,
145+ name : params . networkApprovalContext
146+ ? "Yes, and allow this host for this conversation"
147+ : "Yes, and don't ask again for this command in this session" ,
146148 kind : "allow_always"
147149 } ,
148150 decision
@@ -211,8 +213,9 @@ export class CodexApprovalHandler implements ApprovalHandler {
211213 private networkPolicyApprovalLabel (
212214 amendment : { host : string ; action : "allow" | "deny" }
213215 ) : string {
214- const decision = amendment . action === "deny" ? "No" : "Yes" ;
215- return `${ decision } , and don't ask again for network access to \`${ amendment . host } \`` ;
216+ return amendment . action === "deny"
217+ ? "No, and block this host in the future"
218+ : "Yes, and allow this host in the future" ;
216219 }
217220
218221 // ACP responses only return the selected optionId. The network field is
@@ -248,7 +251,19 @@ export class CodexApprovalHandler implements ApprovalHandler {
248251 status : "pending" ,
249252 content : reasonContent ? [ reasonContent ] : null ,
250253 } ,
251- options : APPROVAL_OPTIONS ,
254+ options : [
255+ { optionId : ApprovalOptionId . AllowOnce , name : "Yes, proceed" , kind : "allow_once" } ,
256+ {
257+ optionId : ApprovalOptionId . AllowForSession ,
258+ name : "Yes, and don't ask again for these files" ,
259+ kind : "allow_always"
260+ } ,
261+ {
262+ optionId : ApprovalOptionId . RejectOnce ,
263+ name : "No, and tell Codex what to do differently" ,
264+ kind : "reject_once"
265+ } ,
266+ ] ,
252267 } ;
253268 }
254269
0 commit comments