cliclaw 1.0.39 → 1.0.41

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cliclaw",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "description": "Telegram bot bridging AI CLIs (Claude Code, Codex) to Forum Topics",
5
5
  "main": "index.ts",
6
6
  "scripts": {
@@ -138,7 +138,8 @@ function handleProtoEvent(ps: ProtoSession, obj: any) {
138
138
 
139
139
  const respond = (decision: string) => {
140
140
  if (decision === 'approved_for_session') ps.sessionApproved = true
141
- const op: Record<string, unknown> = { type: 'exec_approval', id: approvalId, decision }
141
+ // Codex looks up pending approvals by op.sub_id; op.id is the outer correlation UUID
142
+ const op: Record<string, unknown> = { type: 'exec_approval', id: msgId, sub_id: approvalId, decision }
142
143
  if (turnId) op.turn_id = turnId
143
144
  console.log(`[Codex approval] enviando: ${JSON.stringify({ id: '...', op })}`)
144
145
  try {
@@ -158,7 +159,7 @@ function handleProtoEvent(ps: ProtoSession, obj: any) {
158
159
 
159
160
  if (ps.approvalHandler) {
160
161
  console.log(`[Codex approval] aguardando usuário via Telegram...`)
161
- ps.approvalHandler(subId, commandStr)
162
+ ps.approvalHandler(approvalId, commandStr)
162
163
  .then(respond)
163
164
  .catch((e: any) => {
164
165
  console.error(`[Codex approval] handler error: ${e?.message} — negando`)