Repository navigation
feat(workspaces): mount volumes and name the container of a DockerWorkspace - #118
Merged
Merged
Conversation
…kspace A tool run from a project directory - pydantic-deep's CLI in Docker mode - wants its project mounted in the container and the same container every time it starts, and has no message history to carry a ref in. Both were reachable only by building DockerWorkspaceBackend with a sandbox factory. volumes mounts host directories. container_name names one container for every run: created on first use, attached after. A ref naming it must still find it there, and no ref reaches another container through it. Also ships py.typed, without which type checkers in projects installing this package read every name as Any. Verified: 1320 tests at 100% coverage; ruff, pyright, mypy. On a real daemon a mounted host file reads inside, a file written inside appears on the host, and a second backend reaches the same container by name.
Merged
DEENUU1
added a commit
that referenced
this pull request
Oct 5, 2026
Cuts 0.2.31 for #118: `DockerWorkspace` mounts volumes and can name one container for every run, and the package ships `py.typed`. Release-only: `pyproject.toml` version + `CHANGELOG.md`.
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.
Problem
pydantic-deep's CLI runs in Docker with the project mounted at
/workspaceand, for a named workspace, the same container every time it starts. Moving it onto Pydantic AI workspaces (the follow-up to #112) needs both fromDockerWorkspace, which exposed neither. They were reachable only by buildingDockerWorkspaceBackendwith a sandbox factory of your own.Separately, the package shipped no
py.typed, so type checkers in projects that install it read every name asAny. pydantic-deep's mypy run surfaced it.Change
DockerWorkspace(volumes={host: container})passes the mounts toDockerSandbox.DockerWorkspace(container_name=...)/DockerWorkspaceBackend(container_name=...): one container named by whoever configures the workspace. It is created on first use and attached after, by this process or the next. A ref naming it must still find it there (WorkspaceUnavailableErrorotherwise), and a ref naming any other container is declined by the capability and refused by the backend.destroyaccepts it.src/pydantic_ai_backends/py.typed.Verification
pydantic_ai_backends/py.typed.