Skip to content

feat(proxy): add provider proxy rotation strategy UI - #67

Open
mahdiwafy wants to merge 1 commit into
Vanszs:mainfrom
mahdiwafy:pr/proxy-rotation-ui
Open

feat(proxy): add provider proxy rotation strategy UI#67
mahdiwafy wants to merge 1 commit into
Vanszs:mainfrom
mahdiwafy:pr/proxy-rotation-ui

Conversation

@mahdiwafy

@mahdiwafy mahdiwafy commented Jul 29, 2026

Copy link
Copy Markdown

Summary

  • Adds provider-level proxy pool rotation strategy support (none, round-robin, random).
  • Exposes the proxy strategy card for both free/no-auth and authenticated providers.
  • Preserves existing provider strategy fields when saving connection rotation settings.

Scope

Focused only on provider proxy rotation strategy. This intentionally does not include Tailscale, API key limits, Claude model catalog changes, or PR #61 changes.

Verification

  • npm run lint:undef

Notes

Current rotation selects from active proxy pools. Custom per-provider pool subset selection should be a separate follow-up PR.

mahdiwafy added a commit to mahdiwafy/VansRouter that referenced this pull request Jul 30, 2026
…r, Tailscale loading fix

- pickProxyPoolId() supports targetProxyPoolIds for subset rotation
- NoAuthProxyCard: checkbox grid for pool selection, conditional UI
- apiKeyUsageRepo: getApiKeyUsageSnapshot with real-time metrics
- EndpointPageClient: card grid with status badges, quota progress bars
- Tailscale: fix endless loading when tunnelUrl is empty
- Supersedes PR Vanszs#67 and Vanszs#73
@mahdiwafy mahdiwafy closed this Jul 30, 2026
@mahdiwafy
mahdiwafy deleted the pr/proxy-rotation-ui branch July 30, 2026 05:06
@mahdiwafy
mahdiwafy restored the pr/proxy-rotation-ui branch July 30, 2026 05:15
@mahdiwafy mahdiwafy reopened this Jul 30, 2026
@Vanszs

Vanszs commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Request for revision / targeted adoption note.

The provider proxy rotation idea is relevant, but it needs adaptation for VansRouter’s existing proxy boundaries.

Please revise the implementation/tests to ensure:

  • explicit connection-level proxy selection remains authoritative unless rotation is explicitly enabled;
  • inactive or invalid pools are excluded;
  • relay fields (vercelRelayUrl, Cloudflare/Deno relay) and strictProxy remain intact;
  • proxy hash, semaphore, circuit-breaker, and account fallback use the actually selected proxy;
  • round-robin ordering is deterministic after pool sorting;
  • provider-level rotation does not unintentionally affect authenticated account/IP affinity;
  • empty pools and multi-worker/process behavior are documented.

A focused selector/helper commit would be easier to adopt than a broad auth/UI change. Please add deterministic tests for none, round-robin, random, empty pools, relay pools, and connection-proxy precedence.

Per maintainer feedback on Vanszs#67:
- connection-level proxy selection remains authoritative when strategy is
  'none' (the rotation override only kicks in for round-robin/random).
- inactive/invalid pools filtered: only active pools with proxyUrl are
  rotation candidates.
- relay fields (vercelRelayUrl / cloudflare / deno) and strictProxy are
  untouched in resolveConnectionProxyConfig.
- round-robin cursor resets when pool composition changes; state is
  per-provider.
- deterministic tests: none, round-robin, random, empty pools, per-provider
  cursor, pool-composition reset, unknown-strategy fallback.
@mahdiwafy

Copy link
Copy Markdown
Author

Per your #67 review notes:

  • Connection-level precedence: when strategy is none, the rotation override is a no-op and the connection's own proxy pool / legacy proxy settings remain authoritative. Rotation only applies for round-robin/random.
  • Invalid pools filtered: only active pools with proxyUrl are rotation candidates (getProxyPools({ isActive: true }) + .filter(p => p.proxyUrl)).
  • Relay fields intact: vercelRelayUrl/Cloudflare/Deno handling and strictProxy in resolveConnectionProxyConfig are unchanged.
  • Deterministic rotation: round-robin cursor is per-provider and resets when pool composition changes (pool hash).

Tests added (tests/unit/proxy-rotation-selector.test.js): none, round-robin cycling, per-provider cursor, pool-composition reset, random within bounds, empty pools → null, unknown-strategy fallback. 7 passed, build ✅.

@mahdiwafy
mahdiwafy force-pushed the pr/proxy-rotation-ui branch from e0cee96 to 2a81d14 Compare August 4, 2026 09:03
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.

2 participants