sshRemoteAgentHostService.ts ×5

Frontier kind: Code frontier

unlabeled · c_716c8b32bcd4

2 tests · 10840 LOC · 48 files · introduces 0 tests · 24 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges24 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1635 ranges10840 lines · 48 files · Browse complete extent
All tests (intent)
2 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: 24 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/sshRemoteAgentHostService.ts 24 introduced LOC · 5 ranges

Open complete file

292 }
293 if (code !== 0 && !opts?.ignoreExitCode) {
294 > reject(new Error(`SSH command failed (exit ${code}): ${command}\nstderr: ${stderr}`)); sshRemoteAgentHostService.ts
295 } else {
296 resolve({ stdout, stderr, code: code ?? 0 });
1469 return cliBin;
1470 } catch (installErr) {
1471 > // Soft fallback (key difference from Remote-SSH): if the sshRemoteAgentHostService.ts
1472 > // commit-pinned download fails (offline, 404, etc.) but another
1473 > // usable CLI is already on the box, use that instead of refusing
1474 > // to connect. The agent host has no strict commit-lock with the
1475 > // desktop — the protocol handshake will catch genuine
1476 > // incompatibilities.
1477 > const installErrorMessage = installErr instanceof Error ? installErr.message : String(installErr);
1478 > this._logService.warn(`${LOG_PREFIX} Could not install matching CLI for commit ${commit}: ${installErrorMessage}. Looking for a fallback CLI on the remote...`);
1479 > const fallback = await this._findFallbackCLI(client);
1480 > if (fallback) {
1481 this._logService.warn(`${LOG_PREFIX} Using fallback CLI at ${fallback} (does not match desktop commit ${commit}).`);
1482 return fallback;
1520 */
1521 private async _findFallbackCLI(client: SSHClient): Promise<string | undefined> {
1522 > const { stdout } = await sshExec(client, buildFindFallbackCLICommand(this._serverDataFolderName, this._quality), { ignoreExitCode: true }); sshRemoteAgentHostService.ts
1523 > const rawCandidates = stdout.split('\n').map(s => s.trim()).filter(s => s.length > 0);
1524 > // Defensive validation: the finder shell snippet emits paths we
1525 > // trust by construction, but the output is still data coming back
1526 > // over SSH that we then interpolate into a follow-up command
1527 > // (`<candidate> --version`). Filter to the exact shapes we expect
1528 > // — `<root>/<archive>-<40 hex>` or `<legacyDir>/<archive>` — so a
1529 > // malicious or junk file in the install root can never become a
1530 > // shell argument.
1531 > const candidates: string[] = [];
1532 > for (const candidate of rawCandidates) {
1533 if (isValidFallbackCLIPath(candidate, this._serverDataFolderName, this._quality)) {
1534 candidates.push(candidate);
1537 }
1538 }
1539 > for (const candidate of candidates) { sshRemoteAgentHostService.ts
1540 const { code } = await sshExec(client, `${candidate} --version`, { ignoreExitCode: true });
1541 if (code === 0) {