[AIGTWY-4573] Consume v2 coding-agent config + TTL-gate refresh - #545
Open
david-siqi-liu wants to merge 1 commit into
Open
[AIGTWY-4573] Consume v2 coding-agent config + TTL-gate refresh#545david-siqi-liu wants to merge 1 commit into
david-siqi-liu wants to merge 1 commit into
Conversation
david-siqi-liu
marked this pull request as ready for review
September 9, 2026 21:41
david-siqi-liu
force-pushed
the
david/AIGTWY-4573
branch
3 times, most recently
from
September 9, 2026 23:36
8b2b16f to
48d71f8
Compare
david-siqi-liu
force-pushed
the
david/AIGTWY-4573
branch
from
September 10, 2026 00:30
48d71f8 to
b350053
Compare
…fresh
Prepare the ug client for the v2 CodingAgentConfig the AI Gateway will emit (AIGTWY-4572)
without regressing today's path, and stop every launch from re-fetching the config.
- normalize_managed_config reads the v2 shape: enabled_agents stays a repeated list of
{agent enum, config}, and the inner AgentConfig gained v2 fields (an AgentModels source of
names / model_service_location / model_provider_service, default_model, default_alias_models,
http_headers). The v2 fields win over the deprecated custom_headers / model_config oneof the
proto keeps, so a pre-v2 config still normalizes. budget_id is read from budget_policy (the API
wire returns it there, not top-level).
- spec_version forward-compat gate (build supports up to 1): a newer or malformed spec_version is
refused as an unresolved read, so the launch keeps its last-known-good cache.
- UCODE_MANAGED_CONFIG_STUB reads a local JSON config so the client can be exercised against v2
before the server emits it. See examples/managed-config-v2.stub.json (mirrors the 4572 wire).
- TTL-gate refresh_managed_config (MANAGED_CONFIG_TTL_SECONDS, 30 min): a fetched config is reused
without a control-plane round trip. Only a fetch stamps retrieved_at (a local ucode setup draft
never counts as fresh); an empty cache always re-fetches so no-config / feature-disabled stays
accurate; a failed re-fetch still falls back to cache; and ug <agent> --refresh forces a re-read.
recommendModel is untouched (still per launch).
The static models.names allow-list and model_service_location are parsed but not yet applied to
each agent's /model picker; that lands in the stacked follow-up.
Co-authored-by: Isaac <no-reply@databricks.com>
david-siqi-liu
force-pushed
the
david/AIGTWY-4573
branch
from
September 10, 2026 03:06
b350053 to
00910d9
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.
Stacked PR: #547 (
david/AIGTWY-4573-model-picker) applies the model picker on top of this.Prepares the
ugclient for the v2 CodingAgentConfig the AI Gateway will emit (AIGTWY-4572, estore v4 #2580860) without regressing today's path, and stops every launch from re-fetching the config.normalize_managed_configreads the v2 shape.enabled_agentsstays a repeated list of{agent enum, config}(verified against the #2580860 proto — map keys can't be enums), and only the innerAgentConfiggained v2 fields: anAgentModelssource (names/model_service_location/model_provider_service),default_model,default_alias_models,http_headers. The v2 fields win over the deprecatedcustom_headers/model_configoneof the proto retains, so a pre-v2 config still normalizes.budget_idis read from the top level (v2 keeps it out ofbudget_policy).spec_versionforward-compat gate (this build supports up to 2): a newer or malformedspec_versionis refused as an unresolved read, so the launch keeps its last-known-good cache.UCODE_MANAGED_CONFIG_STUBreads a local JSON config so the client can be exercised against v2 before the server emits it. Seeexamples/managed-config-v2.stub.json(mirrors the #2580860 shape).refresh_managed_config(MANAGED_CONFIG_TTL_SECONDS, 30 min): a fetched config is reused without a control-plane round trip. Only a fetch stampsretrieved_at(a localucode setupdraft never counts as fresh); an empty cache always re-fetches so no-config / feature-disabled stays accurate; a failed re-fetch still falls back to cache; andug <agent> --refreshforces a re-read.recommendModelis untouched (still per launch).The static
models.namesallow-list andmodel_service_locationare parsed but not yet applied to each agent's/modelpicker; that lands in #547.This pull request and its description were written by Isaac.