make config-editing hints use mngr config whenever possible + shared hint helpers#2440
Open
evgunter wants to merge 3 commits into
Open
make config-editing hints use mngr config whenever possible + shared hint helpers#2440evgunter wants to merge 3 commits into
mngr config whenever possible + shared hint helpers#2440evgunter wants to merge 3 commits into
Conversation
Route all user-facing config-change error/warning hints through a new imbue.mngr.remediations helper so they always emit a runnable `mngr config set/unset` command instead of telling users to hand-edit settings.toml. Disable-provider hints now recommend --scope local, which always takes effect since config precedence is user < project < local (local wins). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The "agent type has no command to run" error suggested `--type command` even when the user ran a different type; use the actual agent type so the example matches what they typed. Likewise the "template not found / none configured" hint now scaffolds the specific template name the user asked for instead of a generic `<name>` placeholder. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rather than re-declaring the scope strings as a Literal in remediations.py, move the canonical ConfigScope enum from config/data_types.py down to primitives.py (which errors.py already depends on) so remediations.py can import it without the errors -> remediations -> data_types -> errors cycle. All ConfigScope importers now pull it from primitives. Per the style guide, format_config_set/format_config_unset no longer take a default scope; every caller passes scope= explicitly. Their shared --scope-flag rendering is factored into a private _scope_flag helper. Also name the concrete OVH credential keys (application_key / application_secret / consumer_key) in the OVH hint instead of a vague <key>. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mngr config whenever possible + shared hint helpers
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.
ideally we never tell the users to hand-edit config; this PR removes all but one instance of that (for editing
enabled_backendsthere's no good config command to remove just one backend; it seemed worse to suggest a command which contained a list of all backends except the one to disable)What
Standardizes user-facing configuration remediation hints so error and warning messages always point users at a runnable
mngr config set/mngr config unsetcommand instead of telling them to hand-editsettings.toml.Two goals: eliminate the "edit settings.toml" hints, and route every site through one helper so flag-order and scope drift are structurally impossible.
How
imbue.mngr.remediationswithformat_config_set,format_config_unset, andformat_disable_provider. One canonical flag order (--scopeimmediately afterset/unset), factored into a shared_scope_flagrenderer.ConfigScopeenum rather than a re-declared string literal. To let the low-levelremediationsmodule import it without anerrors -> remediations -> data_types -> errorscycle,ConfigScopemoved fromconfig/data_types.pydown toprimitives.py(whicherrors.pyalready depends on); all importers now pull it from there.format_config_set/format_config_unsettake no default scope (per the style guide) — every caller passesscope=explicitly.format_disable_provideralways recommends--scope local. Config precedence is user < project < local (local wins), so a--scope usersuggestion was silently overridden — and thus ineffective — whenever the provider was enabled at the project or local layer. Writing to local always takes effect. This also unifies the previous split where most providers used--scope userbut modal used--scope local.mngr create --template(no templates), custom-agent-type "no command", provider unavailable/not-authorized errors, the list-error disable hint, notifications terminal config, and the azure/gcp/aws/modal/ovh/claude provider hints.--type command), and the "template not found / none configured" hint scaffolds the specific template name they asked for. The OVH hint now names the real credential keys (application_key/application_secret/consumer_key) instead of a vague<key>.Notes / deliberately left alone
ProviderNotAuthorizedError's "or remove it fromenabled_backends" line is kept as prose:enabled_backendsis an allowlist with no single-command remove operation, so a file reference is the honest guidance there. (Possible follow-up: only show that line when a non-empty allowlist actually exists.)scope=None(no--scope), lettingconfig setuse its default (project) scope; only disable hints forcelocal.--scope user(a per-machine credential preference), now just rendered in canonical flag order.Testing
libs/mngr/imbue/mngr/remediations_test.py.list_test.pydisable-hint assertion (--scope user→--scope local).tytype-check andruffclean on all touched files. Targeted message-assertion and config-loader/ConfigScopeunit tests pass. Full suite runs via CI.🤖 Generated with Claude Code