claudeAgent.ts ×5

Frontier kind: Code frontier

unlabeled · c_16b472159aff

159 tests · 53972 LOC · 346 files · introduces 0 tests · 28 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges28 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4940 ranges53972 lines · 346 files · Browse complete extent
All tests (intent)
159 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 28 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/claude/claudeAgent.ts 28 introduced LOC · 5 ranges

Open complete file

570 return true;
571 }
572 > const tokenChanged = this._githubToken !== token; claudeAgent.ts
573 if (!tokenChanged && this._proxyHandle) {
574 this._logService.info('[Claude] Auth token unchanged');
575 return true;
576 }
577 > // Acquire the new handle BEFORE committing the token or disposing claudeAgent.ts
578 > // the old one. If `start()` throws, leave `_githubToken` and
579 > // `_proxyHandle` untouched so the next `authenticate()` call still
580 > // sees the token as new and retries — otherwise a transient proxy
581 > // startup failure would leave us in a "token recorded, no proxy
582 > // running" state and the retry path would short-circuit as
583 > // "unchanged" and falsely return true.
584 > //
585 > // The proxy server's refcount stays >= 1 throughout this swap
586 > // because the new handle is acquired before the old one is
587 > // disposed; {@link IClaudeProxyService} applies most-recent-token-
588 > // wins on subsequent `start()` calls.
589 > const newHandle = await this._claudeProxyService.start(token);
590 > const oldHandle = this._proxyHandle;
591 > this._proxyHandle = newHandle;
592 > this._githubToken = token;
593 > this._logService.info('[Claude] Auth token updated');
594 oldHandle?.dispose();
595 if (tokenChanged) {
599 this._models.set([], undefined);
600 }
601 > void this._startModelRefresh(); claudeAgent.ts
602 > return true;
603 }
604
649 try {
650 const filtered = proxyAtStart
651 > ? await this._fetchProxyModels(tokenAtStart!) claudeAgent.ts
652 : await this._fetchNativeModels();
653 // Stale-write guard: bail if the transport flipped, or (proxy) the
704 */
705 private async _fetchProxyModels(token: string): Promise<readonly IAgentModelInfo[]> {
706 > const userAgent = `${USER_AGENT_PREFIX}/${this._productService.version}`; claudeAgent.ts
707 > const all = await this._copilotApiService.models(token, { headers: { 'User-Agent': userAgent }, suppressIntegrationId: true });
708 > return all
709 > .filter(isClaudeModel)
710 > .sort((a, b) => Number(b.is_chat_default) - Number(a.is_chat_default))
711 > .map(m => toAgentModelInfo(m, this.id));
712 > }
713
714 // #endregion