Skip to content

issue intents: align rationale maxLength to API limit of 280 characters #42754

Description

@alondahari

Summary

The rationale field on set_issue_type, set_issue_field, and add_labels has no maxLength in the tool schema (safe_outputs_tools.json), so the agent writes arbitrarily long rationales. The runtime truncates to 1024 characters (issue_intents.cjs), but the GitHub API enforces a 280 character limit — causing mutations to fail with "rationale is too long (maximum is 280)".

Root cause

Three layers with mismatched limits:

Layer Limit Effect
Tool schema (safe_outputs_tools.json) none Agent writes unbounded rationales
Runtime validation (issue_intents.cjs) 1024 Truncates, but still too long for API
GitHub GraphQL API 280 Rejects anything over 280 chars

Fix

  1. safe_outputs_tools.json — Add maxLength: 280 and update description to "Optional rationale for the change (max 280 characters)." on all rationale fields:

    • set_issue_type.rationale
    • set_issue_field.rationale
    • add_labels.labels[].rationale
    • remove_labels.labels[].rationale
    • update_issue.labels[].rationale
  2. issue_intents.cjs — Change ISSUE_INTENT_RATIONALE_MAX_LENGTH from 1024 to 280.

  3. safe_output_type_validator.cjs — Change hardcoded maxLength: 1024 to 280 in the label rationale sanitization (line 136).

  4. safe_output_type_validator.test.cjs — Update test expectations from 1024 to 280.

Affected files

  • actions/setup/js/safe_outputs_tools.json
  • actions/setup/js/issue_intents.cjs
  • actions/setup/js/safe_output_type_validator.cjs
  • actions/setup/js/safe_output_type_validator.test.cjs

Verification

Validated locally — all 86 validator tests and 65 add_labels/set_issue_field tests pass after the change.

The 280 limit was confirmed by a live workflow run in a sandbox where a rationale exceeding 280 chars caused:

Failed to set issue field on issue #551: Request failed due to following response errors:
 - rationale is too long (maximum is 280)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions