fix: include pre-answer callback debug in patch flow / 將 pre-answer callback debug 納入 patch 流程

This commit is contained in:
Alice (OpenClaw)
2026-05-13 17:34:12 +08:00
parent 9cbe51c575
commit 23f25f4339
3 changed files with 6 additions and 1 deletions

View File

@@ -45,6 +45,8 @@ Observed patch points:
- raw callback debug file path: - raw callback debug file path:
- `reply-end-debug.log` - `reply-end-debug.log`
- pre-answer callback debug write:
- `[pre-answer] ... data=...`
- persisted state file path: - persisted state file path:
- `reply-end-controls.json` - `reply-end-controls.json`
- callback click handling: - callback click handling:

View File

@@ -74,6 +74,8 @@ The project now has:
The apply/rollback flow has been validated against a pristine extracted `openclaw@2026.5.7` package. The apply/rollback flow has been validated against a pristine extracted `openclaw@2026.5.7` package.
The live acceptance loop has also shown why observability matters: a pre-answer callback debug write was needed to separate Telegram callback ingress from later acknowledgement failures. That instrumentation is now part of the current PoC patch flow.
## What is still not pluginized enough ## What is still not pluginized enough
### 1. Live OpenClaw runtime still uses inline patch behavior ### 1. Live OpenClaw runtime still uses inline patch behavior

View File

@@ -53,8 +53,9 @@ if 'import fsSync from "node:fs";' not in bot_text:
old_raw = 'const data = (callback.data ?? "").trim();' old_raw = 'const data = (callback.data ?? "").trim();'
new_raw = '''const data = (callback.data ?? "").trim(); new_raw = '''const data = (callback.data ?? "").trim();
const replyEndDebugPath = path.join(process.env.OPENCLAW_STATE_DIR || path.join(process.env.HOME || "", ".openclaw"), "reply-end-debug.log"); const replyEndDebugPath = path.join(process.env.OPENCLAW_STATE_DIR || path.join(process.env.HOME || "", ".openclaw"), "reply-end-debug.log");
try { fsSync.appendFileSync(replyEndDebugPath, `[pre-answer] ${new Date().toISOString()} data=${data || "<empty>"}\n`); } catch {}
try { fsSync.appendFileSync(replyEndDebugPath, `[raw] ${new Date().toISOString()} data=${data || "<empty>"}\n`); } catch {}''' try { fsSync.appendFileSync(replyEndDebugPath, `[raw] ${new Date().toISOString()} data=${data || "<empty>"}\n`); } catch {}'''
if old_raw in bot_text and 'reply-end-debug.log' not in bot_text: if old_raw in bot_text and '[pre-answer]' not in bot_text:
bot_text = bot_text.replace(old_raw, new_raw, 1) bot_text = bot_text.replace(old_raw, new_raw, 1)
old_click = '''const chatId = callbackMessage.chat.id; old_click = '''const chatId = callbackMessage.chat.id;