Skip to content

Commit 482ab5a

Browse files
ci: raise agent audit turn limit and preserve logs (#571)
* ci: raise agent audit turn limit and preserve logs The Friday test-health audit hit the 30-turn cap on its first-ever run (2026-04-24) and the agent log was discarded with the self-hosted runner. Heavier recipes need more room, and the next failure should be diagnosable. - Raise --max-turns from 30 to 50 - Switch --output-format from text to stream-json so events are emitted during the run instead of only at process exit; prefix with stdbuf -oL -eL to line-buffer the pipe - Upload /tmp/claude-audit-log.txt and /tmp/audit-<suite>.md as an artifact (if: always(), 14-day retention) using the upload-artifact SHA already pinned in build-notebooks.yml Signed-off-by: Andre Manoel <amanoel@nvidia.com> * ci: disambiguate audit artifact name across run attempts actions/upload-artifact@v4+ rejects duplicate names within a workflow, and re-running a failed run reuses the same github.run_id. Append github.run_attempt so re-runs upload successfully instead of failing at the exact moment the artifact is most useful. Found by Codex review of #571. Signed-off-by: Andre Manoel <amanoel@nvidia.com> * ci: only upload agent log on failure Raise the bar for persisting the full verbose stream-json event log: we only need it when we're actually debugging a failure, and the audit report itself still lands in the step summary on success. Shrinks the window where tool inputs, read file contents, or other verbose-stream detail could end up in a 14-day artifact. Addresses the minor privacy finding from Codex review of #571. Signed-off-by: Andre Manoel <amanoel@nvidia.com> * ci: drop raw agent log from job summary With --output-format stream-json the previous tail -100 of the agent log emitted raw NDJSON into the GH Actions UI summary, which is unreadable. The audit report itself (/tmp/audit-<suite>.md) already carries the human-readable payload, and the full event stream is available as an on-failure artifact, so the raw tail was redundant and worse than nothing for the summary surface. Also rewords the fallback message to point at the artifact when no report lands (typically a failure). Signed-off-by: Andre Manoel <amanoel@nvidia.com> --------- Signed-off-by: Andre Manoel <amanoel@nvidia.com>
1 parent e92c76b commit 482ab5a

1 file changed

Lines changed: 15 additions & 14 deletions

File tree

.github/workflows/agentic-ci-daily.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,11 @@ jobs:
174174
| sed "s|{{date}}|$(date -u +%Y-%m-%d)|g" \
175175
| sed "s|{{memory_path}}|.agentic-ci-state|g")
176176
177-
claude \
177+
stdbuf -oL -eL claude \
178178
--model "$AGENTIC_CI_MODEL" \
179179
-p "$PROMPT" \
180-
--max-turns 30 \
181-
--output-format text \
180+
--max-turns 50 \
181+
--output-format stream-json \
182182
--verbose \
183183
2>&1 | tee /tmp/claude-audit-log.txt
184184
@@ -205,6 +205,17 @@ jobs:
205205
json.dump(state, f, indent=2)
206206
"
207207
208+
- name: Upload agent log
209+
if: failure()
210+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
211+
with:
212+
name: claude-audit-log-${{ matrix.suite }}-${{ github.run_id }}-${{ github.run_attempt }}
213+
path: |
214+
/tmp/claude-audit-log.txt
215+
/tmp/audit-${{ matrix.suite }}.md
216+
retention-days: 14
217+
if-no-files-found: ignore
218+
208219
- name: Write job summary
209220
if: always()
210221
env:
@@ -216,15 +227,5 @@ jobs:
216227
if [ -s "/tmp/audit-${SUITE}.md" ]; then
217228
cat "/tmp/audit-${SUITE}.md" >> "$GITHUB_STEP_SUMMARY"
218229
else
219-
echo "No report generated." >> "$GITHUB_STEP_SUMMARY"
220-
fi
221-
222-
if [ -s "/tmp/claude-audit-log.txt" ]; then
223-
echo "" >> "$GITHUB_STEP_SUMMARY"
224-
echo "<details><summary>Agent log</summary>" >> "$GITHUB_STEP_SUMMARY"
225-
echo "" >> "$GITHUB_STEP_SUMMARY"
226-
echo '```' >> "$GITHUB_STEP_SUMMARY"
227-
tail -100 /tmp/claude-audit-log.txt >> "$GITHUB_STEP_SUMMARY"
228-
echo '```' >> "$GITHUB_STEP_SUMMARY"
229-
echo "</details>" >> "$GITHUB_STEP_SUMMARY"
230+
echo "No report generated. See the \`claude-audit-log-*\` artifact on failures for the full event stream." >> "$GITHUB_STEP_SUMMARY"
230231
fi

0 commit comments

Comments
 (0)