Fix: sanitize container name for paths with spaces#144
Merged
raine merged 2 commits intoraine:mainfrom Apr 25, 2026
Merged
Conversation
`workmux sandbox run '/path/AI Enablement'` failed because Docker rejects container names with spaces. The handle was derived from the raw directory basename without sanitization. Fix: apply `slug::slugify()` (already in deps) to the handle before building the container name. `AI Enablement` → `ai-enablement` → `wm-ai-enablement-12345`.
The original PR fix slugified the entire `handle` variable, which is used both for the Docker container name and as the state store key. This caused cleanup to fail for paths with spaces: `remove` derives the handle from the raw directory name (no slugify), so `list_containers` looked up the wrong key and found nothing, leaving containers running. Separate the two: keep `handle` as the raw directory basename so the state store key is consistent everywhere, and apply slugify only when constructing `container_name` to satisfy Docker's naming constraints.
Owner
|
Thank you |
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
workmux sandbox run '/path/AI Enablement'fails because Docker rejects the container namewm-AI Enablement-12345(spaces not allowed in container names)slug::slugify()(already a dependency) to the directory basename before building the container nameAI Enablement→ai-enablement→wm-ai-enablement-12345Change
One-line change in
src/command/sandbox_run.rs— wraps the existingfile_name()extraction inslug::slugify().Test plan
cargo build --releasesucceedsworkmux sandbox run '/path/with spaces/' -- echo testno longer fails with "Invalid container name"