Summary
The compiled <safe-output-tools> prompt block in the agent run: heredoc now inlines ${{ }} expressions from max: safe-output config values. This makes the entire run: block subject to the 21KB expression-size limit, causing compilation failures for workflows with large prompts (many imported fragments).
This is a regression from the fix for #21157, which addressed the same root cause in the tools.json block. The <safe-output-tools> prompt section is a different code path that was not covered by that fix.
Reproduction
Any workflow with:
- Many imported fragments (large total prompt)
- A safe-output
max: value using ${{ inputs.* }}
For example:
# fragment: safe-output-review-comment.md
safe-outputs:
create-pull-request-review-comment:
max: ${{ inputs.create-pull-request-review-comment-max }}
Compiles to (inside the prompt heredoc):
<safe-output-tools>
Tools: add_comment, create_pull_request_review_comment(max:${{ inputs.create-pull-request-review-comment-max }}), ...
</safe-output-tools>
The old compiler (v0.62.4) emitted <safe-output-tools> without (max:...) annotations, so no ${{ }} appeared in the heredoc.
Affected workflows
gh-aw-mention-in-pr.md (26.4 KB, limit 20.5 KB)
gh-aw-mention-in-pr-no-sandbox.md (24.0 KB)
gh-aw-estc-docs-pr-review.md (22.9 KB)
Expected behavior
The (max:N) annotations in <safe-output-tools> should either:
- Extract
${{ }} expressions to GH_AW_EXPR_* env vars (like the rest of the prompt), or
- Resolve the expression value before embedding it in the prompt text
Workaround
Hardcode max: values in the safe-output fragment instead of using ${{ inputs.* }}:
safe-outputs:
create-pull-request-review-comment:
max: 30 # was: ${{ inputs.create-pull-request-review-comment-max }}
This removes the ${{ }} from the heredoc entirely, so the 21KB limit no longer applies.
Related
Summary
The compiled
<safe-output-tools>prompt block in the agentrun:heredoc now inlines${{ }}expressions frommax:safe-output config values. This makes the entirerun:block subject to the 21KB expression-size limit, causing compilation failures for workflows with large prompts (many imported fragments).This is a regression from the fix for #21157, which addressed the same root cause in the
tools.jsonblock. The<safe-output-tools>prompt section is a different code path that was not covered by that fix.Reproduction
Any workflow with:
max:value using${{ inputs.* }}For example:
Compiles to (inside the prompt heredoc):
The old compiler (v0.62.4) emitted
<safe-output-tools>without(max:...)annotations, so no${{ }}appeared in the heredoc.Affected workflows
gh-aw-mention-in-pr.md(26.4 KB, limit 20.5 KB)gh-aw-mention-in-pr-no-sandbox.md(24.0 KB)gh-aw-estc-docs-pr-review.md(22.9 KB)Expected behavior
The
(max:N)annotations in<safe-output-tools>should either:${{ }}expressions toGH_AW_EXPR_*env vars (like the rest of the prompt), orWorkaround
Hardcode
max:values in the safe-output fragment instead of using${{ inputs.* }}:This removes the
${{ }}from the heredoc entirely, so the 21KB limit no longer applies.Related