Skip to content

Remove ug setup and ug publish; ug is developer-only - #510

Open
david-siqi-liu wants to merge 1 commit into
mainfrom
david/hide-managed-authoring
Open

Remove ug setup and ug publish; ug is developer-only#510
david-siqi-liu wants to merge 1 commit into
mainfrom
david/hide-managed-authoring

Conversation

@david-siqi-liu

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

Copy link
Copy Markdown
Collaborator

🥞 Stack (ug configure + managed-config)


What did you change, and why?

ug is now entirely developer-focused. Managed coding-agent config authoring moves off the CLI to the AI Gateway API and the Unity Gateway UI, so ug setup and ug publish are removed outright (not hidden).

Removed:

  • The ug setup command group (setup, setup mcps, setup skills, setup spend-tiers, setup help, setup show) and ug publish.
  • Their now-dead backing modules managed_wizard.py and managed_publish.py.
  • The admin-status tailoring in the bare-ug no-config guidance (it named the removed commands). It now points the developer at ug configure (a local dev can always set up their own agents when no managed config is published), which also drops an unused admin/token round-trip.

Kept:

  • ug export (read-only dump of the applied config), with its help reworded off the removed commands.
  • managed_setup.py, which the developer launch path and export still use (claude_family_for_model, serialize/validate).

Docstrings, guidance strings, and the README are reworded off ug setup/ug publish.

How do you know it works?

Unit suites (cli, managed_config, managed_export, managed_setup, managed_resolve) green; ruff clean; PR CI green (test + e2e). A new test asserts ug setup/ug publish are no longer registered (exit 2) while ug export still resolves, confirmed against the CLI app: --help no longer lists them and both return "no such command".

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 6, 2026 20:04
@david-siqi-liu
david-siqi-liu force-pushed the david/hide-managed-authoring branch from bf359df to 3484c3d Compare September 8, 2026 15:07
@david-siqi-liu david-siqi-liu changed the title Hide unramped ug setup/ug publish from help and public docs Remove ug setup and ug publish; ug is developer-only Sep 8, 2026
@david-siqi-liu
david-siqi-liu changed the base branch from main to david/kill-managed-config-flag September 8, 2026 15:08
@david-siqi-liu
david-siqi-liu force-pushed the david/hide-managed-authoring branch from 3484c3d to d2b2b7b Compare September 8, 2026 15:25
@david-siqi-liu
david-siqi-liu force-pushed the david/kill-managed-config-flag branch from 377acf5 to a77db36 Compare September 8, 2026 15:47
@david-siqi-liu
david-siqi-liu force-pushed the david/hide-managed-authoring branch from d2b2b7b to 4f9009d Compare September 8, 2026 15:48
david-siqi-liu added a commit that referenced this pull request Sep 8, 2026
## 🥞 Stack (ug configure + managed-config)

- **#500** ⬅ this PR
  - #504
    - #510

---

## 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?

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).

Live-verified end to end against a real feature-disabled staging
workspace (eng-ml-agent-platform, with the
`codingAgentConfigCrudEnabled` SAFE flag turned off), where the gateway
returns:

```json
{"error_code":"FEATURE_DISABLED","message":"Coding agent config APIs are not enabled for this workspace."}
```

Invoking `ug configure` against that workspace as an admin, with a
non-empty stale managed config cached (the exact condition that
triggered the report):

Old build (`0.1.0+81.g95999aa`) exits 1 with the circular dead-end
error:

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

This branch exits 0 with no error and drops into the normal per-user
configure flow. Under the hood `refresh_managed_config` now returns
`(None, True)` and clears the stale cache to `{}`, so the admin is never
routed into the managed-setup dead end.

This pull request and its description were written by Isaac.

Co-authored-by: Isaac <no-reply@databricks.com>
@david-siqi-liu
david-siqi-liu force-pushed the david/kill-managed-config-flag branch from a77db36 to 94db730 Compare September 8, 2026 16:22
@david-siqi-liu
david-siqi-liu force-pushed the david/hide-managed-authoring branch from 4f9009d to be39b3e Compare September 8, 2026 16:22
Base automatically changed from david/kill-managed-config-flag to main September 8, 2026 16:29
david-siqi-liu added a commit that referenced this pull request Sep 8, 2026
…AFE flag (#504)

## 🥞 Stack (ug configure + managed-config)

- #500
  - **#504** ⬅ this PR
    - #510

---

## What did you change, and why?

Removes the client-side `ENABLE_MANAGED_AGENT_CONFIG` opt-in (a bug-bash
flag) and `managed_agent_config_enabled()`. Per team decision,
workspace-managed coding-agent config is now gated purely by the
server-side SAFE flag, which surfaces as a `FEATURE_DISABLED` reason
from `refresh_managed_config` (made authoritative in #500).

Two constraints had to keep holding, and do:
- Feature disabled server-side means admins and users see nothing about
managed config.
- omnigent's `ucode configure --profiles DEFAULT --agents
claude,codex,pi --use-pat --skip-validate --skip-upgrade` stays fully
non-interactive.

Where to look:
- `cli.py` is the bulk of the diff: deletes the env-var gates, drops the
`ug configure` admin auto-routing (it was a passthrough when the flag
was unset, so `ug configure` now behaves for everyone as it did for
non-flag users), and removes `--skip-managed-config` (it worked by
unsetting the now-gone env var). `status` and the launch "no managed
config" note now key off the server signal.
- Bare `ug` on a feature-disabled workspace prints one managed-free
guidance line (run `ug configure`, then `ug <agent>`) instead of a
silent no-op.
- Launch always fetches and applies the managed config: the
cached-launch fast path is gone, so stale local state cannot bypass an
admin's config. Correctness over the small per-launch latency.

## How do you know it works?

Unit suites (test_cli, test_managed_config, test_managed_wizard,
test_lint) green; ruff check and format clean. PR CI green (test + e2e).
A prior gpt-6-astra review verified both hard constraints; its one
finding (feature-disabled help still surfaced managed-config wording) is
addressed by the managed-free guidance line.

## Follow-up (not in this PR)

`ug status` reads the managed-config cache directly
(`load_managed_state`), with no server-state check, so in a server-side
enabled to disabled transition it can surface a stale managed summary
until the next `ug configure` or launch clears the cache. Dormant today
(the feature is unramped, so the cache is empty everywhere) and
self-healing on the next refresh. Deferred: closing it means making
`status` refresh from the server, which trades its offline-cheap
local-diagnostic nature. Will address before the feature ramps.

This pull request and its description were written by Isaac.

Co-authored-by: Isaac <no-reply@databricks.com>
Managed coding-agent config authoring moves entirely off the CLI to the AI
Gateway API and Unity Gateway UI. Remove the `ug setup` command group (setup,
mcps, skills, spend-tiers, help, show) and `ug publish`, and delete their
now-dead backing modules managed_wizard.py and managed_publish.py. `ug` is now
purely developer-facing: it fetches and applies the published config, and
`ug export` stays as a read-only dump.

The bare-`ug` no-config guidance no longer tailors advice by admin status or
names a removed command; it just notes local settings are used and a workspace
admin can configure one (dropping the now-unused admin check). managed_setup.py
stays for the developer path and export. Reword docstrings, guidance, and README
references off the removed commands.

Co-authored-by: Isaac <no-reply@databricks.com>
@david-siqi-liu
david-siqi-liu force-pushed the david/hide-managed-authoring branch from be39b3e to 7ea682a Compare September 8, 2026 16:31
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.

1 participant