docs: add OpenClaw patch inventory and patch-script skeletons / 補 OpenClaw patch inventory 與 apply/rollback 骨架
This commit is contained in:
82
reports/openclaw-patch-inventory.md
Normal file
82
reports/openclaw-patch-inventory.md
Normal file
@@ -0,0 +1,82 @@
|
||||
# OpenClaw Patch Inventory (PoC)
|
||||
|
||||
## Purpose
|
||||
|
||||
This file records the exact runtime modifications currently used to make the Telegram + OpenClaw reply-end-controls PoC work inside `openclawtest`.
|
||||
|
||||
It is not the final architecture.
|
||||
|
||||
It exists so the current PoC does not depend on vague memory or hand-wavy descriptions.
|
||||
|
||||
## Environment
|
||||
|
||||
- User: `openclawtest`
|
||||
- OpenClaw install root:
|
||||
- `/home/openclawtest/.nvm/versions/node/v22.22.2/lib/node_modules/openclaw/dist`
|
||||
|
||||
## Patched runtime files
|
||||
|
||||
### 1. `send-sxDwUGaO.js`
|
||||
|
||||
Purpose:
|
||||
|
||||
- inject default Telegram inline buttons into assistant replies for PoC validation
|
||||
|
||||
Observed patch point:
|
||||
|
||||
- line containing:
|
||||
- `buildInlineKeyboard(opts.buttons ?? [[{ text: "A. 繼續", callback_data: "rec:continue" }, { text: "B. 就這樣吧,不需要額外處理", callback_data: "rec:stop" }]])`
|
||||
|
||||
What it changes:
|
||||
|
||||
- if no explicit Telegram buttons are supplied, PoC default reply-end buttons are attached
|
||||
|
||||
### 2. `bot-Ce301bOE.js`
|
||||
|
||||
Purpose:
|
||||
|
||||
- handle reply-end callback data
|
||||
- persist callback choice
|
||||
- visibly update buttons
|
||||
- send callback acknowledgement
|
||||
- read stop state on later inbound messages and suppress proactive continuation behavior
|
||||
|
||||
Observed patch points:
|
||||
|
||||
- raw callback debug file path:
|
||||
- `reply-end-debug.log`
|
||||
- persisted state file path:
|
||||
- `reply-end-controls.json`
|
||||
- callback click handling:
|
||||
- `reply-end-controls: ${choice} clicked ...`
|
||||
- resolved button states:
|
||||
- `✅ A. 繼續`
|
||||
- `⏹ B. 就這樣吧,不需要額外處理`
|
||||
- callback acknowledgement replies:
|
||||
- `reply-end-controls: continue received`
|
||||
- `reply-end-controls: stop received`
|
||||
- inbound stop-state behavior injection:
|
||||
- if stored state for this chat is `stop`, append a strong system-style instruction before agent execution to suppress proactive continuation
|
||||
|
||||
## Persisted files created by the PoC
|
||||
|
||||
These are written under the OpenClaw state dir:
|
||||
|
||||
- `~/.openclaw/reply-end-debug.log`
|
||||
- `~/.openclaw/reply-end-controls.json`
|
||||
|
||||
## What this inventory is for
|
||||
|
||||
This inventory supports the next implementation phase:
|
||||
|
||||
- building a reproducible patch set
|
||||
- defining apply/rollback scripts
|
||||
- replacing direct runtime edits with a cleaner integration path
|
||||
|
||||
## What this inventory is not
|
||||
|
||||
- not a production implementation guide
|
||||
- not a stable plugin API
|
||||
- not a guarantee that these exact line offsets will survive OpenClaw upgrades
|
||||
|
||||
The purpose is simply to capture what currently makes the PoC work.
|
||||
Reference in New Issue
Block a user