Skip to content

[AIGTWY-4573] Apply static/auto model curation to each agent's /model picker - #547

Closed
david-siqi-liu wants to merge 3 commits into
david/AIGTWY-4573from
david/AIGTWY-4573-model-picker
Closed

david-siqi-liu wants to merge 3 commits into
david/AIGTWY-4573from
david/AIGTWY-4573-model-picker

Conversation

@david-siqi-liu

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

Copy link
Copy Markdown
Collaborator

Stacked on #545 (branch david/AIGTWY-4573), merge that first. This is the second half of AIGTWY-4573: now that the client parses the config (including the static models.names list and model_service_location), turn each agent's model source into its own /model picker.

  • managed_resolve: expose managed_static_models + managed_model_service_location, count them in managed_supplies_models so ucode skips its own discovery, and layer them into state for the Claude/Codex writers.
  • Claude: a static list becomes availableModels + enforceAvailableModels + a modelPicker that replaces the built-in options, so /model shows exactly the named ids (including non-Claude gateway models, which discovery alone omits); a discovery location instead turns on gateway model discovery. Both are skipped under a provider or relayed launch, and stale picker keys are pruned when the config drops its list.
  • Codex: a static list is written as a model_catalog_json catalog of full ModelPresets (Codex's StaticModelsManager replaces remote discovery); auto needs no catalog, since the provider base_url already drives Codex's discovery. The catalog file is removed when the list goes away.

Verified: render_overlay writes the expected Claude keys, and the generated Codex catalog is accepted by the real Codex 0.146.1 (codex debug models renders exactly the listed models with visibility: "list"). The pickers are soft curation (they do not fence an explicit --model); hard governance stays gateway-side. The Codex preset's runtime-behavior fields (base_instructions, truncation_policy, etc.) are generic defaults, sufficient for the /model listing this PR targets; per-model behavior tuning is a follow-up.

This pull request and its description were written by Isaac.

@david-siqi-liu
david-siqi-liu marked this pull request as ready for review September 9, 2026 23:53
@david-siqi-liu
david-siqi-liu force-pushed the david/AIGTWY-4573-model-picker branch from 4eab7d0 to b27b6c5 Compare September 10, 2026 01:04
@david-siqi-liu
david-siqi-liu force-pushed the david/AIGTWY-4573-model-picker branch from b27b6c5 to 714cb0f Compare September 10, 2026 03:11
@david-siqi-liu
david-siqi-liu force-pushed the david/AIGTWY-4573-model-picker branch from 714cb0f to a7fdf68 Compare September 10, 2026 20:38
@david-siqi-liu
david-siqi-liu force-pushed the david/AIGTWY-4573-model-picker branch 2 times, most recently from 38a8d9f to ca6e3f9 Compare September 10, 2026 21:33
@david-siqi-liu
david-siqi-liu force-pushed the david/AIGTWY-4573-model-picker branch 2 times, most recently from 75f55d4 to 37567e9 Compare September 11, 2026 05:35
@david-siqi-liu
david-siqi-liu force-pushed the david/AIGTWY-4573-model-picker branch from 37567e9 to cd97bcc Compare September 11, 2026 11:46
@david-siqi-liu
david-siqi-liu force-pushed the david/AIGTWY-4573-model-picker branch from cd97bcc to 6d748aa Compare September 11, 2026 12:43
@david-siqi-liu
david-siqi-liu force-pushed the david/AIGTWY-4573-model-picker branch from 6d748aa to 7614465 Compare September 11, 2026 14:48
@david-siqi-liu
david-siqi-liu force-pushed the david/AIGTWY-4573-model-picker branch from 7614465 to 916cbc1 Compare September 11, 2026 15:58
@david-siqi-liu
david-siqi-liu force-pushed the david/AIGTWY-4573-model-picker branch from 916cbc1 to c6ac063 Compare September 11, 2026 18:36
@david-siqi-liu
david-siqi-liu force-pushed the david/AIGTWY-4573-model-picker branch from c6ac063 to 8ef7673 Compare September 11, 2026 18:50
@david-siqi-liu
david-siqi-liu force-pushed the david/AIGTWY-4573-model-picker branch from 8ef7673 to 988956a Compare September 11, 2026 18:56
@david-siqi-liu
david-siqi-liu force-pushed the david/AIGTWY-4573-model-picker branch from 988956a to 3c48380 Compare September 11, 2026 21:33
@david-siqi-liu
david-siqi-liu force-pushed the david/AIGTWY-4573-model-picker branch from 3c48380 to 2dab9ad Compare September 12, 2026 01:14
@david-siqi-liu
david-siqi-liu force-pushed the david/AIGTWY-4573-model-picker branch from 2dab9ad to 5664402 Compare September 12, 2026 02:08
@david-siqi-liu
david-siqi-liu added this pull request to stack #582 September 12, 2026 14:02
@david-siqi-liu david-siqi-liu changed the title [AIGTWY-4573] Apply v2 static/auto model curation to /model picker [AIGTWY-4573] Apply static/auto model curation to each agent's /model picker Sep 12, 2026
@david-siqi-liu
david-siqi-liu force-pushed the david/AIGTWY-4573-model-picker branch 2 times, most recently from 473036a to fa053c3 Compare September 13, 2026 01:56
@david-siqi-liu
david-siqi-liu force-pushed the david/AIGTWY-4573-model-picker branch from fa053c3 to f0c5fd2 Compare September 13, 2026 02:24
@david-siqi-liu
david-siqi-liu force-pushed the david/AIGTWY-4573-model-picker branch from f0c5fd2 to 521182e Compare September 13, 2026 02:56
david-siqi-liu and others added 3 commits September 13, 2026 11:54
Both the Claude picker and the Codex catalog need the same two inputs from the managed config: an
explicit static model allow-list and a model-service discovery location. Add those shared resolvers
and thread them into state, ahead of the two agent-specific consumers, so the shared logic is
reviewed once. Stacked on the launch-apply PR (david/AIGTWY-4573).

- managed_resolve: add managed_static_models and managed_model_service_location; extend
  managed_state_overrides to populate claude_static_models / codex_static_models and the per-agent
  model_service_location state keys; extend _manifest_models and managed_supplies_models to
  recognize flat-list agents and the static-list / discovery-location sources. For codex a location
  alone does not count as supplying models (codex has no discovery-location reader), so discovery
  still runs; for claude it does.

Co-authored-by: Isaac <no-reply@databricks.com>
When the managed config pins a static model list, write Claude's availableModels,
enforceAvailableModels, and modelPicker so /model shows exactly those models; when it names a
discovery location instead, turn on gateway model discovery. Ownership markers let ug prune the keys
it wrote on a later static-to-discovery transition without clobbering an admin-authored picker, and
are cleared only when the managed file was actually written. Stacked on the shared-helpers PR
(david/AIGTWY-4573-managed-picker-helpers).

- claude: render the picker keys from claude_static_models, or enable discovery from
  claude_model_service_location; add ownership-marker state keys and pruning in the managed and
  private compose paths. Both skipped under a provider/relayed launch. The server guarantees every
  default_alias_models value is one of models.names, so a family default is never hidden.

Co-authored-by: Isaac <no-reply@databricks.com>
When the managed config pins a static model list for Codex, fetch the real gateway model catalog,
filter it to the allow-list preserving each full ModelPreset and the gateway ordering, and write it
to ~/.codex/ucode-models.json, pointing Codex at it through model_catalog_json so /model shows
exactly those models. On a fetch failure the existing catalog is preserved (a transient blip does
not wipe it); a successful-but-empty result falls back to discovery. Stacked on the Claude-picker
PR (david/AIGTWY-4573-claude-picker).

- codex: add _fetch_gateway_codex_models and build_codex_catalog (None preserves on fetch failure,
  an empty dict falls back to discovery, a payload writes the catalog); add model_catalog_json to
  the managed keys and render_overlay; drop a stale provider-service header via one
  _strip_provider_header helper when moving off a provider or a static list.
- README: document the Claude picker and the Codex catalog, and the ucode-models.json managed file.

Co-authored-by: Isaac <no-reply@databricks.com>
@david-siqi-liu
david-siqi-liu force-pushed the david/AIGTWY-4573-model-picker branch from 521182e to 87cc0a4 Compare September 13, 2026 12:05
@david-siqi-liu

Copy link
Copy Markdown
Collaborator Author

Superseded by the finer-grained AIGTWY-4573 stack: this PR's content is now split into #591 (shared managed_resolve helpers), #592 (Claude picker), and #594 (Codex catalog). See #590 for the stack map.

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