Skip to content

Discord: guard GatewayPlugin reconnect errors - #36159

Closed
Octane0411 wants to merge 1 commit into
openclaw:mainfrom
OasAIStudio:codex/fix-36055-uncaught
Closed

Octane0411 wants to merge 1 commit into
openclaw:mainfrom
OasAIStudio:codex/fix-36055-uncaught

Conversation

@Octane0411

Copy link
Copy Markdown
Contributor

Summary

  • Wrap Discord GatewayPlugin handleReconnectionAttempt with a reconnection error guard to prevent uncaught exceptions when max reconnect attempts are reached.
  • Emit gateway error events from the guard so existing lifecycle error handling can handle shutdown/restart flow.
  • Add regression coverage for handleReconnectionAttempt failure handling in monitor plugin creation tests.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord size: S labels Mar 5, 2026
@greptile-apps

greptile-apps Bot commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a withReconnectionErrorHandling wrapper in gateway-plugin.ts that catches exceptions thrown by GatewayPlugin.handleReconnectionAttempt (e.g., when max reconnect attempts are exhausted), emits a gateway error event so existing lifecycle error handling can drive shutdown/restart, and logs the failure via runtime.error. The wrapper is applied to all three instantiation paths. A regression test is added to provider.proxy.test.ts that verifies the error guard catches failures from handleReconnectionAttempt and emits the expected error event through the gateway emitter.

The implementation is sound: closure captures correctly bind plugin and originalHandleReconnectionAttempt even when the method is extracted, and the test confirms the wrapped behavior resolves cleanly with proper error emission.

Confidence Score: 5/5

  • This PR is safe to merge. The error-guard wrapper is well-scoped, correctly implemented, and properly tested with no identified defects.
  • The error handling logic is sound and addresses a real crash path when max reconnect attempts are exhausted. The closure captures are correct, the wrapper is applied consistently across all instantiation paths, and the test validates the error-emission behavior works as intended. No blocking issues or concerning patterns identified.
  • No files require special attention

Last reviewed commit: 00a73f0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants