Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion actions/setup/js/safe_outputs_tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"body": {
"type": "string",
"minLength": 20,
"maxLength": 65536,
"description": "Detailed issue description in Markdown. Must be the final intended body \u2014 not a placeholder or test value. Do NOT repeat the title as a heading since it already appears as the issue's h1. Include context, reproduction steps, or acceptance criteria as appropriate."
Comment on lines 13 to 17
},
"labels": {
Expand Down Expand Up @@ -99,7 +100,8 @@
},
"body": {
"type": "string",
"description": "Discussion content in Markdown. Do NOT repeat the title as a heading since it already appears as the discussion's h1. Include all relevant context, findings, or questions. Maximum 10 KB (10240 bytes). If your content is larger, trim it, link to an external artifact (for example a gist), or upload content via upload_asset instead of inlining."
"maxLength": 65536,
"description": "Discussion content in Markdown. Do NOT repeat the title as a heading since it already appears as the discussion's h1. Include all relevant context, findings, or questions."
},
"category": {
"type": "string",
Expand Down
4 changes: 3 additions & 1 deletion pkg/workflow/js/safe_outputs_tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"body": {
"type": "string",
"minLength": 20,
"maxLength": 65536,

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.

[/tdd] No regression test for the fixed bug — a body > 10 KB should now be accepted for create_issue, but there is no test guarding against this regression.

💡 Suggested test shape

In safe_outputs_tools_test.go or samples_validation_test.go, add a case that validates a create_issue.body value larger than 10 KB against the embedded JSON schema and asserts it passes. Without this, the 10 KB cap could silently creep back in future schema edits without any failing test.

func TestSafeOutputsToolsBodyAcceptsLargeContent(t *testing.T) {
    bigBody := strings.Repeat("x", 11000) // > 10 KB, within new 65536 limit
    // validate bigBody against the embedded safe_outputs_tools.json schema for create_issue
    // expect: no maxLength violation
}

@copilot please address this.

"description": "Detailed issue description in Markdown. Must be the final intended body \u2014 not a placeholder or test value. Do NOT repeat the title as a heading since it already appears as the issue's h1. Include context, reproduction steps, or acceptance criteria as appropriate."
Comment on lines 13 to 17
},
"labels": {
Expand Down Expand Up @@ -99,7 +100,8 @@
},
"body": {
"type": "string",
"description": "Discussion content in Markdown. Do NOT repeat the title as a heading since it already appears as the discussion's h1. Include all relevant context, findings, or questions. Maximum 10 KB (10240 bytes). If your content is larger, trim it, link to an external artifact (for example a gist), or upload content via upload_asset instead of inlining."
"maxLength": 65536,
"description": "Discussion content in Markdown. Do NOT repeat the title as a heading since it already appears as the discussion's h1. Include all relevant context, findings, or questions."

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.

Lost overflow guidance may degrade agent behaviour: the removed description told agents what to do when content exceeds the limit; no equivalent guidance has been added for the new 65536-byte ceiling.

💡 Explanation

The deleted text said:

If your content is larger, trim it, link to an external artifact (for example a gist), or upload content via upload_asset instead of inlining.

That guidance was tied to the old accidental 10 KB cap, but the need for fallback advice doesn't go away — it just applies to a different threshold now. Compare add_comment.body, which still contains:

If these limits are exceeded, the tool call will fail with a detailed error message indicating which constraint was violated.

Without equivalent wording in create_discussion.body, an AI agent that generates a 70 KB discussion body has no cue that it should trim or link out before calling the tool. Consider adding at minimum:

"description": "Discussion content in Markdown ... If your content exceeds 65536 characters, trim it or link to an external artifact instead of inlining."

Non-blocking — the schema constraint itself is correct — but this omission will silently degrade agent behaviour on large payloads.

},
"category": {
"type": "string",
Expand Down
Loading