Files
vscode/build/lib/screenshotComment.ts
T
Giuseppe Cianci 1db7d3c47f agentHost: surface Codex skill validation errors (#335053)
* agentHost: surface Codex skill validation errors

Preserve Codex SDK validation failures as disabled skill customizations instead of silently dropping them. Retain the original file URI and diagnostic so users can find and repair invalid metadata.

Add regression coverage for editor and Agents windows, including missing-description error hovers in both themes. Fixes #334920.

* agentHost: add Codex skill error screenshot baselines

* agentHost: group Codex skill validation diagnostics

* chat: expose skill diagnostics to keyboard users

* chat: stabilize skill diagnostic focus tests in Electron

Use the list focus navigation API exercised by workbench keybindings and explicitly deliver focus for background Electron test windows. Preserve diagnostic label and active descendant assertions for both windows.

* test: retry command lookup after quick input loses focus

Route focused-command lookup failures through the existing bounded retry loop. Add an Agents Window smoke regression that moves focus into chat after typing the New Session command, before its result is selected.

* ci: bound screenshot report comments
2026-09-09 13:02:24 +02:00

34 lines
1.3 KiB
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export const COMMENT_MARKER = '<!-- screenshot-diff-report -->';
const MAX_COMMENT_LENGTH = 65536;
interface ScreenshotCommentOptions {
readonly runUrl: string;
readonly baseSha?: string;
readonly currentSha?: string;
}
export function formatScreenshotComment(body: string, options: ScreenshotCommentOptions): string {
const comment = body.startsWith(COMMENT_MARKER) ? body : `${COMMENT_MARKER}\n${body}`;
if (comment.length <= MAX_COMMENT_LENGTH) {
return comment;
}
const commits = [
options.baseSha ? `**Base:** \`${options.baseSha.slice(0, 8)}\`` : '',
options.currentSha ? `**Current:** \`${options.currentSha.slice(0, 8)}\`` : '',
].filter(Boolean).join(' ');
return [
COMMENT_MARKER,
'## Screenshot Changes',
'',
...(commits ? [commits, ''] : []),
`The screenshot report exceeds GitHub's comment size limit. [View the full report in the workflow summary](${options.runUrl}).`,
].join('\n');
}