ENG-670: Generalized per-provider capability resolution#2
Merged
clawhavenapp merged 1 commit intoJul 7, 2026
Conversation
resolve_capability() narrows any VMProvider instance to a capability ABC (isinstance-based, keeping the deliberate ABC-not-Protocol choice) and raises the shared CapabilityUnsupportedError when the provider doesn't implement it. HTTPProxyService now resolves per operation: the default provider for account-bound create/delete, the host's own provider for attach/detach — so a host on a non-default provider gates on its own provider's capability instead of the deployment default. Unsupported still maps to 501 HTTP_PROXY_UNSUPPORTED; exe remains the only implementer and http-proxy endpoints behave as before. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Every capability ticket (pause/resume ENG-526, snapshot ENG-528/527, discovery ENG-535) assumes a generalized per-provider capability resolver that didn't exist:
providers/capabilities.pyonly hadget_default_http_proxy_capability(), which checked the default provider only. With four providers (aws, exe, docker, hetzner) on the same deployment, a capability can be implemented by some providers and not others.resolve_capability(provider, capability)(src/providers/capabilities.py): narrows a specificVMProviderinstance to a capability ABC. isinstance-based, keeping the deliberate ABC-not-Protocol choice.CapabilityUnsupportedError(src/providers/exceptions.py): the one shared, neutral error every capability-gated path raises on an unsupported provider — instead of anAttributeError.src/http_proxies/service.py): resolution moved from eager default-provider lookup in the constructor to per-operation resolution — the default provider for account-boundcreate/delete(no host in play), the host's own provider forattach/detach. The API layer maps unsupported to the existing501 HTTP_PROXY_UNSUPPORTED; the now-dead constructor try/except indeps.pyis removed.Why
Shared prerequisite for the drukbox capability roadmap (pause/resume, snapshot/fork, discovery), found unticketed in the 2026-07-06 ticket-landscape audit. Without it, every capability feature would re-invent default-provider-only gating that breaks the moment a host lives on a non-default provider.
Acceptance criteria
Verification
uv run ruff check,uv run ruff format --check,uv run pyright,uv run pytest(277 passed) — all green.🤖 Generated with Claude Code