claudeAgentSession.ts ×4

Frontier kind: Code frontier

unlabeled · c_e56a2e913ceb

140 tests · 54791 LOC · 346 files · introduces 0 tests · 80 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
4 ranges80 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
5163 ranges54791 lines · 346 files · Browse complete extent
All tests (intent)
140 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: 80 introduced LOC across 4 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/claude/claudeAgentSession.ts 80 introduced LOC · 4 ranges

Open complete file

157
158 static createProvisional(
159 > sessionId: string, claudeAgentSession.ts
160 > sessionUri: URI,
161 > chatChannelUri: URI,
162 > workspace: URI | undefined,
163 > project: IAgentSessionProjectInfo | undefined,
164 > model: ModelSelection | undefined,
165 > agent: AgentSelection | undefined,
166 > config: Record<string, unknown> | undefined,
167 > pendingClientToolCalls: PendingRequestRegistry<CallToolResult>,
168 > permissionModeFallback: ClaudePermissionMode,
169 > metadataStore: ClaudeSessionMetadataStore,
170 > instantiationService: IInstantiationService,
171 > ): ClaudeAgentSession {
172 > return instantiationService.createInstance(
173 > ClaudeAgentSession,
174 > sessionId,
175 > sessionUri,
176 > chatChannelUri,
177 > workspace,
178 > project,
179 > model,
180 > agent,
181 > config,
182 > new AbortController(),
183 > pendingClientToolCalls,
184 > new SessionClientToolsDiff(),
185 > permissionModeFallback,
186 > metadataStore,
187 > );
188 > }
189
190 /**
321
322 constructor(
323 > readonly sessionId: string, claudeAgentSession.ts
324 > readonly sessionUri: URI,
325 > readonly chatChannelUri: URI,
326 > readonly workspace: URI | undefined,
327 > project: IAgentSessionProjectInfo | undefined,
328 > model: ModelSelection | undefined,
329 > agent: AgentSelection | undefined,
330 > config: Record<string, unknown> | undefined,
331 > abortController: AbortController,
332 > private readonly _pendingClientToolCalls: PendingRequestRegistry<CallToolResult>,
333 > toolDiff: SessionClientToolsDiff,
334 > private readonly _permissionModeFallback: ClaudePermissionMode,
335 > private readonly _metadataStore: ClaudeSessionMetadataStore,
336 > @IInstantiationService private readonly _instantiationService: IInstantiationService,
337 > @IAgentConfigurationService private readonly _configurationService: IAgentConfigurationService,
338 > @IAgentHostStateManager private readonly _stateManager: AgentHostStateManager,
339 > @IClaudeAgentSdkService private readonly _sdkService: IClaudeAgentSdkService,
340 > @ISessionDataService private readonly _sessionDataService: ISessionDataService,
341 > @ILogService private readonly _logService: ILogService,
342 > @IFileService private readonly _fileService: IFileService,
343 > @INativeEnvironmentService private readonly _environmentService: INativeEnvironmentService,
344 > ) {
345 > super();
346 > this._chatChannelUri = chatChannelUri;
347 > this.project = project;
348 > this._provisionalModel = model;
349 > this._provisionalAgent = agent;
350 > this.provisionalConfig = config;
351 > this.abortController = abortController;
352 > this.toolDiff = this._register(toolDiff);
353 > this._register(this.clientCustomizationsDiff.onDidChange(() => this._onDidCustomizationsChange.fire()));
354 >
355 > this._watchCustomizations(this.workspace);
356 > }
357
358 private _watchCustomizations(directory: URI | undefined): void {
359 > this._customizationWatcher.clear(); claudeAgentSession.ts
360 > const watcher = this._customizationWatcher.add(new ClaudeCustomizationWatcher(
361 > directory,
362 > this._environmentService.userHome,
363 > this._fileService,
364 > this._logService,
365 > ));
366 > this._customizationWatcher.add(watcher.onDidChange(() => this._onDidCustomizationsChange.fire()));
367 > }
368
369 /**
1112
1113 override dispose(): void {
1114 > // Resolve parked deferreds before tearing the pipeline down so the claudeAgentSession.ts
1115 > // SDK's canUseTool callback unwinds with a deny and the loop exits.
1116 > this._pendingPermissions.denyAll(false);
1117 > this._pendingUserInputs.denyAll({ response: ChatInputResponseKind.Cancel });
1118 > this._pendingClientToolCalls.rejectAll(new CancellationError());
1119 > super.dispose();
1120 > }
1121 }