agentSideEffects.ts ×3

Frontier kind: Code frontier

unlabeled · c_02bd6c0551fa

10 tests · 43073 LOC · 238 files · introduces 0 tests · 40 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges40 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4179 ranges43073 lines · 238 files · Browse complete extent
All tests (intent)
10 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.

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

src/vs/platform/agentHost/node/agentSideEffects.ts 34 introduced LOC · 3 ranges

Open complete file

1445 return;
1446 }
1448 > const msg = state.queuedMessages[0];
1449 > const turnId = generateUuid();
1450 >
1451 > // Per-turn streaming part tracking is owned by the agent (reset
1452 > // inside its `send()` call), so no host-side reset is needed.
1453 >
1454 > // Dispatch server-initiated turn start; the reducer removes the queued message atomically
1455 > this._stateManager.dispatchServerAction(session, {
1456 > type: ActionType.ChatTurnStarted,
1457 > turnId,
1458 > startedAt: new Date().toISOString(),
1459 > message: msg.message,
1460 > queuedMessageId: msg.id,
1461 > });
1462 > const turnStopWatch = StopWatch.create(false);
1463 >
1464 > // Generic host commands (`/rename`, `!command`, …) are intercepted by
1465 > // the local-command dispatcher (see the ChatTurnStarted handler) and
1466 > // must not reach the agent SDK even when queued.
1467 > const handled = this._localCommands.tryHandle({ turnChannel: session, turnId, text: msg.message.text });
1468 > if (handled) {
1469 // A local command may suggest a provisional title (e.g. a `!command`
1470 // dequeued before any real request has titled the session).
1474 return;
1475 }
1477 > this._titleController.seedTitleFromFirstMessage(sessionChannel, msg.message.text, session);
1478 >
1479 > // Send the message to the agent backend. When `session` is an
1480 > // additional chat channel, the SDK chat is owned by the
1481 > // parent session: look up the provider by the parent session URI and
1482 > // pass the chat channel so the harness routes to the right peer chat.
1483 > const agent = this._options.getAgent(sessionChannel);
1484 > if (!agent) {
1485 this._stateManager.dispatchServerAction(session, {
1486 type: ActionType.ChatError,
1491 return;
1492 }
1493 > const attachments = msg.message.attachments; agentSideEffects.ts
1494 > const queuedState = this._stateManager.getSessionState(session);
1495 > this._telemetryReporter.userMessageSent(agent.id, session, queuedState, 'queued', attachments);
1496 const { model, modelTelemetryKind, permissionLevel } = this._getTurnTelemetryContext(agent, queuedState, msg.message.model?.id);
1497 this._turnTracker.turnStarted(agent.id, session, turnId, model, modelTelemetryKind, permissionLevel);
src/vs/platform/agentHost/common/state/protocol/channels-chat/reducer.ts 6 introduced LOC · 2 ranges

Open complete file

322 // If this turn was auto-started from a pending message, remove it
323 if (action.queuedMessageId) {
324 > if (next.steeringMessage?.id === action.queuedMessageId) { reducer.ts
325 next = { ...next, steeringMessage: undefined };
326 }
327 > if (next.queuedMessages) { reducer.ts
328 > const filtered = next.queuedMessages.filter(m => m.id !== action.queuedMessageId);
329 > next = { ...next, queuedMessages: filtered.length > 0 ? filtered : undefined };
330 > }
331 > }
332
333 return next;