claudeMapSessionEvents.ts ×7

Frontier kind: Code frontier

unlabeled · c_a2615ea668d3

92 tests · 24160 LOC · 107 files · introduces 0 tests · 37 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges37 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1956 ranges24160 lines · 107 files · Browse complete extent
All tests (intent)
92 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: 37 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/claude/claudeMapSessionEvents.ts 37 introduced LOC · 7 ranges

Open complete file

180 */
181 clearPendingToolCalls(logService: ILogService): void {
182 > this.toolCalls.clearPending(logService); claudeMapSessionEvents.ts
183 > }
184 }
185
241 );
242 case 'result':
243 > return mapResult(message, chat, turnId, turnDuration, state, logService, registry); claudeMapSessionEvents.ts
244 case 'assistant':
245 return tagWithParent(
421 }
422
423 > function mapResult( claudeMapSessionEvents.ts
424 > message: Extract<SDKMessage, { type: 'result' }>,
425 > session: URI,
426 > turnId: string,
427 > turnDuration: number | undefined,
428 > state: ClaudeMapperState,
429 > logService: ILogService,
430 > registry: SubagentRegistry,
431 > ): AgentSignal[] {
432 > const signals: AgentSignal[] = [];
433 > if (message.subtype === 'success') {
434 // `modelUsage` is keyed by model name; pick the first key as the
435 // reported model. Phase 6 turns are single-model; multi-model
457 });
458 }
460 > // Surface execution errors (e.g. an upstream CAPI failure relayed by the
461 > // proxy) as a ChatError so the turn renders an error instead of
462 > // completing empty. Mirrors the Copilot Chat extension's
463 > // `handleResultMessage`. The proxy embeds a `VSCODE_PROXY_ERROR` marker in
464 > // the error text, which we decode into `_meta` for rich, localized
465 > // messaging (rate limit, quota + upgrade affordance, etc.).
466 > const errorText = getResultErrorText(message);
467 > if (errorText !== undefined) {
468 signals.push({
469 kind: 'action',
480 });
481 }
482 > // `ChatTurnComplete` is emitted by the session via claudeMapSessionEvents.ts
483 > // `ClaudeSdkPipeline.onTurnComplete`, NOT here. The pipeline knows
484 > // when the protocol Turn is truly done (queue fully drained vs an
485 > // intermediate result during a steering preempt — CONTEXT.md M10);
486 > // the mapper does not have that state.
487 > state.clearPendingToolCalls(logService);
488 > // Phase 12 — drain orphaned subagent-spawning entries (foreground
489 > // only; background entries survive across turns by design). The
490 > // registry owns this state; the mapper drives the drain at turn end.
491 > for (const orphan of registry.drainForegroundSpawns()) {
492 logService.warn(`[claudeMapSessionEvents] turn ended with pending subagent-spawning tool_use ${orphan.toolUseId} (agentId=${orphan.agentId ?? '<unresolved>'}); dropping cross-message state`);
493 }
494 > return signals; claudeMapSessionEvents.ts
495 > }
496
497 /**
500 * `getResultErrorText`.
501 */
502 > function getResultErrorText(message: Extract<SDKMessage, { type: 'result' }>): string | undefined { claudeMapSessionEvents.ts
503 > if (message.subtype === 'success') {
504 return message.is_error ? message.result : undefined;
505 }