cliclaw 1.0.37 → 1.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/agents/codex.ts +3 -12
package/package.json
CHANGED
package/src/agents/codex.ts
CHANGED
|
@@ -134,22 +134,13 @@ function handleProtoEvent(ps: ProtoSession, obj: any) {
|
|
|
134
134
|
const commandStr = formatApprovalCommand(msg.command ?? msg.cmd)
|
|
135
135
|
console.log(`[Codex approval] request recebido sub_id=${subId} cmd="${commandStr.slice(0, 80)}"`)
|
|
136
136
|
|
|
137
|
-
// Codex uses JSON-RPC 2.0 with its own decision strings
|
|
138
|
-
const DECISION_MAP: Record<string, string> = {
|
|
139
|
-
approved: 'accept',
|
|
140
|
-
approved_for_session: 'acceptForSession',
|
|
141
|
-
denied: 'decline',
|
|
142
|
-
abort: 'cancel',
|
|
143
|
-
}
|
|
144
137
|
const respond = (decision: string) => {
|
|
145
138
|
if (decision === 'approved_for_session') ps.sessionApproved = true
|
|
146
|
-
|
|
147
|
-
console.log(`[Codex approval] enviando exec_approval id=${msgId} decision=${codexDecision}`)
|
|
139
|
+
console.log(`[Codex approval] enviando exec_approval sub_id=${subId} decision=${decision}`)
|
|
148
140
|
try {
|
|
149
141
|
ps.proc.stdin!.write(JSON.stringify({
|
|
150
|
-
|
|
151
|
-
id:
|
|
152
|
-
result: { decision: codexDecision },
|
|
142
|
+
id: randomUUID(),
|
|
143
|
+
op: { type: 'exec_approval', id: subId, decision },
|
|
153
144
|
}) + '\n')
|
|
154
145
|
console.log(`[Codex approval] enviado ok`)
|
|
155
146
|
} catch (e: any) {
|