docker isolation (new) + default agent type (moved) in config wizard#2433
Open
evgunter wants to merge 15 commits into
Open
docker isolation (new) + default agent type (moved) in config wizard#2433evgunter wants to merge 15 commits into
evgunter wants to merge 15 commits into
Conversation
Fixes issue 4 (installer should pin isolate_host_volumes). When the default docker provider does not already configure isolate_host_volumes, `mngr extras config` (and `mngr extras -i`) now writes the recommended `providers.docker.isolate_host_volumes = true` to the user-scope config, creating the config file if there is none. This opts fresh installs into the forthcoming default before it flips and silences the one-shot deprecation warning that fresh installs otherwise hit via the bare-backend fallback the first time they use docker. With -y or without a TTY it prints the suggested `mngr config set` command instead of writing. `mngr extras` status now reports whether docker isolation is configured. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
isolate_host_volumes=true requires is_host_volume_created=true, so never seed the recommended value when the docker block explicitly disables the host volume -- that would write a config the validator rejects. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Consolidates one-time user-scope config setup under `mngr config wizard` instead of splitting it across `mngr extras`: - Add a docker host-volume isolation step: the wizard asks whether each docker host sees only its own host_dir sub-folder (the recommended, forthcoming default; requires Docker Engine >= 25.0) or keeps the legacy shared state volume, writing providers.docker.isolate_host_volumes. Opting in silences the one-shot deprecation warning a fresh install otherwise hits the first time it uses docker. - Move the default-agent-type step out of `mngr extras` into the wizard. Because the wizard runs as its own installer step (after plugins are installed), it now sees freshly-installed plugin agent types rather than only those registered at startup. `mngr extras` loses its `config` subcommand and default-agent-type step; user-scope config setup lives entirely in `mngr config wizard`. This supersedes the earlier extras-based approach on this branch. Updates tutorial references and regenerates the config command docs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The wizard steps previously wrote directly (load -> set -> save), skipping the schema validation that `config set` runs before saving, so a bad value (e.g. isolate_host_volumes=true with is_host_volume_created=false) would be persisted and only fail on the next load. Extract the validate-then-save write into a shared `_apply_config_value` used by both `config set` and the wizard. Each wizard step now writes via an `apply_fn` bound to the user-scope file and the run's config context, so every write is validated up front. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Use functools.partial instead of an inline closure to bind the shared validated writer, satisfying the PREVENT_INLINE_FUNCTIONS ratchet. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…g it The default-agent-type step reimplemented list_available_agent_types as _list_wizard_agent_type_choices, justified by "avoid loading a full MngrConfig" -- but the wizard already has one (mngr_ctx.config from setup_command_context), so the reimplementation was pure duplication. The orchestrator now passes list_available_agent_types(mngr_ctx.config). The remaining raw user-file reads (for the "already set?" checks) are kept and their comment corrected: they detect whether the user *explicitly* set a key, which the loaded merged config can't reveal for fields with non-None defaults on plugin subclasses (e.g. claude's isolate_local_config_dir) -- not a re-parse for speed. Also align _get_default_agent_type's leaf handling with the sibling getters (reject a non-str value instead of coercing via str()). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…copes Refactor the `mngr config wizard` steps so each one decides what (if anything) to set and returns the chosen value (or None to leave it unset), with all writing centralized in the orchestrator through the single validate-then-save path (`_apply_config_value`). This removes the `apply_fn` injection seam -- which existed only to let unit tests bypass validation -- and with it the functools.partial that the ratchet bans. Add an explicit "leave unset for now" option to every wizard prompt so a choice can be deferred instead of forcing a value or a cancel. For the "already configured?" check, read the create default type and docker isolation off the merged config (their defaults already mark "unset"), and read Claude's isolate_local_config_dir -- which has a non-None default -- as explicit presence across every config file scope (user, project, local) rather than only the user-scope file, so a project/local setting also suppresses the prompt. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Spell out the effective default in the Claude and Docker 'leave unset' rows: Claude defaults to isolating each agent's config dir, and Docker keeps today's shared behavior (with the deprecation warning) until the default flips to isolation in a future release. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Tighten the Claude and Docker isolate/share/leave-unset rows to one concise line each, leaning on the picker header for context while keeping the key details (macOS subscription caveat, Docker Engine version, and the default each 'leave unset' falls back to). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Scope 'won't touch your default Claude config' to the isolate option (not a general claim), spell out in the share option that mngr writes to the config and that it's the credentials that need it for Claude subscriptions on macOS, and quote 'isolate' in the docker leave-unset row so it reads as the state. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Read docker's isolate_host_volumes off the merged config via an isinstance(DockerProviderConfig) narrow with direct attribute access, instead of getattr() (which tripped the PREVENT_GETATTR ratchet), and apply ruff format. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Spell out the two states where the isinstance is False (no [providers.docker] block; or an instance named 'docker' with a non-docker backend), so the read doesn't look like it silently swallows bad config. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# Conflicts: # libs/mngr/imbue/mngr/cli/extras_test.py
The default-agent-type prompt moved from 'mngr extras -i' into 'mngr config wizard'; its old integration test (test_extras_interactive_includes_default_type) went away with the extras step. The wizard step had only pure-function coverage, so this adds an end-to-end invocation asserting the step is actually wired into the 'config wizard' command. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
previously new users would get a warning about legacy docker isolation; now the installer prompts them to write that config setting up front
Summary
Consolidates one-time user-scope config setup under
mngr config wizardinstead of splitting it acrossmngr extras.A fresh install has no
[providers.docker]block, so the default docker provider is resolved via the bare-backend fallback (providers/registry.py), instantiatingDockerProviderConfigwithisolate_host_volumesunset -- emitting the one-shot default-flip deprecation warning the first time the user touches docker.Rather than a separate command, this adds the docker setting as a step in the existing
mngr config wizard(which already prompts for Claude config-dir isolation), and moves the default-agent-type step there too:Docker host-volume isolation (new step): the wizard asks whether each docker host sees only its own
host_dirsub-folder (the recommended, forthcoming default; requires Docker Engine >= 25.0) or keeps the legacy shared state volume, writingproviders.docker.isolate_host_volumes. Opting in silences the deprecation warning. The recommended "Yes" is the default-highlighted option; users on older Docker can pick "No".Default agent type (moved): the "pick a default agent type for
mngr create" step moved out ofmngr extrasinto the wizard. Because the wizard runs as its own installer step (after plugins are installed), it now sees freshly-installed plugin agent types instead of only those registered at startup.Every prompt also offers an explicit "leave unset for now" choice (which states the default it falls back to), so a decision can be deferred instead of forcing a value or a cancel.
Each step short-circuits when its setting is already configured, checked across every config scope (user, project, and local) so a value set in any of them suppresses the prompt. The two settings whose defaults already mark "unset" (the create default type and docker's
isolate_host_volumes) are read off the merged config; Claude'sisolate_local_config_dirhas a non-None default, so its explicit-presence check reads the raw config files across all scopes instead.mngr extrasloses itsconfigsubcommand and default-agent-type step; user-scope config setup lives entirely inmngr config wizard.scripts/install.shalready runsmngr config wizard, so no installer change is needed. Tutorial references and the generated config command docs are updated.The code default (
isolate_host_volumes: bool | None = None) is intentionally not changed here.Verification
None(returns-picked-value / returns-none-when-already-set / -no-choices / -declined / -non-interactive), and the orchestrator centralizes writing through the same validated path asmngr config set. Added tests for the across-scopes explicit-presence read and the value-render helper. 91 passed inconfig_test.py, 45 acrossextras_test.py+ dockerconfig_test.py; ruff, ty, and thefunctools.partial/ inline-function ratchets pass.mngr config wizardruns all three steps; the interactive path writesproviders.docker.isolate_host_volumes = trueandcommands.create.type(validated, deprecation warning gone) and is idempotent on re-run. A project-scope Claude setting correctly suppresses that prompt, and "leave unset" skips without writing. Non-interactive prints the suggestedmngr config setcommands without writing.History
Earlier commits on this branch implemented an extras-based approach; this supersedes them.
🤖 Generated with Claude Code