Skip to content

Stop ug configure erroring on feature-disabled workspaces - #500

Open
david-siqi-liu wants to merge 1 commit into
mainfrom
david/ug-configure-wording
Open

Stop ug configure erroring on feature-disabled workspaces#500
david-siqi-liu wants to merge 1 commit into
mainfrom
david/ug-configure-wording

Conversation

@david-siqi-liu

@david-siqi-liu david-siqi-liu commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

🥞 Stack (ug configure + managed-config)


What did you change, and why?

Customers running ug configure on a workspace where server-managed coding-agent config is disabled (FEATURE_DISABLED) hit an alarming, circular error and then dead-ended:

ERROR Workspace-managed coding agent configuration is not available on this workspace. Use `ug configure` to set up agents for individual users instead.

Root cause: refresh_managed_config treated FEATURE_DISABLED like a transient read failure and fell back to a stale cached config, returning it with the feature-disabled flag unset. That masked the disabled state, so an admin got routed into the managed setup flow, which re-read the workspace, got FEATURE_DISABLED again, and raised the message.

The fix is in managed_config.py: FEATURE_DISABLED is now authoritative. It returns no config with the feature-disabled flag set and clears the persisted cache, so ug configure stays on the normal per-user flow, a launch never re-applies a policy the workspace turned off, and a later transient read or token failure cannot resurrect the disabled policy through the fallback. Also initializes the feature-disabled flag on the --dry-run path (a pre-existing UnboundLocalError on an empty local cache, surfaced by review).

Hiding ug setup/ug publish from help and pruning the README, previously bundled here, moved to standalone #510 since it has no dependency on this fix.

How do you know it works?

Affected unit suites (managed_config, cli) green, including new coverage for the feature-disabled cache clear and the dry-run no-crash path. ruff check and format clean. PR CI green (test + e2e).

This pull request and its description were written by Isaac.

@david-siqi-liu
david-siqi-liu marked this pull request as ready for review September 4, 2026 19:52
Comment thread src/ucode/managed_config.py Outdated
Comment thread src/ucode/cli.py Outdated
Comment thread src/ucode/cli.py Outdated
@david-siqi-liu
david-siqi-liu force-pushed the david/ug-configure-wording branch 2 times, most recently from 2ef3099 to 87045b6 Compare September 6, 2026 15:06
@david-siqi-liu david-siqi-liu changed the title Stop ug configure erroring on feature-disabled workspaces; hide unramped managed commands Stop ug configure erroring on feature-disabled workspaces Sep 6, 2026
`refresh_managed_config` treated FEATURE_DISABLED like a transient read failure
and fell back to a stale cached config with the feature-disabled flag unset,
masking the disabled state. An admin was then routed into the managed setup
flow, which re-read the workspace, got FEATURE_DISABLED, and raised the alarming
circular error.

Treat FEATURE_DISABLED as authoritative: return no config with the flag set and
clear the persisted cache, so `ug configure` stays on the normal per-user flow,
a launch does not re-apply a policy the workspace has turned off, and a later
transient read or token failure cannot resurrect the disabled policy through the
fallback. Also initialize the feature-disabled flag on the `--dry-run` path (a
pre-existing UnboundLocalError when the local cache is empty).

Co-authored-by: Isaac <no-reply@databricks.com>
@david-siqi-liu
david-siqi-liu force-pushed the david/ug-configure-wording branch from 87045b6 to 75f90cb Compare September 6, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants