From e260c897c4023b51aed0113c4f9e8276e75195cb Mon Sep 17 00:00:00 2001 From: asher <82265836+bytelazy@users.noreply.github.com> Date: Mon, 7 Sep 2026 10:22:26 +0800 Subject: [PATCH] docs(architecture): audit Model access slice under #3522 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Audit the two Model access documents against current main: - openai-responses-incremental-transport.md: verified accurate as written. Every cited symbol (ModelAdapter, endLane, previous_response_id, prompt_cache_key, the sdk.response.messages contrast) still exists with the semantics the document describes. No change. - model-metadata-firstscreen-optimization.md: partially implemented, not archivable. Verified done: OnboardingHero no longer imports RECOMMENDED_PROVIDER_TYPES at runtime. Not done: a static import chain still reaches provider-registry from the first screen (main.tsx -> app.tsx -> app-shell.tsx -> app-shell-overlays.tsx -> app-shell-command-actions.ts -> command-palette-commands.ts -> isRetiredProvider -> providerDefaultsOf -> PROVIDER_REGISTRY, built from the generated models.dev tables). Add an audit note recording this surviving chain so the document is not mistaken for an implemented proposal; keep it live under docs/ rather than archiving it. Address review on #4711: the original 'implemented, archivable' banner was wrong — two of its three factual claims fail. A static import chain still reaches provider-registry from the first screen via command-palette-commands' isRetiredProvider value import, which tree-shaking cannot drop because PROVIDER_REGISTRY is a used constant. Refs #3522 Generated-by: Claude (Claude Code) --- docs/model-metadata-firstscreen-optimization.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/model-metadata-firstscreen-optimization.md b/docs/model-metadata-firstscreen-optimization.md index b021a802a4..87baf3d189 100644 --- a/docs/model-metadata-firstscreen-optimization.md +++ b/docs/model-metadata-firstscreen-optimization.md @@ -17,6 +17,8 @@ under the License. --> +> **Audit note (2026-09-04, #4711):** This optimization is **partially** implemented. Verified done: `OnboardingHero` no longer imports `RECOMMENDED_PROVIDER_TYPES` at runtime (it uses a local `FIRST_RUN_PROVIDER_TYPES` constant; `onboarding-hero.tsx:27` is `import type` only). Not done: a static import chain still reaches `provider-registry` from the first screen — `main.tsx` → `app.tsx` → `app-shell.tsx` → `app-shell-overlays.tsx` → `app-shell-command-actions.ts` → `command-palette-commands.ts` → `isRetiredProvider` (a value import) → `providerDefaultsOf` → `PROVIDER_REGISTRY`, which is constructed from the generated models.dev tables (`provider-registry.ts:24`). Tree-shaking cannot drop it: `PROVIDER_REGISTRY` is a used constant. The document is retained as a live design record until that chain is broken (e.g. by extracting the small retirement predicate out of `provider-registry`). + # perf(desktop): remove models.dev metadata from the renderer startup path