Skip to content

performance-improver.yml workflow causes 'Argument list too long' error with jq #14

@b0x1

Description

@b0x1

Problem

The example performance-improver.yml workflow fails due to an Argument list too long error in the workflow job. The error occurs when building the jules_payload.json file using jq:

jq -n --arg jules_prompt "$(cat prompt.txt)" --arg starting_branch "main" --arg repo_full_name "b0x1/webcol" '{
    "prompt": $jules_prompt,
    "sourceContext": {
      "source": "sources/github/\($repo_full_name)",
      "githubRepoContext": {
        "startingBranch": $starting_branch
      }
    },
    "requirePlanApproval": false,
    "automationMode": "AUTO_CREATE_PR"
  }' > jules_payload.json

Error excerpt from run: See workflow failure

/home/runner/work/_temp/a5139c5e-55cc-446e-a46b-f80b5fe51c73.sh: line 1: /usr/bin/jq: Argument list too long
Error: Process completed with exit code 126.

Steps to Reproduce

  1. Use the example performance-improver.yml workflow as shown in the documentation.
  2. Ensure that prompt.txt is large enough to hit argument size limits.
  3. Observe the error during the job.

Additional Context

Expected Behavior

The workflow should succeed even when prompt.txt is large.

Actual Behavior

The jq command fails when prompt.txt content is large, due to shell argument limitations.

Suggestion

Consider reading prompt.txt inside the jq invocation using an alternative method (e.g. using --slurpfile or redirecting input), or splitting the input in a way that avoids exceeding shell argument limits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions