Skip to content

fix: add maxLength: 65536 to body/content fields to exempt from SM-IS-01 10 KB cap#45826

Merged
pelikhan merged 23 commits into
mainfrom
copilot/fix-maxlength-exemption-body-fields
Jul 16, 2026
Merged

fix: add maxLength: 65536 to body/content fields to exempt from SM-IS-01 10 KB cap#45826
pelikhan merged 23 commits into
mainfrom
copilot/fix-maxlength-exemption-body-fields

Conversation

Copilot AI commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

The SM-IS-01 validation in mcp_scripts_validation.cjs enforces a 10 KB global cap on all string fields unless they have an explicit maxLength (which delegates enforcement to the API layer). create_issue.body, create_discussion.body, and add_comment.body were already exempted via maxLength: 65536 (#43867), but 23 large-content fields across 21 tools were still being capped at 10 KB.

Changes

  • Added maxLength: 65536 to all affected fields in both pkg/workflow/js/safe_outputs_tools.json and actions/setup/js/safe_outputs_tools.json (files are kept in sync):
Tool Field(s)
update_discussion, update_issue, update_pull_request, update_release body
create_pull_request, close_discussion, close_issue, close_pull_request body
create_pull_request_review_comment, submit_pull_request_review, reply_to_pull_request_review_comment body
create_agent_session, create_project_status_update body
update_project draft_body
create_check_run summary, text
autofix_code_scanning_alert fix_description, fix_code
merge_pull_request commit_message
push_to_pull_request_branch message
dismiss_pull_request_review justification
noop message
report_incomplete details

…-01 10 KB cap

Fixes the SM-IS-01 maxLength exemption gap across all affected tools.
The mcp_scripts_validation.cjs logic skips fields with an explicit
maxLength, so fields without one were subject to the 10 KB global cap.

Fields updated in both pkg/workflow/js/safe_outputs_tools.json and
actions/setup/js/safe_outputs_tools.json:
- update_discussion.body
- update_issue.body
- update_pull_request.body
- update_release.body
- update_project.draft_body
- create_pull_request.body
- create_pull_request_review_comment.body
- submit_pull_request_review.body
- reply_to_pull_request_review_comment.body
- close_discussion.body
- close_issue.body
- close_pull_request.body
- create_agent_session.body
- create_project_status_update.body
- create_check_run.summary, text
- autofix_code_scanning_alert.fix_description, fix_code
- merge_pull_request.commit_message
- push_to_pull_request_branch.message
- dismiss_pull_request_review.justification
- noop.message
- report_incomplete.details

Closes #44842

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix maxLength exemption in body/content fields fix: add maxLength: 65536 to body/content fields to exempt from SM-IS-01 10 KB cap Jul 15, 2026
Copilot AI requested a review from pelikhan July 15, 2026 21:59
@pelikhan pelikhan marked this pull request as ready for review July 15, 2026 22:09
Copilot AI review requested due to automatic review settings July 15, 2026 22:09

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 explicit large-content limits to safe-output tool schemas, bypassing the global 10 KB validation cap.

Changes:

  • Adds maxLength: 65536 to 23 content fields.
  • Synchronizes compiler and runtime schema catalogs.
Show a summary per file
File Description
pkg/workflow/js/safe_outputs_tools.json Updates compiler-embedded schemas.
actions/setup/js/safe_outputs_tools.json Updates runtime schemas.

Review details

Tip

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

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

Comment thread actions/setup/js/safe_outputs_tools.json
Comment thread pkg/workflow/js/safe_outputs_tools.json
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address unresolved review feedback, refresh the branch if needed, and rerun checks once updates are pushed.

Generated by 👨‍🍳 PR Sous Chef · 8.91 AIC · ⌖ 5.49 AIC · ⊞ 7.5K ·
Comment /souschef to run again

Copilot AI and others added 2 commits July 15, 2026 23:11
…ing reason exemption

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, address unresolved review feedback, refresh the branch if needed, and rerun checks once updates are pushed.

...

Addressed unresolved feedback in 9158159 (plus e9b3119):

  • Enforced explicit schema maxLength limits during MCP request validation before handlers run (with explicit maxLength checked by character count and default SM-IS-01 fallback still enforced).
  • Added missing maxLength: 65536 to mark_pull_request_as_ready_for_review.reason in both catalogs.
  • Added regression coverage for the full large-content field exemption list.
  • Re-ran local validation (make fmt, make lint, make test-unit, make test, make recompile) and parallel_validation (clean).

I couldn’t query/retrigger PR checks from this environment due GitHub API 403 on gh calls, so CI on the new HEAD still needs a maintainer re-trigger.

Copilot AI requested a review from gh-aw-bot July 15, 2026 23:18
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address the unresolved review feedback (newest first: Copilot: #45826 (comment)), and rerun checks once the branch is up to date.

Generated by 👨‍🍳 PR Sous Chef · 9.41 AIC · ⌖ 6.79 AIC · ⊞ 7.5K ·
Comment /souschef to run again

Copilot AI commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, address the unresolved review feedback (newest first: Copilot: #45826 (comment)), and rerun checks once th...

Handled the unresolved Copilot threads newest-first and replied on both review comments (#discussion_r3591105260, #discussion_r3591105336). The fixes are in e9b3119 + 9158159; I re-ran local validation (make fmt, make lint, make test-unit, make test, make recompile) successfully on current HEAD. Current PR workflow runs on this branch are action_required/stale for agent pushes, so a maintainer needs to re-trigger CI to verify checks on HEAD.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address any unresolved review feedback, and rerun checks once the branch is up to date.

Generated by 👨‍🍳 PR Sous Chef · 3.47 AIC · ⌖ 11.2 AIC · ⊞ 5.1K ·
Comment /souschef to run again

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main and recompile

Done in 61b4c242: merged latest main into this PR branch, resolved merge conflicts, and ran make recompile.

@pelikhan

Copy link
Copy Markdown
Collaborator

Copilot AI and others added 2 commits July 16, 2026 07:54
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…CP test

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix https://github.com/github/gh-aw/actions/runs/29480433617/job/87562689064

Fixed in b8b497b. I increased the test fixture override for create_issue.body.maxLength in safe_outputs_mcp_large_content.test.cjs from 2e5 to 2e6 so the non-JSON large-content case exercises file-spill behavior instead of failing early on schema max-length validation. Verified with:

  • npx vitest run safe_outputs_mcp_large_content.test.cjs
  • npx vitest run safe_outputs_mcp_add_comment_constraints.test.cjs mcp_scripts_validation.test.cjs mcp_server_core.test.cjs safe_outputs_mcp_error_messages.test.cjs

@pelikhan

Copy link
Copy Markdown
Collaborator

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix https://github.com/github/gh-aw/actions/runs/29482728958/job/87569955641?pr=45826

Fixed in aa730de.

I updated TestApplyContainerPins to stop hardcoding gh-aw-firewall/agent:0.27.0 and instead derive the firewall agent image/pin from constants.DefaultFirewallVersion and the embedded pin table. This makes the test track pin/version updates and resolves the CI failure in that job.

Validated with:

  • go test ./pkg/workflow -run TestApplyContainerPins -v

@pelikhan

Copy link
Copy Markdown
Collaborator

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix https://github.com/github/gh-aw/actions/runs/29483766141/job/87573410489?pr=45826

Fixed in 85d3aab3fe.

I updated the failing AWF digest tests in pkg/workflow/awf_helpers_test.go to stop relying on stale hardcoded firewall versions:

  • use constants.DefaultFirewallVersion for digest assertions
  • inject a cached build-tools pin in the arc-dind subtest so it validates behavior without depending on embedded pin data

Validated with:

  • go test ./pkg/workflow -run 'TestBuildAWFImageTagWithDigests|TestBuildAWFArgs_ImageTagIncludesDigests' -v
  • parallel_validation (clean)

@pelikhan

Copy link
Copy Markdown
Collaborator

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix https://github.com/github/gh-aw/actions/runs/29485329901/job/87579316730

Fixed in fe4e793.

I investigated run 29485329901 job 87579316730, reproduced the failures, and updated the stale test expectations to track current embedded pin data (instead of hardcoded old versions/digests). I also made the arc-dind build-tools pin compile test deterministic via an explicit cache fixture pin.

Validated with targeted tests:

  • go test ./pkg/actionpins ./pkg/workflow -run 'TestGetContainerPin_MCPGatewayVersionsArePinned|TestSpec_PublicAPI_GetContainerPin|TestGetLatestActionPinByRepo|TestGetActionPinWithData_SemverPreference|TestCompileWorkflow_FirewallImagesPinnedForAWF0270|TestCompileWorkflow_FirewallImagesPinnedForDefaultVersion|TestCompileWorkflow_BuildToolsImagePinnedForArcDind' -count=1
  • parallel_validation (clean)

@pelikhan pelikhan merged commit 214beb0 into main Jul 16, 2026
37 checks passed
@pelikhan pelikhan deleted the copilot/fix-maxlength-exemption-body-fields branch July 16, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SM-IS-01 maxLength exemption missing from body/content fields across most tools — follow-up to #43867

4 participants