Skip to content

Refresh Claude gateway model cache before discovery launches - #766

Closed
andy-xu-db wants to merge 5 commits into
mainfrom
andy/claude-startup-model-cache
Closed

andy-xu-db wants to merge 5 commits into
mainfrom
andy/claude-startup-model-cache

Conversation

@andy-xu-db

@andy-xu-db andy-xu-db commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Claude can reuse a gateway-model cache from an earlier launch even when the selected provider or Unity Catalog location changes. When UG enables gateway discovery, fetch the configured catalog before starting Claude and atomically replace gateway-models.json. Abort launch if discovery or the cache write fails.

Reuse the generated routing headers, existing authentication helpers, atomic JSON writer, and Anthropic request helper. Ordinary launches reuse the discovery token; relayed discovery reuses the proxy's cached token unless custom OAuth selects a different credential source. Follow pagination, honor CLAUDE_CONFIG_DIR, and refresh relayed launches after the proxy's final port is known. Production changes are limited to the Claude launcher and Databricks catalog helpers.

This replaces the startup-refresh portion of #622. It does not add session locking or isolate concurrent Claude sessions sharing a config directory.

Validation

  • Claude, Databricks, gateway proxy, CLI, and integration-contract suites: 901 tests passed before the final test-only update. Existing tests assert one token lookup per ordinary launch and reuse of the relay token.
  • After removing the inference task: all 4 integration-contract tests, test lint/format checks, runner help, and git diff --check passed. Production lint and type checks passed previously.
  • The managed Claude journey restarts with a real existing cache, asserts a fresh timestamp, and reopens the real model picker. It intentionally tests discovery/cache behavior, not inference. The added file-reading task was removed at the user's request because it unnecessarily required a working upstream inference key for this cache test.
  • Live integration was not run locally because no explicit e2e workspace/credential was supplied; CI runs that journey.

@lilly-luo lilly-luo added the ug0.2-launch-blocker Launch Blocker for UG 0.2 label Sep 21, 2026
@andy-xu-db andy-xu-db closed this Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ug0.2-launch-blocker Launch Blocker for UG 0.2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants