[AIGTWY-4756] Cache managed config reads for 5 min between launches - #696
Merged
Merged
Conversation
david-siqi-liu
marked this pull request as ready for review
September 16, 2026 23:21
david-siqi-liu
force-pushed
the
david/ug-configure-ttl
branch
2 times, most recently
from
September 17, 2026 15:12
998c1c1 to
d13cac1
Compare
Unity Gateway fetched the workspace managed coding-agent config from the control plane on every non-dry-run launch, even when it had just been read. Reuse a read younger than a 5-minute TTL so back-to-back launches stop re-fetching, while every `ug configure` path reads fresh. - refresh_managed_config gains force_refresh; launches use the cache by default, and the configure paths pass force_refresh=True (including the AI-tools install gate, which runs only during configure). - Persist retrieved_at plus an outcome (published / none / feature_disabled) as wrapper metadata, leaving the raw config verbatim for ug export. - Invalidate the cache on a missing, unparseable, or future-dated stamp, a wrong workspace, or an age at/over the TTL; failed refreshes never advance the stamp, so a stale read cannot masquerade as fresh. - Harden read_json_safe against non-UTF-8 bytes so a corrupted cache file read on every launch reads as absent rather than crashing the launch. - Add a managed integration test: a launch within the TTL reuses the cached read (retrieved_at unchanged), and a backdated stamp forces a fresh read. Co-authored-by: Isaac <no-reply@databricks.com>
david-siqi-liu
force-pushed
the
david/ug-configure-ttl
branch
from
September 17, 2026 15:25
d13cac1 to
8ac0eab
Compare
lilly-luo
reviewed
Sep 17, 2026
lilly-luo
approved these changes
Sep 17, 2026
lilly-luo
approved these changes
Sep 17, 2026
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.
Unity Gateway fetched the workspace managed coding-agent config from the control plane on every non-dry-run launch, even when it had just been read. This reuses a recent read so back-to-back launches stop re-fetching, while
ug configurealways reads fresh.ug configurereads fresh instead, both the main path andug configure --agent(whose only managed read is the AI-tools install gate), so it never decides from a since-changed config.ug export.Successful no-config and feature-disabled reads are cached for the TTL, so after an admin enables the feature or publishes a config a launch may take up to five minutes to pick it up;
ug configurereads fresh and is unaffected. Dynamic budget recommendation reads stay per-launch, unchanged.This pull request and its description were written by Isaac.