claudeAgent.ts ×2

Frontier kind: Code frontier

unlabeled · c_9086a52bdea4

111 tests · 54772 LOC · 346 files · introduces 0 tests · 16 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
2 ranges16 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
5155 ranges54772 lines · 346 files · Browse complete extent
All tests (intent)
111 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: 16 introduced LOC across 2 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/claude/claudeAgent.ts 16 introduced LOC · 2 ranges

Open complete file

1909
1910 private async _sendMessage(chat: URI, prompt: string, workingDirectory: URI | undefined, attachments?: readonly MessageAttachment[], turnId?: string, _senderClientId?: string): Promise<void> {
1911 > // `IAgent.sendMessage` declares `turnId?` but every production caller in claudeAgent.ts
1912 > // `AgentSideEffects` supplies one. Generate a fallback so the
1913 > // session-side `QueuedRequest.turnId: string` invariant holds even if a
1914 > // hypothetical caller forgets it.
1915 > const effectiveTurnId = turnId ?? generateUuid();
1916 > const context = this._getChatContext(chat);
1917 >
1918 > // Additional peer chat: route to its own chat. Its SDK
1919 > // `session_id` is the chat's chat id, NOT the parent session's.
1920 > // Hold the per-chat lock across BOTH materialize and send (mirroring the
1921 > // default-chat path below) so concurrent sends to the same peer chat
1922 > // serialize and a racing disposeChat/disposeSession (which queue on the
1923 > // same chat key) waits for the in-flight turn instead of disposing the
1924 > // session under it.
1925 > if (context.isPeerChat) {
1926 return this._sessionSequencer.queue(context.chatKey, async () => {
1927 const chatSession = await this._materializeChatLocked(context.session, chat);
1952 await session.send(this._buildSdkPrompt(context.sessionId, prompt, attachments, effectiveTurnId), effectiveTurnId);
1953 });
1954 > } claudeAgent.ts
1955
1956 /** Builds the SDK user message for a send, addressed to `sdkSessionId`. */