Summary
resolveSlackThreadStarter() and resolveSlackThreadHistory() in src/slack/monitor/media.ts catch all errors and return null / [] without any logging. When the Slack API call fails (permissions, rate limits, token expiry, network errors), thread context silently disappears — the agent receives no thread history and starts a blank session.
Steps to Reproduce
- Configure a cron job that delivers to a Slack DM channel
- Simulate a Slack API failure on
conversations.replies() (e.g., revoke im:history scope temporarily, or trigger rate limiting)
- Reply in a thread to the delivered message
- Observe: no error logged, agent responds with zero thread context
Expected Behavior
Errors from conversations.replies() should be logged at warn level so operators can diagnose missing thread context. The current silent catch {} pattern makes debugging impossible.
Actual Behavior
Errors are silently swallowed:
// src/slack/monitor/media.ts:396-398 (thread starter)
} catch {
return null;
}
// src/slack/monitor/media.ts (thread history, equivalent pattern)
} catch {
return [];
}
No log, no warning, no metric. The system proceeds as if thread history simply doesn't exist.
Affected Code
resolveSlackThreadStarter() — src/slack/monitor/media.ts
resolveSlackThreadHistory() — src/slack/monitor/media.ts
Suggested Fix
Add logWarn or logVerbose in the catch blocks with the error message, channel ID, and thread timestamp. This preserves the best-effort behavior (return null/empty) while making failures visible.
Also present in upstream OpenClaw at extensions/slack/src/monitor/media.ts:425-427 and 517-519.
Summary
resolveSlackThreadStarter()andresolveSlackThreadHistory()insrc/slack/monitor/media.tscatch all errors and returnnull/[]without any logging. When the Slack API call fails (permissions, rate limits, token expiry, network errors), thread context silently disappears — the agent receives no thread history and starts a blank session.Steps to Reproduce
conversations.replies()(e.g., revokeim:historyscope temporarily, or trigger rate limiting)Expected Behavior
Errors from
conversations.replies()should be logged atwarnlevel so operators can diagnose missing thread context. The current silentcatch {}pattern makes debugging impossible.Actual Behavior
Errors are silently swallowed:
No log, no warning, no metric. The system proceeds as if thread history simply doesn't exist.
Affected Code
resolveSlackThreadStarter()—src/slack/monitor/media.tsresolveSlackThreadHistory()—src/slack/monitor/media.tsSuggested Fix
Add
logWarnorlogVerbosein the catch blocks with the error message, channel ID, and thread timestamp. This preserves the best-effort behavior (return null/empty) while making failures visible.Also present in upstream OpenClaw at
extensions/slack/src/monitor/media.ts:425-427and517-519.