feat(providers): add Docker Agent provider#1313
Conversation
8ab8bb9 to
648e659
Compare
johntmyers
left a comment
There was a problem hiding this comment.
Code-only review findings:
-
[P2]
providers/docker-agent.yaml:13marksDOCKER_ACCESS_TOKENoptional, butcrates/openshell-providers/src/providers/docker_agent.rs:12only discovers that env var and provider creation rejects empty credentials. Public Docker Hub / local Model Runner users without a token cannot create or auto-create this provider, so no provider policy gets attached. -
[P2]
crates/openshell-providers/src/lib.rs:150normalizesdocker-agent, butdetect_provider_from_command()only checks the first token. A real invocation isdocker agent ..., so sandbox auto-provider inference seesdockerand returnsNone. Please add a["docker", "agent", ...]special case and regression test. -
[P2]
providers/docker-agent.yaml:16omitsauth.docker.io:443. Docker Hub registry pulls commonly require the token service advertised by the registry auth challenge, so the policy can deny pulls even when registry access is allowed. Docker documents the Docker Hub token realm atauth.docker.io/token: https://docs.docker.com/reference/api/registry/auth/
Open question: is DOCKER_ACCESS_TOKEN definitely consumed by docker agent, or should discovery also cover Docker's existing config/credential-store path?
Testing not run; this was code-only.
Add docker-agent provider for the Docker AI agent runner (docker agent). - Add providers/docker-agent.yaml with endpoints for registry-1.docker.io, auth.docker.io, hub.docker.com, and model-runner.docker.internal - Add DockerAgentProvider plugin with binary-presence discovery: the provider is detected when any known docker binary is found, even without a token, because DOCKER_ACCESS_TOKEN is optional (public Docker Hub and the local Model Runner work without credentials) - Add path_exists() to DiscoveryContext and MockDiscoveryContext for testable binary-presence checks - Add detect_provider_from_command() special case so that a docker agent invocation is mapped to the docker-agent provider type - Add regression tests for all three new behaviours
648e659 to
6a8f0db
Compare
|
Added auth.docker.io:443 endpoint so Docker Hub token-service requests aren't blocked during registry pulls. Added a special case before the basename lookup: if command[0] basename is docker and command[1] is agent, it returns "docker-agent". DOCKER_ACCESS_TOKEN optional but discovery rejected empty credentials. |
Summary
Related Issue
N/A — new provider addition from the Docker ecosystem.
Changes
providers/docker-agent.yaml— declarative profile: agent category, Docker Hub +auth.docker.io+ model-runner endpoints, optionalDOCKER_ACCESS_TOKENcredentialcrates/openshell-providers/src/providers/docker_agent.rs—DockerAgentProviderplugin with binary-presence discovery; usespath_exists()onDiscoveryContextso the provider is found even without a tokencrates/openshell-providers/src/context.rs— addpath_exists()default method toDiscoveryContexttraitcrates/openshell-providers/src/test_helpers.rs— addwith_path()toMockDiscoveryContextfor unit-testable binary checkscrates/openshell-providers/src/lib.rs— register plugin; adddocker-agent/docker_agentaliases; special-case["docker", "agent", ...]indetect_provider_from_commandso sandbox auto-inference maps the sub-command invocation correctlycrates/openshell-providers/src/providers/mod.rs— exposedocker_agentmodulecrates/openshell-providers/src/profiles.rs— embed YAML at compile timeTesting
openshell-providersunit tests passdocker_agent.rs: token discovery, tokenless binary-present discovery, no-discovery without token or binarydetect_provider_from_commandwith["docker", "agent", ...]cargo clippy -p openshell-providers— cleanChecklist
default_profiles_are_sorted_by_idtest)