Skip to content

feat: retry tool discovery up to 3 times on connection failure#6

Open
Alex647648 wants to merge 1 commit intodimensionalOS:masterfrom
Alex647648:feat/retry-discovery
Open

feat: retry tool discovery up to 3 times on connection failure#6
Alex647648 wants to merge 1 commit intodimensionalOS:masterfrom
Alex647648:feat/retry-discovery

Conversation

@Alex647648
Copy link

Summary

  • Wrap discoverToolsSync in a retry loop (max 3 attempts, 2s delay between retries)
  • Log each failed attempt with attempt number for easier debugging
  • Only give up and skip plugin loading after all retries are exhausted

Motivation

When the DimOS MCP server starts slower than the OpenClaw plugin host (common in development), the single-attempt discovery fails silently and the plugin never loads tools. Users must manually restart. A simple retry loop handles this common race condition.

Test plan

  • Start OpenClaw before DimOS — verify plugin retries and eventually discovers tools
  • Start with DimOS already running — verify no extra delay (succeeds on first attempt)
  • Start with DimOS permanently down — verify clean failure message after 3 attempts

If the DimOS MCP server is temporarily unavailable during plugin
registration, the plugin would silently fail to load any tools.

Now discoverToolsSync is retried up to 3 times with a 2-second delay
between attempts, giving the server time to start. Each failure is
logged with the attempt number. Only after all retries are exhausted
does the plugin give up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant