ide на основе vs code
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
> Generated by super-planner; re-scoped 2026-06-24 after the original > approach hit a confirmed SDK bug. Source: roadmap.md (phase 18).
Status: implemented
Introduce the single transport-branch seam that selects how ClaudeAgent obtains its model list — proxy → `ICopilotApiService.models()` (today's path, unchanged) vs native → `Query.supportedModels()` (built-ins) — with the proxy hardcoded on (TODO(Phase 19)). This replaces the abandoned "unify on gateway-discovery supportedModels()" plan (a confirmed Claude SDK bug makes that unworkable — see Background). The seam is structured so that, once Anthropic fixes the SDK, collapsing proxied onto supportedModels() is a couple-line change.
The original Phase 18 set CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1 so the SDK would discover models from ClaudeProxyService's /v1/models and the agent would read them via Query.supportedModels() — one model call for both modes. Proven not to work on a brand-new query (SDK 0.3.169 *and* latest 0.3.191 / bundled CLI 2.1.191):
initialize() does not await gateway discovery — timing probe shows startup() resolves ~1.5s before the delayed /v1/models response arrives. Discovery is fire-and-forget; discovered models land in ~/.claude/cache/gateway-models.json *after* this.initialization resolved.
supportedModels() is a one-shot snapshot (`return (await this.initialization).models) with **no models_changed push** to refresh it (unlike commands_changed`), no refresh control request, and no blocking flag.
only on a *warm-cache* second startup. CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 (set by proxied buildOptions) also suppresses discovery entirely.
Standalone repro for the upstream team: ~/claude-sdk-model-discovery-repro (prints "BUG CONFIRMED"). Until Anthropic ships a fix (await-before-init, or a models_changed push), we do not route any model list through discovery-supportedModels().
In scope
ClaudeAgent._isProxyEnabled(): boolean returning true (hardcoded) with // TODO(Phase 19): read RootConfigState ClaudeUseCopilotProxy.
branch point**: proxy → existing ICopilotApiService.models() path; native → throw new Error('TODO: Phase 19') (unreachable while the flag is true).
createClaudeThinkingLevelSchema / isClaudeEffortLevel, common/claudeModelConfig.ts:105-126) so a future ModelInfo → IAgentModelInfo projection can reuse it. No native projection is built here.
Out of scope (all Phase 19)
Query.supportedModels() branch + fromSdkModelInfo projection +the enumeration-query lifecycle.
RootConfigState (ClaudeUseCopilotProxy) read, onDidRootConfigChange, and the ClaudeTransport refactor.
/v1/models enrichment, any picker-behaviorchange. (Retired with the original approach.)
supportedModels()) — adocumented follow-up gated on the upstream fix.
ClaudeAgent, proxy, _refreshModels exist).CAPI exactly as today).
Extract the model-list source behind _isProxyEnabled(). The proxy branch is literally today's _refreshModels body (CAPI models() → isClaudeModel filter → toAgentModelInfo projection → is_chat_default sort → publish, with the tokenAtStart stale-write guard). The native branch is a typed TODO: Phase 19 throw. Pull the effort-schema construction into a shared helper so Phase 19's ModelInfo projection can call the same code. Nothing else changes — no new env vars, no enumeration query, no proxy edits.
1. Add `_isProxyEnabled()` + branch the model refresh. ✓ Introduce private _isProxyEnabled(): boolean { return true; /* TODO(Phase 19): read RootConfigState ClaudeUseCopilotProxy */ }. In _refreshModels (optionally rename to _resolveModels), branch: if proxy → existing CAPI path; else → throw new Error('TODO: Phase 19').
_refreshModels); add the helper near it.models observable still populates from CAPI in proxy mode; a unit test that forces the native branch (e.g. via a test seam or by temporarily flipping the helper) asserts it throws TODO: Phase 19.2. Factor the effort/config-schema helper for reuse. ✓ Ensure the effort schema construction used by toAgentModelInfo is a standalone function (createClaudeThinkingLevelSchema already is) callable from a future ModelInfo projection, so Phase 19 doesn't duplicate it. No behavior change.
toAgentModelInfo), common/claudeModelConfig.ts.toAgentModelInfo builds its configSchema via the shared helper; existing model tests still green.| Path | Change | Notes | |------|--------|-------| | claudeAgent.ts | modify | Add _isProxyEnabled() (hardcoded true + TODO(Phase 19)); branch _refreshModels; native branch throws TODO: Phase 19 | | common/claudeModelConfig.ts | modify (maybe) | Confirm effort-schema construction is a reusable standalone helper | | test/node/claudeAgent.test.ts | modify | Keep the proxied model suite green; add a test that the native branch throws TODO: Phase 19 |
supportedModels(), chosen at one branch point; proxy hardcoded true with a TODO(Phase 19). The SDK gateway-discovery bug (Background) makes the original single-supportedModels() unification unworkable today. Structured so the eventual fix is a couple-line swap.
today (direct CAPI). No enumeration query, no discovery flag, no proxy edits — so no first-paint regression and no dependency on the buggy code path.
unreachable while _isProxyEnabled() returns true, so shipping the throw is safe.
do not introduce the ClaudeTransport union or projection machinery here (that's Phase 19). → Scope is deliberately tiny.
_isProxyEnabled() before Phase 19, the throw surfaces. → The TODO: Phase 19 message is explicit; a unit test pins the throw.
claudeAgent.test.ts proxied model suite passes unchanged (list, defaultordering, multiplier/policy metadata, stale-write guard).
TODO: Phase 19.npm run typecheck-client, npm run valid-layers-check.launch (.agents/skills/launch). Log skill: code-oss-logs (.github/skills/code-oss-logs).
--agents, sign in to Copilot, open the Agents window with Claude selected, open the model picker → confirm the list, default ordering, and cost-multiplier rendering are identical to today (this phase must not change proxied behavior). code-oss-logs → agent host log shows the usual CAPI models() fetch, no SDK enumeration subprocess.
gateway discovery dead, Phase 18's surface is ~1 helper + 1 branch. The user chose to keep it as the seam (proxy hardcoded true + TODO). owner: user (resolved — keep as thin phase); resolve by: n/a.
RootConfigState key (ClaudeUseCopilotProxy) so the flip is a one-line body change. owner: implementer, resolve by: step 1.
~/claude-sdk-model-discovery-reprolaunch, code-oss-logs, unit-tests> super-implementer run 2026-06-24. The original gateway-discovery approach was > empirically disproven (see Background); the phase was re-scoped to this > workaround. Implemented under the new scope.
query's supportedModels() does not include gateway-discovered models because initialize() doesn't await discovery and there is no models_changed push. Timing/cold-warm evidence captured in the standalone repro (~/claude-sdk-model-discovery-repro). Filed for upstream.
supportedModels() (Phase 19), one branch point, proxy hardcoded true + TODO(Phase 19). Trivial future unification once the SDK is fixed.
claudeAgent.ts: added private _isProxyEnabled(): boolean (hardcoded true, TODO(Phase 19) to read RootConfigState ClaudeUseCopilotProxy). Extracted the transport branch as a pure exported function resolveClaudeModelList(isProxyEnabled, fetchProxyModels) — proxy → fetchProxyModels(), native → throw new Error('TODO: Phase 19'). _refreshModels now calls it, delegating the proxied CAPI path to a new _fetchProxyModels(token) (today's body verbatim: models() → isClaudeModel → is_chat_default sort → toAgentModelInfo, behind the tokenAtStart stale-write guard). The pure function (not a private method) is the test seam, per the repo guideline against testing private methods directly.
createClaudeThinkingLevelSchema and isClaudeEffortLevel are already standalone exports in common/claudeModelConfig.ts, and toAgentModelInfo already builds its configSchema via the former. The helper is already reusable by a future Phase 19 ModelInfo projection; nothing to factor.
test/node/claudeAgent.test.ts: added two unit tests on resolveClaudeModelList (proxy source returns the proxy list; native branch throws TODO: Phase 19). Full file suite green (132 passing), including the unchanged proxied model suite (list, default ordering, multiplier/policy metadata, stale-write guard).
npm run typecheck-client clean; npm run valid-layers-check clean. E2E launch (launch + code-oss-logs) intentionally skipped: proxied behavior is byte-identical to today (the workaround only adds an unreachable native branch), so the existing proxied model suite + manual parity are the effective regression gate.