Skip to content

prompt validator: improve error reporting#311876

Merged
aeschli merged 1 commit intomainfrom
aeschli/wily-parakeet-291
Apr 22, 2026
Merged

prompt validator: improve error reporting#311876
aeschli merged 1 commit intomainfrom
aeschli/wily-parakeet-291

Conversation

@aeschli
Copy link
Copy Markdown
Contributor

@aeschli aeschli commented Apr 22, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 22, 2026 10:00
@aeschli aeschli enabled auto-merge (squash) April 22, 2026 10:00
@aeschli aeschli self-assigned this Apr 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 200fb2ed Current: 879cb04f

Changed (2)

chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Light
Before After
before after
agentSessionsViewer/NeedsInput/Dark
Before After
before after

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves prompt file validation diagnostics by making file-reference checks more precise and adding logging for unexpected failures during existence checks.

Changes:

  • Inject ILogService into PromptValidator to enable logging.
  • Only emit a “file not found” marker when fileService.exists(...) returns false (avoids false positives).
  • Add a warning log when file existence checks throw.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.ts Refines file-reference validation logic and logs failures during existence checks.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment on lines 141 to +142
} catch {
this.logger.warn(`Error checking existence of file reference '${ref.content}' resolved to '${resolved.toString()}' in prompt file '${promptAST.uri.toString()}'`);
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The catch here swallows exceptions from fileService.exists and only logs a generic string. Please capture the error (e.g. catch (err)) and pass it to ILogService.warn so stack/details are preserved; additionally consider reporting a marker when the existence check fails so users still get feedback when validation can’t be performed.

Suggested change
} catch {
this.logger.warn(`Error checking existence of file reference '${ref.content}' resolved to '${resolved.toString()}' in prompt file '${promptAST.uri.toString()}'`);
} catch (err) {
this.logger.warn(`Error checking existence of file reference '${ref.content}' resolved to '${resolved.toString()}' in prompt file '${promptAST.uri.toString()}'`, err);
report(toMarker(localize('promptValidator.fileReferenceValidationFailed', "Could not validate file reference '{0}'.", ref.content), ref.range, MarkerSeverity.Warning));

Copilot uses AI. Check for mistakes.
@aeschli aeschli merged commit 76696d4 into main Apr 22, 2026
30 checks passed
@aeschli aeschli deleted the aeschli/wily-parakeet-291 branch April 22, 2026 10:23
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants