Skip to content

Add regression coverage for update_issue MCP body length handling above 10KB#46781

Merged
pelikhan merged 6 commits into
mainfrom
copilot/update-issue-body-limit
Jul 20, 2026
Merged

Add regression coverage for update_issue MCP body length handling above 10KB#46781
pelikhan merged 6 commits into
mainfrom
copilot/update-issue-body-limit

Conversation

Copilot AI commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

update_issue was previously vulnerable to an MCP pre-validation mismatch where large bodies could be rejected by the default 10KB string guard instead of honoring the tool schema’s explicit body limit. This PR adds focused regression tests so update_issue.body behavior stays aligned with the 65KB-class schema contract used by sibling issue/comment tools.

  • Regression scope: MCP string-length pre-validation vs tool schema

    • Adds test coverage in actions/setup/js/mcp_scripts_validation.test.cjs for update_issue using the real safe_outputs_tools.json schema.
    • Verifies that a body larger than MAX_STRING_INPUT_BYTES is accepted when update_issue.body.maxLength is declared.
    • Verifies that values over schema boundary (65537) are still rejected with a body max-length violation.
  • Fixture/schema loading hardening

    • Introduces a small helper to load update_issue schema from safe_outputs_tools.json.
    • Improves failure diagnostics when schema shape/tool entries are invalid or missing.
const updateIssueSchema = loadUpdateIssueToolSchema();

expect(updateIssueSchema.properties.body.maxLength).toBe(65536);
expect(
  validateStringInputLengths({ body: "a".repeat(MAX_STRING_INPUT_BYTES + 1) }, updateIssueSchema)
).toEqual([]);

const violations = validateStringInputLengths({ body: "a".repeat(65537) }, updateIssueSchema);
expect(violations[0]).toMatchObject({ field: "body", limit: 65536, unit: "characters" });

Copilot AI and others added 3 commits July 20, 2026 09:35
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for the fix! This PR looks great — it's a focused test-addition that adds solid regression coverage for the update_issue body limit schema fix.

What this does well:

Ready for review — the tests look comprehensive and the implementation follows the test structure in place. 🎉

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • patchdiff.githubusercontent.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "patchdiff.githubusercontent.com"

See Network Configuration for more information.

Generated by ✅ Contribution Check · 64.1 AIC · ⌖ 8.09 AIC · ⊞ 6.2K ·

Copilot AI and others added 2 commits July 20, 2026 09:55
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update issue body limit to match create_issue and add_comment Add regression coverage for update_issue MCP body length handling above 10KB Jul 20, 2026
Copilot AI requested a review from pelikhan July 20, 2026 10:03
@pelikhan
pelikhan marked this pull request as ready for review July 20, 2026 10:04
Copilot AI review requested due to automatic review settings July 20, 2026 10:04
@pelikhan
pelikhan merged commit fffbba1 into main Jul 20, 2026
1 check passed
@pelikhan
pelikhan deleted the copilot/update-issue-body-limit branch July 20, 2026 10:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds regression coverage ensuring update_issue.body honors its explicit schema length limit instead of the default 10KB MCP guard.

Changes:

  • Loads the real update_issue tool schema with actionable failures.
  • Tests acceptance above 10KB and rejection above 65,536 characters.
Show a summary per file
File Description
actions/setup/js/mcp_scripts_validation.test.cjs Adds schema-backed body-length regression tests.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Medium

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.82.14

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.

update_issue body is capped at 10 KB while create_issue / add_comment allow 65 KB

3 participants