Treat FEATURE_DISABLED as no managed config - #317
Open
lilly-luo wants to merge 3 commits into
Open
Conversation
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
force-pushed
the
feature-disabled-clean-fallback
branch
from
August 12, 2026 18:36
6a130a9 to
a4e6441
Compare
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.
What
When the coding-agent config feature is gated off server-side, the AI Gateway returns a
FEATURE_DISABLEDerror on the config reads. This treats that exactly like the existingNOT_FOUNDhandling — as "the workspace has no managed config in effect", not a failure to warn about.get_managed_config:FEATURE_DISABLEDnow collapses to(None, None)alongsideNOT_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_DISABLEDcollapses 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— addedtest_feature_disabled_is_treated_as_no_config(parametrized) andtest_feature_disabled_is_no_recommendation, mirroring the existingNOT_FOUNDtests. 54 passed.uv run ruff check— clean.This pull request and its description were written by Isaac.