ide на основе vs code
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
> Generated by super-planner (council-plan: GPT-5.5 + Claude Opus 4.6 + GPT-5.3-Codex). > Source: roadmap.md (phase 19). > Last updated: 2026-06-24 after grill session.
Status: implemented
Make the Copilot-CAPI proxy optional, selected by a single host-level RootConfigState property, so the Claude provider can talk to Anthropic directly on the user's own credentials (ANTHROPIC_API_KEY, a claude login OAuth session in ~/.claude, or a cloud-provider config). All proxy-only plumbing is quarantined behind a ClaudeTransport discriminated union, and the native model picker that Phase 18 stubbed (TODO: Phase 19) is built on the SDK's Query.supportedModels(). The proxied path stays the unchanged default.
In scope
AgentHostConfigKey.ClaudeUseCopilotProxy RootConfigState boolean (schema default: true), read via IAgentConfigurationService.getRootValue and made reactive via onDidRootConfigChange.
ClaudeTransport discriminated union ({ kind: 'proxy'; handle: IClaudeProxyHandle } | { kind: 'native' }) resolved once into a _transportMode on ClaudeAgent and threaded as data through IMaterializeContext → buildOptions / buildSubprocessEnv.
authenticate, getProtectedResources, _ensureAuthenticated,and credits-subscription gating.
IClaudeAgentSdkService.query(...) passthrough to the SDK's query export; ClaudeAgent._fetchNativeModels owns the enumeration lifecycle (query(neverYield) → Query.supportedModels() → Query.close()), plus a fromSdkModelInfo(...) projection reusing the Phase 18 effort-schema helpers. Flip _isProxyEnabled() to the real config read and branch the native model source in _refreshModels.
ChatUsage carries the SDK result usage/cost; surface apiKeySource from system/init for diagnostics.
claude.transport tag persisted on the session overlay atmaterialize time (host-level resolution only; no per-session *selection*).
Out of scope
claude.transport tag is persisted on the session overlay now (decided during grilling) so the follow-up needs no migration, but no per-session *resolution* is implemented. (Roadmap Phase 19 "Open questions".)
SDK's own credential resolution handles cloud-provider env vars implicitly, but they are not a tested/documented v1 surface (decided during grilling).
supportedModels() through the proxy) — a documented follow-up gated on the upstream SDK discovery bug (Phase 18 Background).
fetchProxyModels) throws TODO: Phase 19 on the native branch; _isProxyEnabled() is hardcoded true; _fetchProxyModels(token) is the CAPI path; createClaudeThinkingLevelSchema / isClaudeEffortLevel` are standalone in common/claudeModelConfig.ts.
getRootValue / agentConfigurationService.ts:194, onDidRootConfigChange / agentConfigurationService.ts:46, fired on RootConfigChanged (:145).
Query.supportedModels(): Promise<ModelInfo[]>(sdk.d.ts:1808).
Resolve the transport once from ClaudeUseCopilotProxy into a _transportMode: 'proxy' | 'native' on ClaudeAgent, kept current by an onDidRootConfigChange subscription that re-resolves and refreshes models (affecting future sessions only — never an in-flight subprocess). Build a ClaudeTransport value at each materialize/resume and pass it as data through IMaterializeContext into buildOptions / buildSubprocessEnv, where the proxy branch is preserved byte-for-byte and the native branch omits ANTHROPIC_BASE_URL / ANTHROPIC_AUTH_TOKEN and keeps the inherited ANTHROPIC_API_KEY (while still stripping VSCODE_* / ELECTRON_* / NODE_OPTIONS). The native model picker is fed by a new IClaudeAgentSdkService.supportedModels() that runs the ephemeral startup() → warm.query(<non-yielding prompt>) → Query.supportedModels() → teardown lifecycle and projects ModelInfo → IAgentModelInfo with no commercial-metadata overlay.
1. ✓ Add the `ClaudeUseCopilotProxy` root config key. Extend AgentHostConfigKey and agentHostCustomizationConfigSchema with a boolean property (schemaProperty<boolean>({ type: 'boolean', …, default: true })), mirroring EnableCustomTerminalTool / RubberDuck. Do not add it to defaultAgentHostCustomizationConfigValues (that object only seeds Customizations); the schema default: true is what getRootValue returns when the key is absent.
getRootValue(agentHostCustomizationConfigSchema, ClaudeUseCopilotProxy) returns true when unset, false when persisted false.2. ✓ Define the `ClaudeTransport` union. A discriminated union { kind: 'proxy'; handle: IClaudeProxyHandle } | { kind: 'native' }. Place it in a small new module claudeTransport.ts so claudeAgent.ts, claudeAgentSession.ts, and claudeSdkOptions.ts share it without an import cycle.
3. ✓ Refactor `buildOptions` / `buildSubprocessEnv` to consume the transport. Replace the proxyHandle: IClaudeProxyHandle parameter on buildOptions with transport: ClaudeTransport. Proxy branch: identical env (set ANTHROPIC_BASE_URL = handle.baseUrl, ANTHROPIC_AUTH_TOKEN = ${handle.nonce}.${sessionId}, strip ANTHROPIC_API_KEY). Native branch: omit both proxy vars and do not strip ANTHROPIC_API_KEY. Give buildSubprocessEnv a stripAnthropicApiKey: boolean parameter (default true so existing callers/tests are unaffected); native passes false. Both modes keep stripping VSCODE_* / ELECTRON_* / NODE_OPTIONS.
buildOptions L69, env block L82-86, buildSubprocessEnv L148-168).ANTHROPIC_API_KEY.4. ✓ Thread the transport through materialization. Replace IMaterializeContext.proxyHandle with transport: ClaudeTransport. Update materialize() and the rematerializer closure to pass ctx.transport into buildOptions.
IMaterializeContext L57-69, materialize ~L315, rematerializer ~L405).transport and the proxied path's captured Options are unchanged.5. ✓ Flip `_isProxyEnabled()` to the real config read + reactivity. Resolve a _transportMode: 'proxy' | 'native' field in the constructor from getRootValue(...) ?? true. Subscribe to onDidRootConfigChange: re-read, update _transportMode, and on change re-run _refreshModels() and re-resolve proxy ownership (acquire/dispose the proxy handle as needed). _isProxyEnabled() becomes this._transportMode === 'proxy'. Config changes affect future sessions only.
_isProxyEnabled ~L384, constructor ~L300)._transportMode and re-refreshes models; in-flight sessions are untouched.6. ✓ Make auth / protected-resources / credits transport-aware. In native mode: authenticate() does not call IClaudeProxyService.start; _ensureAuthenticated() returns the native transport without requiring a proxy handle; getProtectedResources() omits GITHUB_COPILOT_PROTECTED_RESOURCE (keep GITHUB_REPO_PROTECTED_RESOURCE); the constructor's onDidReportCredits subscription is inert (no proxy fires it) — guard _enrichSignalWithCredits on proxied transport for explicit intent. _materializeProvisional / _resumeSession build a ClaudeTransport from _transportMode and put it in IMaterializeContext. Persist a claude.transport ('proxy' | 'native') tag on the session overlay at materialize time (forward-compat; not read for resolution in v1).
getProtectedResources ~L325, _ensureAuthenticated ~L332, authenticate ~L344, credits sub ~L310, _materializeProvisional ~L577, _resumeSession ~L620); claudeAgentSession.ts (_enrichSignalWithCredits L227); claudeSessionMetadataStore.ts (new transport overlay field).start, never subscribes credits, omits the Copilot resource, never throws AHP_AUTH_REQUIRED; the overlay carries the transport tag; proxied path unchanged.7. ✓ Build the native model source. Add IClaudeAgentSdkService.supportedModels(opts): Promise<readonly ModelInfo[]> that owns the ephemeral lifecycle startup({ options }) → warm.query(<a prompt iterable that never yields>) → query.supportedModels() → teardown (supportedModels is on Query, reached via warm.query() — not on WarmQuery). Add fromSdkModelInfo(m: ModelInfo, provider): IAgentModelInfo (exported, beside toAgentModelInfo): id ← m.value, name ← m.displayName, supportsVision: false, configSchema ← createClaudeThinkingLevelSchema((m.supportedEffortLevels ?? []).filter(isClaudeEffortLevel)), no policyState, no _meta. Replace the resolveClaudeModelList native throw with () => this._fetchNativeModels().
IClaudeAgentSdkService L41-60 + impl); claudeAgent.ts (fromSdkModelInfo near toAgentModelInfo, _fetchNativeModels, resolveClaudeModelList native branch L126-135).models populates from a stubbed supportedModels(); no ICopilotApiService.models() call; no new IClaudeSdkBindings drift-guard entry (supportedModels is a Query method, not a module export).8. ◐ Native usage + diagnostics. recordTurnCredits / _enrichSignalWithCredits no-op in native (no proxy reports); ChatUsage carries the SDK result usage/cost the live mapper already extracts. Surface system/init.apiKeySource (SDKSystemMessage) for diagnostics / per-turn metadata.
recordTurnCredits L215, _enrichSignalWithCredits L227); claudeMapSessionEvents.ts (system/init handling).ChatUsage has no _meta.copilotUsage and carries SDK usage/cost; apiKeySource is logged/surfaced.9. ✓ Tests. Make FakeQuery.supportedModels() programmable (it throws today); add supportedModelsResult to FakeClaudeAgentSdkService. Replace the Phase 18 TODO: Phase 19 native-branch assertion with a native projection assertion. Add: transport resolution from the root value; onDidRootConfigChange flip; native authenticate makes no start call; native getProtectedResources omits Copilot; proxy-vs-native buildOptions env snapshots; buildSubprocessEnv(false) preserves ANTHROPIC_API_KEY; fromSdkModelInfo projection; native ChatUsage has no copilotUsage; credential-absent (SDK 401) surfaces an actionable error and leaves models empty.
| Path | Change | Notes | |------|--------|-------| | common/agentHostCustomizationConfig.ts | modify | ClaudeUseCopilotProxy enum + boolean schema (default: true) | | claudeTransport.ts | create | ClaudeTransport discriminated union (+ optional isProxyTransport guard) | | claudeSdkOptions.ts | modify | buildOptions(transport), buildSubprocessEnv(stripAnthropicApiKey); native omits proxy env, keeps API key | | claudeAgentSession.ts | modify | IMaterializeContext.transport replaces .proxyHandle; gate credit enrichment on proxy | | claudeAgent.ts | modify | _transportMode + reactive read; mode-aware auth/resources/credits; fromSdkModelInfo; _fetchNativeModels; native resolveClaudeModelList branch | | claudeAgentSdkService.ts | modify | supportedModels() enumeration-lifecycle method (no new IClaudeSdkBindings entry) | | claudeSessionMetadataStore.ts | modify | persist forward-compat claude.transport overlay tag | | claudeMapSessionEvents.ts | modify (maybe) | surface system/init.apiKeySource | | test/node/claudeAgent.test.ts | modify | programmable FakeQuery.supportedModels; native transport/model/auth/credits suite | |
sdk.d.ts:1808; WarmQuery only exposes query(prompt): Query and close() (sdk.d.ts:4796). Native enumeration must startup() → warm.query(<non-yielding prompt>) → query.supportedModels() → teardown, encapsulated in IClaudeAgentSdkService so ClaudeAgent never touches the raw lifecycle. (One council member assumed warm.supportedModels(); that method does not exist.)
supportedModels is a Query method, not a top-level export of @anthropic-ai/claude-agent-sdk, so the binding-drift assertion in claudeAgentSdkService.ts:241-257 is unaffected; the new method composes existing startup + WarmQuery.query bindings.
ModelInfo carries value, displayName, description, supportsEffort?, supportedEffortLevels?: ('low'|'medium'|'high'|'xhigh'|'max')[], supportsAdaptiveThinking? (sdk.d.ts:903). Map value→id, displayName→name, effort levels through createClaudeThinkingLevelSchema; supportsVision: false (not in ModelInfo); no token limits, no policyState, no _meta.
SDKSystemMessage.apiKeySource, sdk.d.ts:2944), not a separate Query.accountInfo() call — it rides the init message the session already receives.
and threaded down; no new injected service (rejected as boilerplate by two council members).
Boolean keys (EnableCustomTerminalTool, etc.) rely on the schema default; getRootValue returns it when the key is absent.
own config plane (getRootValue + onDidRootConfigChange), reactive and identical for local and remote hosts. (Roadmap-mandated; council unanimous.)
depends on CCAModel pricing/policy fields; ModelInfo is a different shape. A separate fromSdkModelInfo keeps native metadata-free.
Anthropic credential, so in native mode _ensureAuthenticated returns the always-ready native transport (never throws AHP_AUTH_REQUIRED) and getProtectedResources drops the required GITHUB_COPILOT_PROTECTED_RESOURCE (keeps the optional repo resource). Resolves R5.
Most-private default — suppress nonessential Anthropic traffic even though the user is on their own credentials. (Note: this also suppresses gateway discovery, which native mode does not use — built-ins are unaffected.)
passes the user env through and lets the SDK resolve credentials; cloud providers may work implicitly but are not a tested/documented v1 surface.
transport host-level, but the per-session tag is written at materialize time so a future per-session-transport follow-up needs no data migration.
proxy env block (claudeSdkOptions.ts:82-86) and the ANTHROPIC_API_KEY strip (:148-168) are load-bearing. → Keep the proxy branch byte-identical; lock with a snapshot test and a buildSubprocessEnv default stripAnthropicApiKey = true.
warm.query() may write a transcript. → Resolve via the cwd / CLAUDE_CONFIG_DIR decision (see Decisions) and a finally teardown; add a test asserting native model refresh does not grow listSessions.
Snapshot the transport at materialize entry; the flip only affects new sessions. Document; never hot-swap a running subprocess.
value ids differ from CAPI-dotted ids. → The picker already degrades to models[0] (modelPicker.ts:144); toSdkModelId normalizes at the SDK seam.
createSession calls _ensureAuthenticated immediately. → In native mode _ensureAuthenticated returns the always-ready native transport (the SDK owns credentials); it must not throw AHP_AUTH_REQUIRED.
_assertBindingsMatchSdk. → Avoided by composing existing bindings (R-free), per Decisions.
runTests on test/node/claudeAgent.test.tsand test/node/claudeSdkOptions.test.ts.
npm run typecheck-client; npm run valid-layers-check. overlay), root-config flip → native, native makes no start call, native env keeps ANTHROPIC_API_KEY, fromSdkModelInfo projection, native ChatUsage without copilotUsage, credential-absent error.
launch (.agents/skills/launch) — Playwright-drive Code OSS --agents with isolated profile.
code-oss-logs (.github/skills/code-oss-logs) — read theagent host log from the latest dev run.
1. With a real ANTHROPIC_API_KEY (or claude login) in the environment, set claudeUseCopilotProxy to false in agent-host-config.json (or via an AHP client updateRootConfig). Use launch to open Code OSS --agents, select Claude, open the model picker. 2. Use code-oss-logs to read the agent host log: confirm no ClaudeProxyService.start line, no CAPI models() fetch, and a supportedModels enumeration instead; confirm the SDK subprocess has no ANTHROPIC_BASE_URL (e.g. lsof/log inspection) and the system/init log shows apiKeySource. 3. Send a turn; confirm it completes on the user's credentials and the usage pill shows SDK cost (no Copilot credits).
claudeUseCopilotProxy back to true → new sessions show Copilot-routed behavior, the proxy binds, the model picker and credits render exactly as before.
current-mode catalogue, resume succeeds, an unknown model id degrades to the default.
turn fails with an actionable error and models stays empty.
isolated CLAUDE_CONFIG_DIR. A real-SDK E2E against the user's signed-in claude subscription overturned it: reading the real `~/.claude` (a) surfaces the user's subscription models (e.g. opus) that the isolated dir hides, and (b) writes no session (listSessions delta = 0 across two enumerations) because the query is never iterated. Final: no isolation — buildModelEnumerationOptions() uses cwd = os.tmpdir() and the real config dir; the temp-dir dance was removed.
_refreshModels (no cache); the ephemeral query is cheap and _refreshModels fires only on auth / onDidRootConfigChange. No invalidation surface added.
ModelInfo (903), Query.supportedModels (1808), WarmQuery (4796), SDKSystemMessage.apiKeySource (2944)launch, code-oss-logs> super-implementer run 2026-06-24. TDD per step; unit suite green throughout.
ClaudeUseCopilotProxy enum + boolean schema (default: true).ClaudeTransport discriminated union (lives next to IClaudeProxyHandle, half of its union).buildOptions(transport), buildSubprocessEnv(proxied = true), new buildModelEnumerationOptions().IMaterializeContext.transport replaces .proxyHandle; _transportKind gates _enrichSignalWithCredits; persists claude.transport overlay tag at materialize._transportMode + _resolveTransportMode (reactive via onDidRootConfigChange); mode-aware getProtectedResources/_ensureAuthenticated (now returns ClaudeTransport)/authenticate; fromSdkModelInfo; _fetchNativeModelsbuildSubprocessEnv(false) keeps ANTHROPIC_API_KEY; proxy vs native buildOptions env (no ANTHROPIC_BASE_URL/ANTHROPIC_AUTH_TOKEN, no key strip); existing proxy calls moved to ClaudeTransport.resolveClaudeModelList (proxy + native branches); fromSdkModelInfo projection (no policyState/_meta); native getProtectedResources omits Copilot; native models populate from supportedModels() with no proxy start / no CAPI call; native authenticate makes no start call. Harness gained a rootConfig override; FakeClaudeAgentSdkService gained programmable supportedModels.IClaudeAgentSdkService.supportedModels is implemented by two other test fakes — added stub methods + ModelInfo imports to test/node/claudeSubagentResolver.test.ts and test/node/claudeAgent.integrationTest.ts.IAgentConfigurationService (DI injects undefined under non-strict mode). Production always provides it; absence resolves to the proxied default._transportKind !== 'proxy' guard plus the natural no-report path). Surfacing system/init.apiKeySource for diagnostics is deferred — see Deferred refactors; it's a non-blocking diagnostic that needs a small claudeMapSessionEvents.ts touch.SDKSystemMessage.apiKeySource on system/init for native diagnostics. Deferred to keep the mapper untouched this pass; low risk, no behavior dependency.startup → warm.query(neverYield) → query.supportedModels() → teardown) against the repo's @anthropic-ai/claude-agent-sdk and the user's signed-in claude subscription. supportedModels() returned a populated catalogue; reading the real ~/.claude surfaced the subscription's `opus` model; listSessions delta was 0 (no pollution). This overturned OQ1 (removed the ephemeral CLAUDE_CONFIG_DIR).runTests claudeAgent.test.ts + claudeSdkOptions.test.ts + claudeSubagentResolver.test.ts = 166 passing; npm run typecheck-client clean; npm run valid-layers-check clean. --agents with claudeUseCopilotProxy: false (seeded, restored after). The model picker rendered the native catalogue ("Default (recommended)" selected — an SDK model name, not a CAPI one), and the agent host log confirmed: [Claude] Models refreshed. Count: 5, Default (recommended), Sonnet, Sonnet (1M context), Haiku, Opus (the user's subscription Opus surfaced) with no Claude proxy start (the only "Auth token updated" line is the sibling [Copilot] agent). Drove via launch + @playwright/cli; read via code-oss-logs.
_resolveTransportMode, _fetchNativeModels, _fetchProxyModels, _ensureAuthenticated) are thin single-purpose orchestration; all genuinely testable logic is already extracted as pure exported functions (fromSdkModelInfo, resolveClaudeModelList, buildModelEnumerationOptions, buildSubprocessEnv) and unit-tested directly. No findings.query(neverYield) → supportedModels() → close()query(params) passthrough to the SDK's query export (no bespoke enumeration lifecycle).claude.transport overlay key (write + read).