Skip to content

Add compiler warning for unbounded list_code_scanning_alerts prompt usage - #47265

Closed
pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/hippo-add-validation-for-list-code-scanning-alerts
Closed

Add compiler warning for unbounded list_code_scanning_alerts prompt usage#47265
pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/hippo-add-validation-for-list-code-scanning-alerts

Conversation

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Workflows that call list_code_scanning_alerts without state: open and severity: critical,high produce oversized MCP responses that break downstream runs. This adds a compiler-level warning to catch the pattern at author time.

Changes

  • pkg/workflow/compiler_validators.go: Added warnPromptUnboundedCodeScanningAlerts (pure function) and validatePromptUnboundedCodeScanningAlerts (compiler method), wired into the existing validateExpressions call chain alongside validatePromptTmpPaths.
  • pkg/workflow/compiler_validators_test.go: Added TestWarnPromptUnboundedCodeScanningAlerts and TestValidatePromptUnboundedCodeScanningAlerts covering bounded, partially bounded, and fully unbounded cases.

When a workflow prompt mentions list_code_scanning_alerts without both required parameters, the compiler now emits:

workflow.md: warning: Prompt calls list_code_scanning_alerts without required bounding parameters.
Always include state: open and severity: critical,high to avoid oversized MCP responses.
Example: list_code_scanning_alerts with state: open and severity: critical,high.

Adds a compiler warning when a workflow markdown prompt mentions
list_code_scanning_alerts without the required bounding parameters
(state: open and severity: critical,high). Unbounded calls can produce
oversized MCP responses that break downstream workflow runs.

- warnPromptUnboundedCodeScanningAlerts: pure function detecting the pattern
- validatePromptUnboundedCodeScanningAlerts: compiler method wired into validateExpressions
- Tests: TestWarnPromptUnboundedCodeScanningAlerts and TestValidatePromptUnboundedCodeScanningAlerts

Closes #47219

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add validation for list_code_scanning_alerts prompt usage Add compiler warning for unbounded list_code_scanning_alerts prompt usage Jul 22, 2026
Copilot AI requested a review from pelikhan July 22, 2026 11:09
@pelikhan pelikhan closed this Jul 22, 2026
@github-actions
github-actions Bot deleted the copilot/hippo-add-validation-for-list-code-scanning-alerts branch July 31, 2026 03:01
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.

[hippo] Add validation for unbounded list_code_scanning_alerts prompt usage

2 participants