Skip to content

feat(int-evolution-go): retry pattern with backoff/jitter + API fixes#85

Open
mt-alarcon wants to merge 1 commit into
evolution-foundation:mainfrom
mt-alarcon:feat/int-evolution-go-retry-pattern
Open

feat(int-evolution-go): retry pattern with backoff/jitter + API fixes#85
mt-alarcon wants to merge 1 commit into
evolution-foundation:mainfrom
mt-alarcon:feat/int-evolution-go-retry-pattern

Conversation

@mt-alarcon

Copy link
Copy Markdown

Summary

  • Adds retry pattern (backoff + jitter) for HTTP calls in evolution_go_client.py
  • Centralizes error handling in main()
  • Fixes API field naming (webhookUrl, events, url/type)
  • Introduces EVOLUTION_GO_INSTANCE_TOKEN env var support
  • Adds User-Agent header

Why

Improves reliability when interacting with the Evolution Go API by retrying transient failures with exponential backoff and jitter. Pre-existing field naming inconsistencies were silently failing — fix aligns with current API contract.

Test plan

  • python3 evolution_go_client.py --help returns 18 subcommands (no broken imports)
  • Syntax check via python3 -m py_compile evolution_go_client.py
  • No Webshare/MTA-specific code remaining (grep webshare = 0 in changed file)
  • Compatible with existing instance setup (no breaking changes to public CLI)

Breaking changes

None.

🤖 Generated with Claude Code

…didate)

- Add _retry_http_call_client(): exponential backoff + jitter (3 attempts)
  Retries on HTTP 5xx / URLError / socket.timeout; raises immediately on 4xx
- Refactor api_request() to use _retry_http_call_client + EVOLUTION_GO_INSTANCE_TOKEN
  for /send/* endpoints; centralize error handling in main()
- Add User-Agent header to all requests
- Fix cmd_connect: webhook→webhookUrl, subscribe→events (Evolution Go API)
- Fix cmd_send_media: mediaUrl/mediatype→url/type (Evolution Go API)
- Fix cmd_set_proxy: require explicit args instead of Webshare auto-config
- Remove Webshare-specific code (get_webshare_config, --no-proxy flag,
  auto-proxy in create_instance): moved to customizations/skills/int-evolution-go-mta/

Webshare integration is MTA-only and lives in the custom skill.
This file is now upstream-clean and suitable for a PR to evolution-foundation/evo-nexus.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @mt-alarcon, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

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