cliclaw 1.0.36 → 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 +6 -9
package/package.json
CHANGED
package/src/agents/codex.ts
CHANGED
|
@@ -86,7 +86,9 @@ function startProto(appSessionId: string): ProtoSession {
|
|
|
86
86
|
try {
|
|
87
87
|
const obj = JSON.parse(line)
|
|
88
88
|
handleProtoEvent(ps, obj)
|
|
89
|
-
} catch {
|
|
89
|
+
} catch (e: any) {
|
|
90
|
+
console.error('[Codex proto] parse error:', e?.message, '| line:', line.slice(0, 120))
|
|
91
|
+
}
|
|
90
92
|
}
|
|
91
93
|
})
|
|
92
94
|
|
|
@@ -132,18 +134,13 @@ function handleProtoEvent(ps: ProtoSession, obj: any) {
|
|
|
132
134
|
const commandStr = formatApprovalCommand(msg.command ?? msg.cmd)
|
|
133
135
|
console.log(`[Codex approval] request recebido sub_id=${subId} cmd="${commandStr.slice(0, 80)}"`)
|
|
134
136
|
|
|
135
|
-
// Respond using the original message id so Codex can correlate the reply
|
|
136
137
|
const respond = (decision: string) => {
|
|
137
|
-
|
|
138
|
-
if (decision === 'approved_for_session') {
|
|
139
|
-
ps.sessionApproved = true
|
|
140
|
-
decision = 'approved'
|
|
141
|
-
}
|
|
138
|
+
if (decision === 'approved_for_session') ps.sessionApproved = true
|
|
142
139
|
console.log(`[Codex approval] enviando exec_approval sub_id=${subId} decision=${decision}`)
|
|
143
140
|
try {
|
|
144
141
|
ps.proc.stdin!.write(JSON.stringify({
|
|
145
|
-
id:
|
|
146
|
-
op: { type: 'exec_approval',
|
|
142
|
+
id: randomUUID(),
|
|
143
|
+
op: { type: 'exec_approval', id: subId, decision },
|
|
147
144
|
}) + '\n')
|
|
148
145
|
console.log(`[Codex approval] enviado ok`)
|
|
149
146
|
} catch (e: any) {
|