refactor: deduplicate shared driver and provider constants#1474
Merged
johntmyers merged 1 commit intoMay 20, 2026
Merged
Conversation
Move default_sandbox_image() and SUPERVISOR_IMAGE_BINARY_PATH into openshell-core so all compute drivers share a single authoritative definition. Eliminates four identical copies of default_sandbox_image() and two identical copies of SUPERVISOR_IMAGE_BINARY_PATH. Implement ProviderPlugin for ProviderDiscoverySpec to remove the repeated three-method delegation boilerplate from eight simple provider modules. Each now declares only a SPEC constant; the blanket impl handles id(), discover_existing(), and credential_env_vars().
elezar
reviewed
May 20, 2026
elezar
reviewed
May 20, 2026
elezar
approved these changes
May 20, 2026
Member
elezar
left a comment
There was a problem hiding this comment.
My questions are largely unrelated to the actual changes.
It looks like a reasonable cleanup from my perspective!
|
Label |
Collaborator
|
/ok to test 42d8f46 |
johntmyers
approved these changes
May 20, 2026
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.
Summary
Remove three categories of copy-pasted code that had accumulated across multiple crates, replacing them with single authoritative definitions.
Related Issue
N/A
Changes
openshell-core::image: Adddefault_sandbox_image()and remove four identical copies spread acrossopenshell-driver-docker,openshell-driver-kubernetes,openshell-driver-podman, andopenshell-server.openshell-core::driver_utils: AddSUPERVISOR_IMAGE_BINARY_PATHconstant and remove two identical copies fromopenshell-driver-dockerandopenshell-driver-kubernetes. This path is semantically critical — a divergence would cause a silent runtime failure.openshell-providers: ImplementProviderPluginforProviderDiscoverySpec(blanket impl). Eight simple providers (anthropic, claude, codex, copilot, github, gitlab, nvidia, openai) previously repeated an identical three-methodimpl ProviderPluginblock delegating straight to theirSPECconstant. Each file now contains only theSPECdeclaration; the registry registersSPECdirectly.Net change: -146 lines across 16 files.
Testing
mise run pre-commitpassesChecklist