feat: update smoke-ci to use engine command with comment-memory (#27640)#28132
feat: update smoke-ci to use engine command with comment-memory (#27640)#28132
Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/6002d2d6-92b9-4e82-ac15-468b1be07525 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the Smoke CI agentic workflow to run a deterministic engine command (bash script) instead of an AI-prompt-driven Copilot session, while enabling comment-memory support and regenerating the compiled lock workflow.
Changes:
- Replaced
engine: copilotwith a structuredengine: { id: copilot, command: ... }that runs a bash script for PR vs non-PR events. - Enabled
comment-memoryin the workflow tools configuration. - Regenerated
.github/workflows/smoke-ci.lock.ymlto reflect the new engine command and comment-memory wiring.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/smoke-ci.md | Switches engine definition to a deterministic bash command and enables comment-memory tool. |
| .github/workflows/smoke-ci.lock.yml | Recompiled workflow output reflecting engine-command execution and comment-memory setup/config. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (2)
.github/workflows/smoke-ci.md:30
- The
safeoutputs noopmessage says "push event - no PR context" but this branch also runs forschedule(and workflow_dispatch, per the compiled workflow). This is misleading in logs and makes it harder to understand why the noop happened. Consider changing the message to reference "non-pull_request" and/or interpolate${GITHUB_EVENT_NAME}.
/tmp/gh-aw/comment-memory/default.md; fi; else safeoutputs noop --message "smoke-ci:
push event - no PR context, no action needed"; fi'
.github/workflows/smoke-ci.lock.yml:969
- The else-branch noop message hard-codes "push event" even though this branch will also run for
schedule/workflow_dispatch. This makes the workflow output misleading; prefer a message that references "non-pull_request" and/or includes${GITHUB_EVENT_NAME}.
bash -lc 'mkdir -p /tmp/gh-aw/cache-memory /tmp/gh-aw/repo-memory/default; printf "%s\n" "${GITHUB_RUN_ID}" >> /tmp/gh-aw/cache-memory/runs.txt; printf "%s\n" "${GITHUB_RUN_ID}" >> /tmp/gh-aw/repo-memory/default/runs.txt; if [ "${GITHUB_EVENT_NAME}" = "pull_request" ]; then safeoutputs add_comment --body "✅ smoke-ci: safeoutputs CLI comment + comment-memory run (${GITHUB_RUN_ID})"; mkdir -p /tmp/gh-aw/comment-memory; HAIKU="CI lights the path\nGreen checks bloom at dawn\nQuiet bots still sing"; if compgen -G "/tmp/gh-aw/comment-memory/*.md" > /dev/null; then for memory_file in /tmp/gh-aw/comment-memory/*.md; do printf "\n%s\n" "$HAIKU" >> "$memory_file"; done; else printf "%s\n" "$HAIKU" > /tmp/gh-aw/comment-memory/default.md; fi; else safeoutputs noop --message "smoke-ci: push event - no PR context, no action needed"; fi' "$@"
- Files reviewed: 2/2 changed files
- Comments generated: 2
| if [ "${GITHUB_EVENT_NAME}" = "pull_request" ]; then | ||
| safeoutputs add_comment --body "✅ smoke-ci: safeoutputs CLI comment + comment-memory run (${GITHUB_RUN_ID})"; | ||
| mkdir -p /tmp/gh-aw/comment-memory; | ||
| HAIKU="CI lights the path\nGreen checks bloom at dawn\nQuiet bots still sing"; |
There was a problem hiding this comment.
HAIKU is defined with \n inside double quotes, which does not produce real newlines in bash (it becomes a literal backslash+n). As a result, the written comment-memory markdown will contain \n characters instead of a 3-line haiku. Use ANSI-C quoting ($'...') or a multiline literal to ensure the variable contains actual newline characters before writing/appending it.
This issue also appears on line 29 of the same file.
| HAIKU="CI lights the path\nGreen checks bloom at dawn\nQuiet bots still sing"; | |
| HAIKU=$'CI lights the path\nGreen checks bloom at dawn\nQuiet bots still sing'; |
| cat > /tmp/gh-aw/engine-command.sh <<'GH_AW_ENGINE_COMMAND_EOF' | ||
| #!/usr/bin/env bash | ||
| set -eo pipefail | ||
| bash -lc 'mkdir -p /tmp/gh-aw/cache-memory /tmp/gh-aw/repo-memory/default; printf "%s\n" "${GITHUB_RUN_ID}" >> /tmp/gh-aw/cache-memory/runs.txt; printf "%s\n" "${GITHUB_RUN_ID}" >> /tmp/gh-aw/repo-memory/default/runs.txt; if [ "${GITHUB_EVENT_NAME}" = "pull_request" ]; then safeoutputs add_comment --body "✅ smoke-ci: safeoutputs CLI comment + comment-memory run (${GITHUB_RUN_ID})"; mkdir -p /tmp/gh-aw/comment-memory; HAIKU="CI lights the path\nGreen checks bloom at dawn\nQuiet bots still sing"; if compgen -G "/tmp/gh-aw/comment-memory/*.md" > /dev/null; then for memory_file in /tmp/gh-aw/comment-memory/*.md; do printf "\n%s\n" "$HAIKU" >> "$memory_file"; done; else printf "%s\n" "$HAIKU" > /tmp/gh-aw/comment-memory/default.md; fi; else safeoutputs noop --message "smoke-ci: push event - no PR context, no action needed"; fi' "$@" |
There was a problem hiding this comment.
In the generated engine command, HAIKU is defined with \n inside double quotes, which bash does not expand to newline characters. The appended/written markdown will contain literal \n sequences rather than a multi-line haiku. Use ANSI-C quoting ($'...') or a multiline literal so the variable contains real newlines before writing it.
This issue also appears on line 969 of the same file.
| bash -lc 'mkdir -p /tmp/gh-aw/cache-memory /tmp/gh-aw/repo-memory/default; printf "%s\n" "${GITHUB_RUN_ID}" >> /tmp/gh-aw/cache-memory/runs.txt; printf "%s\n" "${GITHUB_RUN_ID}" >> /tmp/gh-aw/repo-memory/default/runs.txt; if [ "${GITHUB_EVENT_NAME}" = "pull_request" ]; then safeoutputs add_comment --body "✅ smoke-ci: safeoutputs CLI comment + comment-memory run (${GITHUB_RUN_ID})"; mkdir -p /tmp/gh-aw/comment-memory; HAIKU="CI lights the path\nGreen checks bloom at dawn\nQuiet bots still sing"; if compgen -G "/tmp/gh-aw/comment-memory/*.md" > /dev/null; then for memory_file in /tmp/gh-aw/comment-memory/*.md; do printf "\n%s\n" "$HAIKU" >> "$memory_file"; done; else printf "%s\n" "$HAIKU" > /tmp/gh-aw/comment-memory/default.md; fi; else safeoutputs noop --message "smoke-ci: push event - no PR context, no action needed"; fi' "$@" | |
| bash -lc 'mkdir -p /tmp/gh-aw/cache-memory /tmp/gh-aw/repo-memory/default; printf "%s\n" "${GITHUB_RUN_ID}" >> /tmp/gh-aw/cache-memory/runs.txt; printf "%s\n" "${GITHUB_RUN_ID}" >> /tmp/gh-aw/repo-memory/default/runs.txt; if [ "${GITHUB_EVENT_NAME}" = "pull_request" ]; then safeoutputs add_comment --body "✅ smoke-ci: safeoutputs CLI comment + comment-memory run (${GITHUB_RUN_ID})"; mkdir -p /tmp/gh-aw/comment-memory; HAIKU=$'"'"'CI lights the path\nGreen checks bloom at dawn\nQuiet bots still sing'"'"'; if compgen -G "/tmp/gh-aw/comment-memory/*.md" > /dev/null; then for memory_file in /tmp/gh-aw/comment-memory/*.md; do printf "\n%s\n" "$HAIKU" >> "$memory_file"; done; else printf "%s\n" "$HAIKU" > /tmp/gh-aw/comment-memory/default.md; fi; else safeoutputs noop --message "smoke-ci: push event - no PR context, no action needed"; fi' "$@" |
Summary
Updates
smoke-ci.mdto replace the simpleengine: copilotstring with a structured engine object that includes a direct bashcommand, replacing the AI-agent-driven prompt with a deterministic shell script.Changes
engine: Changed fromengine: copilottoengine: { id: copilot, command: ... }with a bash script that:runs.txtin bothpull_requestevents: callssafeoutputs add_comment, creates/tmp/gh-aw/comment-memory/, and appends/writes a haiku to comment-memory markdown file(s)safeoutputs noopwith an informational messagetools: Addedcomment-memory: truealongside the existingcache-memory: trueandrepo-memoryentriessmoke-ci.lock.yml: Regenerated viamake recompile