Skip to content

Role-aware managed-config paths in ucode configure (AIGTWY-4338) - #404

Open
tt-le wants to merge 2 commits into
mainfrom
tien/aigtwy-4338-role-aware-configure
Open

Role-aware managed-config paths in ucode configure (AIGTWY-4338)#404
tt-le wants to merge 2 commits into
mainfrom
tien/aigtwy-4338-role-aware-configure

Conversation

@tt-le

@tt-le tt-le commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Make ucode configure branch on the caller's role and whether the workspace already publishes a managed coding-agent config. All new behavior is gated by ENABLE_MANAGED_AGENT_CONFIG; with the flag unset, configure runs the existing manual flow unchanged.

Once the target workspace is resolved and authenticated (up front, so the config read is fresh and admin detection is reliable on an expired session):

Role Managed Config Status UX
User N/A This opens the regular configure flow Screenshot 2026-08-27 at 6 43 36 PM
User Present This just shows the user the managed config and hints them to use ucode to start Screenshot 2026-08-27 at 6 30 58 PM
Admin Present This essentially just calls ucode setup but relabeled to ucode configuration Screenshot 2026-08-27 at 6 28 19 PM Screenshot 2026-08-27 at 6 28 44 PM
Admin N/A This also just calls ucode setup but goes straight into the setup, same as current ucode setup if no configs were found. Screenshot 2026-08-27 at 6 27 39 PM

Also: the workspace picker and the setup flow's section headers now brand themselves to the invoking command ("ucode configure" vs "ucode setup") via a threaded label, so a configure user never sees stray "ucode setup" headers. Admin status is a best-effort workspace-admin check (SCIM Me group membership), mirroring the server-side authority; failures fall through safely.

Tests cover all four role/config paths, the flag-off no-op, the auth ordering, the command-label branding, and setup's Adopt option.

On non enabled workspaces:
As workspace admin:
Screenshot 2026-08-28 at 11 44 50 AM
Non workspace admin:
image

Make `ucode configure` branch on the caller's role and whether the workspace
already publishes a managed coding-agent config, per the AIGTWY-4329 epic. All
new behavior is gated by ENABLE_MANAGED_AGENT_CONFIG; with the flag unset,
`configure` runs the existing manual flow unchanged.

Once the target workspace is resolved and authenticated (up front, so the config
read is fresh and admin detection is reliable on an expired session):

- No managed config, admin -> drop straight into the `ucode setup` authoring
  flow (configure is replacing setup) and exit with its code.
- No managed config, non-admin (or admin status unverifiable) -> run the normal
  manual configure flow.
- Managed config, admin -> drop into setup, whose existing-config menu offers
  Adopt (confirm it's in force) / re-author / delete.
- Managed config, non-admin -> confirm it's in force and point at `ucode`.

Adopt is a confirmation, not a local write: the launch path already applies the
managed config (agents, MCP servers, skills) on every `ucode` run, so both the
non-admin path and setup's Adopt choice share `_confirm_managed_config_in_force`.

When configure routes an admin into setup it hands setup the same token the admin
check already used, so setup's admin gate can't disagree with the routing decision
(a second token fetch could resolve a different identity right after a credential
switch, wrongly rejecting a caller configure just treated as an admin).

Also: the workspace picker and the setup flow's section headers now brand
themselves to the invoking command ("ucode configure" vs "ucode setup") via a
threaded label, so a configure user never sees stray "ucode setup" headers.
Admin status is a best-effort workspace-admin check (SCIM `Me` group membership),
mirroring the server-side authority; failures fall through safely.

Tests cover all four role/config paths, the flag-off no-op, the auth ordering,
the token reuse, the command-label branding, and setup's Adopt option.

Co-authored-by: Isaac <no-reply@databricks.com>
@tt-le
tt-le requested a review from andy-xu-db August 27, 2026 22:56
@lilly-luo

lilly-luo commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

can you test against a workspace that doesn't have the functionality enabled yet and put a screenshot? if the workspace does not have the functionality enabled yet due to server side flag, then the admin flow should be same as non-admin flow.

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