agentService.ts ×4

Frontier kind: Code frontier

unlabeled · c_4a11a7046c04

3 tests · 51521 LOC · 304 files · introduces 0 tests · 39 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges39 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
5385 ranges51521 lines · 304 files · Browse complete extent
All tests (intent)
3 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: 39 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/agentService.ts 25 introduced LOC · 4 ranges

Open complete file

1225 createOptions = { ...options, fork: undefined };
1226 } else {
1227 > const slice = sourceTurns.slice(0, forkIndex + 1); agentService.ts
1228 > const turnIdMapping = new Map<string, string>();
1229 > for (const t of slice) {
1230 > turnIdMapping.set(t.id, generateUuid());
1231 > }
1232 > forkedTurns = slice.map(t => ({ ...t, id: turnIdMapping.get(t.id) ?? generateUuid() }));
1233 >
1234 > // Carry forked host-injected local turns (`/rename`, `!command`)
1235 > // into the new chat so they survive reload and anchor future
1236 > // fork/truncate.
1237 > this._persistForkedLocalTurns(sessionKey, sourceChatUri, chat.toString(), slice, forkedTurns, turnIdMapping);
1238 >
1239 > const forkedTitlePrefix = localize('agentHost.forkedTitlePrefix', "Forked: ");
1240 > forkedSourceTitle = sourceState?.title || this._stateManager.getSessionState(sessionKey)?.title;
1241 > forkedTitle = forkedSourceTitle
1242 ? (forkedSourceTitle.startsWith(forkedTitlePrefix) ? forkedSourceTitle : `${forkedTitlePrefix}${forkedSourceTitle}`)
1243 : localize('agentHost.forkedChatFallback', "Forked Chat");
1244 > // The SDK fork boundary must be a concrete (SDK-backed) turn. When agentService.ts
1245 > // the client forked at a host-injected local turn, redirect the
1246 > // agent to the preceding concrete turn (the local turns are still
1247 > // seeded into the new chat's protocol state above).
1248 > const concreteForkTurnId = this._localTurns.resolveConcreteTurnId(sourceChatUri, options.fork.turnId);
1249 > createOptions = { ...options, fork: { ...options.fork, turnIdMapping, ...(concreteForkTurnId !== undefined ? { turnId: concreteForkTurnId } : {}) } };
1250 > }
1251 }
1252
1282 // fires for them — this is the fork-time equivalent.
1283 if (forkedTurns && forkedTurns.length > 0 && forkedTitle !== undefined) {
1284 > this._sideEffects.generateForkedTitle(sessionKey, chat.toString(), forkedTurns, forkedTitle, forkedSourceTitle); agentService.ts
1285 > }
1286 }
1287
1501 : undefined;
1502 return options?.fork
1503 > ? provider.chats.fork(chat, options.fork, convOptions) agentService.ts
1504 : provider.chats.createChat(chat, convOptions);
1505 }
src/vs/platform/agentHost/node/agentHostSessionTitleController.ts 14 introduced LOC · 1 range

Open complete file

263 const isAdditionalChat = !!chatChannel && isAhpChatChannel(chatChannel) && !isDefaultChatUri(chatChannel);
264 if (isAdditionalChat) {
265 > const key = chatChannel; agentHostSessionTitleController.ts
266 > this._lastAppliedTitle.set(key, fallbackTitle);
267 > const apply = (title: string) => this._applyTitle(key, title, t => this._stateManager.updateChatTitle(channel, key, t));
268 > this._generateTitleSoon(
269 > key,
270 > context,
271 > true,
272 > fallbackTitle,
273 > apply,
274 > () => this._stateManager.getChatState(key)?.title === this._lastAppliedTitle.get(key),
275 > title => this._persistSessionFlag(channel, `customChatTitle:${key}`, title),
276 > );
277 > return;
278 > }
279
280 this._lastAppliedTitle.set(channel, fallbackTitle);