Skip to content

Treat FEATURE_DISABLED as no managed config - #317

Open
lilly-luo wants to merge 3 commits into
mainfrom
feature-disabled-clean-fallback
Open

Treat FEATURE_DISABLED as no managed config#317
lilly-luo wants to merge 3 commits into
mainfrom
feature-disabled-clean-fallback

Conversation

@lilly-luo

Copy link
Copy Markdown
Collaborator

What

When the coding-agent config feature is gated off server-side, the AI Gateway returns a FEATURE_DISABLED error on the config reads. This treats that exactly like the existing NOT_FOUND handling — as "the workspace has no managed config in effect", not a failure to warn about.

  • get_managed_config: FEATURE_DISABLED now collapses to (None, None) alongside NOT_FOUND. (None, None) is the authoritative "no config" result that also clears any previously cached config, rather than the failure path that warns and reapplies the cached config.
  • get_model_recommendation: FEATURE_DISABLED collapses to (None, None), so the budget/recommendation read falls back silently to the workspace's default model instead of printing a "Could not check your budget…" warning.

Net effect: with the feature disabled, ucode behaves exactly as though no coding-agent config existed — no warnings, no stale config reapplied.

Testing

  • uv run pytest tests/test_managed_config.py — added test_feature_disabled_is_treated_as_no_config (parametrized) and test_feature_disabled_is_no_recommendation, mirroring the existing NOT_FOUND tests. 54 passed.
  • uv run ruff check — clean.

This pull request and its description were written by Isaac.

When the coding-agent config feature is gated off server-side, the AI
Gateway returns FEATURE_DISABLED. Treat it exactly like NOT_FOUND — the
workspace behaves as though no managed config existed — so ucode falls
back to its defaults cleanly instead of warning and reapplying a cached
config.

- get_managed_config: collapse FEATURE_DISABLED to (None, None), the
  authoritative "no config" that also clears a previously cached config.
- get_model_recommendation: collapse FEATURE_DISABLED to (None, None) so
  the budget check falls back silently to the default model.

Co-authored-by: Isaac
setup previously walked the admin through the whole wizard even when the
server has the feature gated off: the existing-config read reports "no
config" (FEATURE_DISABLED collapses to that for the launch fallback), so
setup saw nothing published and offered to create one.

Add an up-front `_require_feature_enabled` gate to the interactive setup
flow. It lists configs and, on FEATURE_DISABLED, fails with a clear
message pointing the admin at the Enhanced Unity AI Gateway Preview —
before any prompting, and before the admin check to match the server's
own gate order. Other read failures pass through, since the API still
enforces the gate at publish time.

Co-authored-by: Isaac
On bare `ucode`, a disabled feature previously showed the generic
"no managed config found; using your local settings" line, because the
launch read collapses FEATURE_DISABLED to an empty result. Re-read on
the no-config path to tell the two apart and, when the feature is off,
point the developer at a specific agent (`ucode codex` / `ucode claude`).

Also promote is_feature_disabled to a public helper (now shared by cli,
managed_wizard, and managed_config).

Co-authored-by: Isaac
@lilly-luo
lilly-luo force-pushed the feature-disabled-clean-fallback branch from 6a130a9 to a4e6441 Compare August 12, 2026 18:36
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