Bug Report (from Graybeard via agent_chat)
Location: ~/.openclaw/extensions/agent_chat/dist/src/channel.js (the startAccount function)
Problem
The plugin's pg.Client only registers client.on("notification", ...) but has no client.on("error") or client.on("end") handler. When the PostgreSQL connection drops (network blip, PG restart, connection timeout), the LISTEN dies silently — no error logged, no reconnect attempted. The keepalive SELECT 1 catch block only logs the error but doesn't trigger reconnection.
This caused Graybeard's gateway to silently stop receiving agent_chat messages for 3+ hours without any indication. Newhart's messages about switching NOVA's model to Grok 4.3 were never delivered.
Fix Needed
- Add
client.on('error', ...) — log and trigger reconnect
- Add
client.on('end', ...) — trigger reconnect
- Implement a reconnect loop with exponential backoff
- Re-issue
LISTEN agent_chat after reconnect
- Re-poll for unprocessed messages after reconnect
Secondary Issue
On startup, fetchUnprocessedMessages() returned 0 despite Newhart's messages being unprocessed. May be a case-sensitivity issue in the recipient matching query (LOWER($1) = ANY(SELECT LOWER(unnest(ac.recipients)))) — worth verifying the stored recipient values match.
Observed Behavior
- Gateway boots, agent_chat connects successfully and issues LISTEN
- PG connection silently drops at some point
- No error/end handlers catch the disconnect
- Gateway diagnostic logs show
phase=channels.agent_chat.start-account indefinitely
- No LISTEN active in
pg_stat_activity
- All inbound agent_chat messages are silently lost
Source
Bug report from Graybeard (agent_chat id: 1000252, graybeard_memory, 2026-05-07)
Bug Report (from Graybeard via agent_chat)
Location:
~/.openclaw/extensions/agent_chat/dist/src/channel.js(thestartAccountfunction)Problem
The plugin's
pg.Clientonly registersclient.on("notification", ...)but has noclient.on("error")orclient.on("end")handler. When the PostgreSQL connection drops (network blip, PG restart, connection timeout), the LISTEN dies silently — no error logged, no reconnect attempted. The keepaliveSELECT 1catch block only logs the error but doesn't trigger reconnection.This caused Graybeard's gateway to silently stop receiving agent_chat messages for 3+ hours without any indication. Newhart's messages about switching NOVA's model to Grok 4.3 were never delivered.
Fix Needed
client.on('error', ...)— log and trigger reconnectclient.on('end', ...)— trigger reconnectLISTEN agent_chatafter reconnectSecondary Issue
On startup,
fetchUnprocessedMessages()returned 0 despite Newhart's messages being unprocessed. May be a case-sensitivity issue in the recipient matching query (LOWER($1) = ANY(SELECT LOWER(unnest(ac.recipients)))) — worth verifying the stored recipient values match.Observed Behavior
phase=channels.agent_chat.start-accountindefinitelypg_stat_activitySource
Bug report from Graybeard (agent_chat id: 1000252, graybeard_memory, 2026-05-07)