Skip to content

[AIGTWY-4573] Consume v2 coding-agent config + TTL-gate refresh - #545

Open
david-siqi-liu wants to merge 1 commit into
mainfrom
david/AIGTWY-4573
Open

[AIGTWY-4573] Consume v2 coding-agent config + TTL-gate refresh#545
david-siqi-liu wants to merge 1 commit into
mainfrom
david/AIGTWY-4573

Conversation

@david-siqi-liu

@david-siqi-liu david-siqi-liu commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Stacked PR: #547 (david/AIGTWY-4573-model-picker) applies the model picker on top of this.

Prepares the ug client 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_config reads the v2 shape. enabled_agents stays a repeated list of {agent enum, config} (verified against the #2580860 proto — map keys can't be enums), and only the inner AgentConfig gained v2 fields: an AgentModels source (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 retains, so a pre-v2 config still normalizes. budget_id is read from the top level (v2 keeps it out of budget_policy).
  • spec_version forward-compat gate (this build supports up to 2): 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 #2580860 shape).
  • TTL-gates 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 #547.

This pull request and its description were written by Isaac.

Comment thread examples/managed-config.stub.json Outdated
"names": ["system.ai.pdf-extraction"],
"tags": []
},
"tracing": { "enabled": true },

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this live inside the agent specific config?

…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 / provider, 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. The spend policy is read from spend_tiers (v2 renamed
  budget_policy -> spend_tiers) with budget_policy as a legacy fallback; models.provider is read
  with model_provider_service as a legacy fallback.
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

quicktree-assisted PR created with quicktree-assisted workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants