Skip to content

Commit 97f3442

Browse files
lostindarkCopilot
andcommitted
fix: enforce single save_highlights call and improve output extraction
- Instruct agent to call save_highlights exactly once (system limit) - Improve jq to find last item with highlights field across all items - Prevents 'Too many items' errors from duplicate calls Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 42489cc commit 97f3442

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

.github/workflows/release-highlights.lock.yml

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/release-highlights.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ safe-outputs:
2828
run: |
2929
# Try multiple possible paths in agent output
3030
HIGHLIGHTS=$(jq -r '
31+
[.items[] | select(.type == "save_highlights" and .highlights)] | last | .highlights //
3132
.items[0].highlights //
3233
.items[0].body //
3334
.items[0].content //
34-
(.items[] | select(.type == "save_highlights") | .highlights) //
3535
empty
3636
' "$GH_AW_AGENT_OUTPUT" 2>/dev/null || true)
3737
if [ -z "$HIGHLIGHTS" ]; then
@@ -120,9 +120,9 @@ Dependency updates and internal improvements to keep things running smoothly.
120120

121121
### 5. Save Highlights
122122

123-
**CRITICAL**: You MUST call the `save_highlights` tool to save the generated highlights. After calling it successfully, **STOP immediately**. Do not investigate the workflow internals or try to verify how the tool works.
123+
**CRITICAL**: Call `save_highlights` **exactly once** with the complete highlights. Do NOT call it multiple times — the system only allows one call. After calling it, **STOP immediately**.
124124

125-
**✅ CORRECT - Call the tool directly:**
125+
**✅ CORRECT - Call the tool exactly once:**
126126
```
127127
safeoutputs/save_highlights(
128128
highlights="## 🌟 Release Highlights\n\n[Your complete markdown highlights here]"

0 commit comments

Comments
 (0)