Skip to content

feat(client): add check_version flag for lazy compatibility check on first RPC#99

Merged
zeevdr merged 1 commit into
mainfrom
feat/check-version-flag
May 25, 2026
Merged

feat(client): add check_version flag for lazy compatibility check on first RPC#99
zeevdr merged 1 commit into
mainfrom
feat/check-version-flag

Conversation

@zeevdr
Copy link
Copy Markdown
Member

@zeevdr zeevdr commented May 25, 2026

Summary

  • Makes version compatibility opt-in at construction time rather than requiring callers to manually invoke check_compatibility() after every client instantiation.
  • Runs the check lazily on the first RPC so clients that never reach a server (e.g., in tests) pay no extra cost.
  • Applies to both ConfigClient and AsyncConfigClient with identical semantics.

Test plan

  • test_ensure_version_checked_runs_once — verifies the check fires exactly once across multiple calls.
  • test_ensure_version_checked_noop_when_disabled — verifies no check when check_version=False (default).
  • test_ensure_version_checked_raises_on_incompatible — verifies IncompatibleServerError propagates on version mismatch.
  • Async equivalents for both the "runs once" and "noop when disabled" cases.
  • All 240 existing tests continue to pass; overall coverage 97.49%.

Closes #63

…first RPC

Add `check_version: bool = False` constructor parameter to both
`ConfigClient` and `AsyncConfigClient`. When enabled, calls
`check_compatibility()` once before the first RPC and raises
`IncompatibleServerError` on mismatch. Subsequent calls skip the
check via a `_version_checked` flag.

Closes #63

Co-Authored-By: Claude <noreply@anthropic.com>
@zeevdr zeevdr added this to the Beta Readiness milestone May 25, 2026
@zeevdr zeevdr added size: S Quick win — a few hours or less priority: P2 Nice-to-have labels May 25, 2026
@zeevdr zeevdr merged commit caf0aa6 into main May 25, 2026
14 checks passed
@zeevdr zeevdr deleted the feat/check-version-flag branch May 25, 2026 04:58
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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

Labels

priority: P2 Nice-to-have size: S Quick win — a few hours or less

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optional compatibility check on first RPC

1 participant