Skip to content

fix(upstreams): show cached models when opening editor - #537

Merged
Menci merged 1 commit into
mainfrom
fix/upstream-editor-cached-models
Sep 24, 2026
Merged

Menci merged 1 commit into
mainfrom
fix/upstream-editor-cached-models

Conversation

@Menci

@Menci Menci commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Show the saved model catalog on upstream editor entry through the existing single-record GET, without waiting for upstream model discovery.
  • Preserve Custom auto-discovery rows in the cache even when manual overrides or unroutable rerank models exclude them from the effective catalog.
  • Remove unused editor loader requests and initial error state. Keep two WebSocket tests independent of live Copilot requests.

Existing Custom caches without an auto-discovery snapshot remain valid; their auto rows appear after the next model refresh.

Test Plan

  • Run pnpm run verify (585 test files, 6291 tests, installer harness, lint, typecheck, repository checks, and web build).
  • Confirm all PR CI checks pass.

Read model rows from the saved upstream snapshot on editor entry without waiting for discovery. Keep Custom discovery alongside the routable cache so overridden and rerank rows remain editable after reload.

Remove unused editor loader requests and initial error state, cover cached/cold/empty catalog behavior, and make two WebSocket tests use their existing mocked upstream.
@Menci
Menci merged commit 3be39e3 into main Sep 24, 2026
8 checks passed
yyyr-p added a commit to yyyr-p/Floway that referenced this pull request Sep 24, 2026
Integrates upstream commits e286553..b636cfd:
- refactor(gateway): decouple model catalog reads from refresh (Menci#410)
- fix(upstreams): show cached models when opening editor (Menci#537)
- fix(gateway): fall back to fetch on Cloudflare socket rejection (Menci#532)
- fix(responses): decrypt compaction summary aliases (Menci#530)
- fix(web): keep request header labels readable (Menci#531)
- fix(gateway): tolerate flat argument echoes in collaboration shim (Menci#529)

Conflict resolutions:
- data-plane/models/http.ts: adopt Menci#410's decoupled catalog signature
  (createModelsRefreshScheduler, loadModels(upstreamIds, scheduleRefresh,
  aliasRepo)) while preserving the fork's Claude Desktop UA admission
  (isClaudeCodeDiscoveryUserAgent) that upstream's renamed
  isClaudeCodeUserAgent no longer covers.
- control-plane/routes.ts: union the schema imports — fork's OAuth2 admin
  bodies plus upstream's previewModelsBody from Menci#410; drop listModelsBody
  (removed by Menci#410).
- data-transfer/routes_test.ts: union type imports and keep the fork's
  OAuth2 test fixtures; UpstreamRecord -> StoredUpstreamRecord (Menci#410 rename).
- http_test.ts / users/routes_test.ts: migrate repo.upstreams.save() calls
  to saveUpstreamForTest() (UpstreamRepo.save was split into
  insertForModels/replaceForModels by Menci#410) and bare requestApp() calls to
  requestAppWithWarmModels() since Menci#410 serves persisted catalogs on cold
  reads.
- migrations: renumber upstream's 0085_upstream_config_version.sql to
  0091_upstream_config_version.sql to avoid colliding with the fork's
  0085_oauth2_providers.sql; the two alter independent tables so apply
  order is unaffected. Update the backoff and migrate tests' filename
  references.

Verified with pnpm run verify (typegen, lint, typecheck, 595 test files,
test:installers, check:agents-md, check:generated-assets,
check:verify-parity, build:web).
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