From 9ab51831296c3b3a8cfaebf35269f42c89d11020 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Mon, 25 May 2026 14:11:07 +0000
Subject: [PATCH 1/2] Initial plan
From 1cae6570c3e51e5b891f35aa7efe9fe98e300f4c Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Mon, 25 May 2026 14:31:40 +0000
Subject: [PATCH 2/2] ci: optimize smoke claude single-turn execution
---
.github/workflows/smoke-claude.lock.yml | 41 ++++++++++++-------
.github/workflows/smoke-claude.md | 50 +++++++++++++++++++++---
scripts/ci/smoke-claude-workflow.test.ts | 17 ++++++--
3 files changed, 83 insertions(+), 25 deletions(-)
diff --git a/.github/workflows/smoke-claude.lock.yml b/.github/workflows/smoke-claude.lock.yml
index f8ce7b063..a9b98728c 100644
--- a/.github/workflows/smoke-claude.lock.yml
+++ b/.github/workflows/smoke-claude.lock.yml
@@ -1,4 +1,4 @@
-# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"cf1ccc0a1a68d8042425c7524e3c40fea5040e60260bb21a6f87723cc00ec2bc","compiler_version":"v0.74.8","agent_id":"claude","agent_model":"claude-haiku-4-5"}
+# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"aa82e9ded2984cb3b99a12c43f339d8591853ea801b005a7c8da05ac65626619","compiler_version":"v0.74.8","agent_id":"claude","agent_model":"claude-haiku-4-5"}
# gh-aw-manifest: {"version":1,"secrets":["ANTHROPIC_API_KEY","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"efa55847f72aadb03490d955263ff911bf758700","version":"v0.74.8"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.25.29","digest":"sha256:e68f37e36962dcb3f3d1de680a49bc2302cefd001b941a7dc377155ec7ce42f4","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.25.29@sha256:e68f37e36962dcb3f3d1de680a49bc2302cefd001b941a7dc377155ec7ce42f4"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.29","digest":"sha256:d1219e4110684402aabbeb5a43858f26790c9d0be210581cf3f7a521bd2c87b6","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.29@sha256:d1219e4110684402aabbeb5a43858f26790c9d0be210581cf3f7a521bd2c87b6"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.29","digest":"sha256:8a71ad9e40454051672312917e51567abfb8251d7c294d086c48f63d84e4cb53","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.25.29@sha256:8a71ad9e40454051672312917e51567abfb8251d7c294d086c48f63d84e4cb53"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.1","digest":"sha256:287fad0236959f3b3d9936ea1ef8d5b4f135ef2a5f5789713495cbbef191e60c","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.1@sha256:287fad0236959f3b3d9936ea1ef8d5b4f135ef2a5f5789713495cbbef191e60c"},{"image":"ghcr.io/github/github-mcp-server:v1.0.4"},{"image":"node:lts-alpine","digest":"sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f","pinned_image":"node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f"}]}
# ___ _ _
# / _ \ | | (_)
@@ -213,20 +213,20 @@ jobs:
run: |
bash "${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh"
{
- cat << 'GH_AW_PROMPT_54aa508f17c5dc89_EOF'
+ cat << 'GH_AW_PROMPT_71b4e61ab989cc7c_EOF'
- GH_AW_PROMPT_54aa508f17c5dc89_EOF
+ GH_AW_PROMPT_71b4e61ab989cc7c_EOF
cat "${RUNNER_TEMP}/gh-aw/prompts/xpia.md"
cat "${RUNNER_TEMP}/gh-aw/prompts/temp_folder_prompt.md"
cat "${RUNNER_TEMP}/gh-aw/prompts/markdown.md"
cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_prompt.md"
- cat << 'GH_AW_PROMPT_54aa508f17c5dc89_EOF'
+ cat << 'GH_AW_PROMPT_71b4e61ab989cc7c_EOF'
Tools: add_comment, add_labels, missing_tool, missing_data, noop
- GH_AW_PROMPT_54aa508f17c5dc89_EOF
+ GH_AW_PROMPT_71b4e61ab989cc7c_EOF
cat "${RUNNER_TEMP}/gh-aw/prompts/mcp_cli_tools_prompt.md"
- cat << 'GH_AW_PROMPT_54aa508f17c5dc89_EOF'
+ cat << 'GH_AW_PROMPT_71b4e61ab989cc7c_EOF'
The following GitHub context information is available for this workflow:
{{#if github.actor}}
@@ -255,12 +255,12 @@ jobs:
{{/if}}
- GH_AW_PROMPT_54aa508f17c5dc89_EOF
+ GH_AW_PROMPT_71b4e61ab989cc7c_EOF
cat "${RUNNER_TEMP}/gh-aw/prompts/github_mcp_tools_with_safeoutputs_prompt.md"
- cat << 'GH_AW_PROMPT_54aa508f17c5dc89_EOF'
+ cat << 'GH_AW_PROMPT_71b4e61ab989cc7c_EOF'
{{#runtime-import .github/workflows/smoke-claude.md}}
- GH_AW_PROMPT_54aa508f17c5dc89_EOF
+ GH_AW_PROMPT_71b4e61ab989cc7c_EOF
} > "$GH_AW_PROMPT"
- name: Interpolate variables and render templates
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
@@ -428,6 +428,14 @@ jobs:
run: |
cat /tmp/gh-aw/agent/smoke-test-claude-$GH_AW_GITHUB_RUN_ID.txt
echo "File verification: PASS"
+ - name: Export workflow context
+ run: |-
+ cat > /tmp/gh-aw/agent/workflow-context.env << 'ENVEOF'
+ export GITHUB_EVENT_NAME="${{ github.event_name }}"
+ export GITHUB_RUN_ID="${{ github.run_id }}"
+ export PR_NUMBER="${{ github.event.pull_request.number || '' }}"
+ ENVEOF
+ echo "Context exported to /tmp/gh-aw/agent/workflow-context.env"
- name: Configure Git credentials
env:
@@ -521,9 +529,9 @@ jobs:
mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs"
mkdir -p /tmp/gh-aw/safeoutputs
mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs
- cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_f4ed1972422821e0_EOF'
+ cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_ef8bde012af5b6fa_EOF'
{"add_comment":{"hide_older_comments":true,"max":1},"add_labels":{"allowed":["smoke-claude"]},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}}
- GH_AW_SAFE_OUTPUTS_CONFIG_f4ed1972422821e0_EOF
+ GH_AW_SAFE_OUTPUTS_CONFIG_ef8bde012af5b6fa_EOF
- name: Generate Safe Outputs Tools
env:
GH_AW_TOOLS_META_JSON: |
@@ -736,7 +744,7 @@ jobs:
export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host --add-host host.docker.internal:127.0.0.1 --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v '"${DOCKER_SOCK_PATH}"':/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DOCKER_HOST=unix:///var/run/docker.sock -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GH_AW_SAFE_OUTPUTS_PORT -e GH_AW_SAFE_OUTPUTS_API_KEY -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.3.1'
GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node)
- cat << GH_AW_MCP_CONFIG_f26a0d66f912ab77_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs"
+ cat << GH_AW_MCP_CONFIG_fce2950d91d3e0a7_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs"
{
"mcpServers": {
"github": {
@@ -776,7 +784,7 @@ jobs:
"payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}"
}
}
- GH_AW_MCP_CONFIG_f26a0d66f912ab77_EOF
+ GH_AW_MCP_CONFIG_fce2950d91d3e0a7_EOF
- name: Mount MCP servers as CLIs
id: mount-mcp-clis
continue-on-error: true
@@ -884,7 +892,7 @@ jobs:
# shellcheck disable=SC1003
sudo -E awf --config "${RUNNER_TEMP}/gh-aw/awf-config.json" --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --tty --env-all --exclude-env ANTHROPIC_API_KEY --exclude-env GITHUB_MCP_SERVER_TOKEN --exclude-env MCP_GATEWAY_API_KEY --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --session-state-dir /tmp/gh-aw/sandbox/agent/session-state --enable-host-access --allow-host-ports 80,443,8080 --skip-pull \
- -- /bin/bash -c 'export PATH="${RUNNER_TEMP}/gh-aw/mcp-cli/bin:$PATH" && export PATH="$(find /opt/hostedtoolcache /home/runner/work/_tool -maxdepth 5 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || true)"; fi; if [ -z "$GH_AW_NODE_EXEC" ]; then echo "node runtime missing on this runner — check runtimes.node in workflow YAML" >&2; exit 127; fi; "$GH_AW_NODE_EXEC" ${RUNNER_TEMP}/gh-aw/actions/claude_harness.cjs claude --print --no-chrome --max-turns 5 --allowed-tools '\''Bash,BashOutput,Edit,Edit(/tmp/*),ExitPlanMode,Glob,Grep,KillBash,LS,MultiEdit,MultiEdit(/tmp/*),NotebookEdit,NotebookRead,Read,Read(/tmp/*),Task,TodoWrite,Write,Write(/tmp/*),mcp__github__download_workflow_run_artifact,mcp__github__get_code_scanning_alert,mcp__github__get_commit,mcp__github__get_dependabot_alert,mcp__github__get_discussion,mcp__github__get_discussion_comments,mcp__github__get_file_contents,mcp__github__get_job_logs,mcp__github__get_label,mcp__github__get_latest_release,mcp__github__get_me,mcp__github__get_notification_details,mcp__github__get_pull_request,mcp__github__get_pull_request_comments,mcp__github__get_pull_request_diff,mcp__github__get_pull_request_files,mcp__github__get_pull_request_review_comments,mcp__github__get_pull_request_reviews,mcp__github__get_pull_request_status,mcp__github__get_release_by_tag,mcp__github__get_secret_scanning_alert,mcp__github__get_tag,mcp__github__get_workflow_run,mcp__github__get_workflow_run_logs,mcp__github__get_workflow_run_usage,mcp__github__issue_read,mcp__github__list_branches,mcp__github__list_code_scanning_alerts,mcp__github__list_commits,mcp__github__list_dependabot_alerts,mcp__github__list_discussion_categories,mcp__github__list_discussions,mcp__github__list_issue_types,mcp__github__list_issues,mcp__github__list_label,mcp__github__list_notifications,mcp__github__list_pull_requests,mcp__github__list_releases,mcp__github__list_secret_scanning_alerts,mcp__github__list_starred_repositories,mcp__github__list_tags,mcp__github__list_workflow_jobs,mcp__github__list_workflow_run_artifacts,mcp__github__list_workflow_runs,mcp__github__list_workflows,mcp__github__pull_request_read,mcp__github__search_code,mcp__github__search_issues,mcp__github__search_orgs,mcp__github__search_pull_requests,mcp__github__search_repositories,mcp__github__search_users,mcp__safeoutputs'\'' --debug-file /tmp/gh-aw/agent-stdio.log --verbose --permission-mode bypassPermissions --output-format stream-json --mcp-config "${RUNNER_TEMP}/gh-aw/mcp-config/mcp-servers.json" --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log
+ -- /bin/bash -c 'export PATH="${RUNNER_TEMP}/gh-aw/mcp-cli/bin:$PATH" && export PATH="$(find /opt/hostedtoolcache /home/runner/work/_tool -maxdepth 5 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || true)"; fi; if [ -z "$GH_AW_NODE_EXEC" ]; then echo "node runtime missing on this runner — check runtimes.node in workflow YAML" >&2; exit 127; fi; "$GH_AW_NODE_EXEC" ${RUNNER_TEMP}/gh-aw/actions/claude_harness.cjs claude --print --no-chrome --max-turns 2 --allowed-tools '\''Bash,BashOutput,Edit,Edit(/tmp/*),ExitPlanMode,Glob,Grep,KillBash,LS,MultiEdit,MultiEdit(/tmp/*),NotebookEdit,NotebookRead,Read,Read(/tmp/*),Task,TodoWrite,Write,Write(/tmp/*),mcp__github__download_workflow_run_artifact,mcp__github__get_code_scanning_alert,mcp__github__get_commit,mcp__github__get_dependabot_alert,mcp__github__get_discussion,mcp__github__get_discussion_comments,mcp__github__get_file_contents,mcp__github__get_job_logs,mcp__github__get_label,mcp__github__get_latest_release,mcp__github__get_me,mcp__github__get_notification_details,mcp__github__get_pull_request,mcp__github__get_pull_request_comments,mcp__github__get_pull_request_diff,mcp__github__get_pull_request_files,mcp__github__get_pull_request_review_comments,mcp__github__get_pull_request_reviews,mcp__github__get_pull_request_status,mcp__github__get_release_by_tag,mcp__github__get_secret_scanning_alert,mcp__github__get_tag,mcp__github__get_workflow_run,mcp__github__get_workflow_run_logs,mcp__github__get_workflow_run_usage,mcp__github__issue_read,mcp__github__list_branches,mcp__github__list_code_scanning_alerts,mcp__github__list_commits,mcp__github__list_dependabot_alerts,mcp__github__list_discussion_categories,mcp__github__list_discussions,mcp__github__list_issue_types,mcp__github__list_issues,mcp__github__list_label,mcp__github__list_notifications,mcp__github__list_pull_requests,mcp__github__list_releases,mcp__github__list_secret_scanning_alerts,mcp__github__list_starred_repositories,mcp__github__list_tags,mcp__github__list_workflow_jobs,mcp__github__list_workflow_run_artifacts,mcp__github__list_workflow_runs,mcp__github__list_workflows,mcp__github__pull_request_read,mcp__github__search_code,mcp__github__search_issues,mcp__github__search_orgs,mcp__github__search_pull_requests,mcp__github__search_repositories,mcp__github__search_users,mcp__safeoutputs'\'' --debug-file /tmp/gh-aw/agent-stdio.log --verbose --permission-mode bypassPermissions --output-format stream-json --mcp-config "${RUNNER_TEMP}/gh-aw/mcp-config/mcp-servers.json" --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
ANTHROPIC_MODEL: claude-haiku-4-5
@@ -894,7 +902,7 @@ jobs:
DISABLE_BUG_COMMAND: 1
DISABLE_ERROR_REPORTING: 1
DISABLE_TELEMETRY: 1
- GH_AW_MAX_TURNS: 5
+ GH_AW_MAX_TURNS: 2
GH_AW_MCP_CONFIG: ${{ runner.temp }}/gh-aw/mcp-config/mcp-servers.json
GH_AW_PHASE: agent
GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
@@ -1038,6 +1046,9 @@ jobs:
run: "echo \"=== Final Claude Code Config ===\"\nif [ -f ~/.claude.json ]; then\n echo \"File: ~/.claude.json\"\n cat ~/.claude.json\nelse\n echo \"~/.claude.json not found\"\nfi\nif [ -f ~/.claude/config.json ]; then\n echo \"\"\n echo \"File: ~/.claude/config.json (legacy)\"\n cat ~/.claude/config.json\nelse\n echo \"~/.claude/config.json not found\"\nfi\n"
- name: Validate safe outputs were invoked
run: "OUTPUTS_FILE=\"${GH_AW_SAFE_OUTPUTS:-${RUNNER_TEMP}/gh-aw/safeoutputs/outputs.jsonl}\"\nif [ ! -s \"$OUTPUTS_FILE\" ]; then\n echo \"::error::No safe outputs were invoked. Smoke tests require the agent to call safe output tools.\"\n exit 1\nfi\necho \"Safe output entries found: $(wc -l < \"$OUTPUTS_FILE\")\"\nif [ \"$GITHUB_EVENT_NAME\" = \"pull_request\" ]; then\n if ! grep -q '\"add_comment\"' \"$OUTPUTS_FILE\"; then\n echo \"::error::Agent did not call add_comment on a pull_request trigger.\"\n exit 1\n fi\n echo \"add_comment verified for PR trigger\"\nfi\necho \"Safe output validation passed\"\n"
+ - if: always()
+ name: Report turn usage
+ run: "TURN_COUNT=\"${GH_AW_TURN_COUNT:-unknown}\"\necho \"::notice::Smoke test completed in ${TURN_COUNT} turns (target: 1)\"\n"
- name: Upload agent artifacts
if: always()
diff --git a/.github/workflows/smoke-claude.md b/.github/workflows/smoke-claude.md
index 8d77a0dee..afc33d8e3 100644
--- a/.github/workflows/smoke-claude.md
+++ b/.github/workflows/smoke-claude.md
@@ -16,7 +16,7 @@ name: Smoke Claude
engine:
id: claude
model: claude-haiku-4-5
- max-turns: 5
+ max-turns: 2
sandbox:
agent:
version: v0.25.29
@@ -70,6 +70,14 @@ steps:
run: |
cat /tmp/gh-aw/agent/smoke-test-claude-${{ github.run_id }}.txt
echo "File verification: PASS"
+ - name: Export workflow context
+ run: |
+ cat > /tmp/gh-aw/agent/workflow-context.env << 'ENVEOF'
+ export GITHUB_EVENT_NAME="${{ github.event_name }}"
+ export GITHUB_RUN_ID="${{ github.run_id }}"
+ export PR_NUMBER="${{ github.event.pull_request.number || '' }}"
+ ENVEOF
+ echo "Context exported to /tmp/gh-aw/agent/workflow-context.env"
post-steps:
- name: Show final Claude Code config
if: always()
@@ -104,6 +112,11 @@ post-steps:
echo "add_comment verified for PR trigger"
fi
echo "Safe output validation passed"
+ - name: Report turn usage
+ if: always()
+ run: |
+ TURN_COUNT="${GH_AW_TURN_COUNT:-unknown}"
+ echo "::notice::Smoke test completed in ${TURN_COUNT} turns (target: 1)"
---
# Smoke Test: Claude Engine Validation
@@ -112,12 +125,37 @@ Pre-computed data is available:
- **GitHub API**: Recent PRs in `/tmp/gh-aw/agent/recent-prs.json` (already fetched)
- **GitHub check**: Already verified in pre-step — read result from `/tmp/gh-aw/agent/smoke-context.txt`
- **File verify**: `/tmp/gh-aw/agent/smoke-test-claude-${{ github.run_id }}.txt` (already verified in pre-step)
+- **Workflow context**: Source `/tmp/gh-aw/agent/workflow-context.env` for trigger/run variables
+
+**CRITICAL — Single Response Execution:**
+This workflow MUST complete in exactly 1 LLM turn (your first response).
+All required data exists in pre-created files. There is nothing to explore, investigate, or validate beyond reading the 3 files listed below.
+
+Steps:
+1. Make ONE bash tool call containing all commands shown below
+2. Make ONE safeoutputs tool call based on the trigger type
+3. End your response — task complete
+
+If you find yourself thinking "I should check..." or "Let me verify..." — STOP. The pre-steps already verified everything.
+
+## Expected Commands
+
+Execute these commands in a single bash response:
+
+```bash
+source /tmp/gh-aw/agent/workflow-context.env
+cat /tmp/gh-aw/agent/recent-prs.json
+cat /tmp/gh-aw/agent/smoke-context.txt
+cat /tmp/gh-aw/agent/smoke-test-claude-${GITHUB_RUN_ID}.txt
+if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
+ printf '{"issue_number":%s,"body":"✅ All checks passed"}' "$PR_NUMBER" > /tmp/gh-aw/agent/result.json
+ safeoutputs add_comment . < /tmp/gh-aw/agent/result.json
+else
+ safeoutputs noop --message "Smoke test completed successfully"
+fi
+```
-**IMPORTANT — Complete in 1 pass:**
-All data is pre-loaded. Do NOT make additional reads or explorations.
-1. `cat /tmp/gh-aw/agent/recent-prs.json` → confirm 2 entries
-2. `cat /tmp/gh-aw/agent/smoke-context.txt` → confirm `playwright_check` is `✅ PASS`
-3. `cat /tmp/gh-aw/agent/smoke-test-claude-${{ github.run_id }}.txt` → confirm exists
+Do not explore, validate, or make additional checks. All data is pre-verified.
Your tasks (1 line per result):
1. **GitHub API**: Read `/tmp/gh-aw/agent/recent-prs.json` and confirm 2 PR entries exist
diff --git a/scripts/ci/smoke-claude-workflow.test.ts b/scripts/ci/smoke-claude-workflow.test.ts
index 018a35d02..2a70f1649 100644
--- a/scripts/ci/smoke-claude-workflow.test.ts
+++ b/scripts/ci/smoke-claude-workflow.test.ts
@@ -9,27 +9,36 @@ describe('smoke claude workflow optimization config', () => {
it('uses pre-step GitHub check and stricter turn budget in source workflow', () => {
const source = fs.readFileSync(smokeClaudeSourcePath, 'utf-8');
- expect(source).toContain('max-turns: 5');
+ expect(source).toContain('max-turns: 2');
expect(source).toContain('Check GitHub.com reachability');
expect(source).toContain('/tmp/gh-aw/agent/smoke-context.txt');
expect(source).toContain('curl -fsSL --max-time 15 https://github.com');
expect(source).not.toContain("grep -oP '(?<=
)[^<]+'");
expect(source).toContain('> "$CONTEXT_FILE"');
- expect(source).toContain('**IMPORTANT — Complete in 1 pass:**');
+ expect(source).toContain('Export workflow context');
+ expect(source).toContain('/tmp/gh-aw/agent/workflow-context.env');
+ expect(source).toContain('**CRITICAL — Single Response Execution:**');
+ expect(source).toContain('## Expected Commands');
+ expect(source).toContain('source /tmp/gh-aw/agent/workflow-context.env');
+ expect(source).toContain('safeoutputs add_comment . < /tmp/gh-aw/agent/result.json');
expect(source).toContain("Use the `safeoutputs` CLI (`add_comment`, `add_labels`, `noop`) with real arguments.");
expect(source).toContain('Do not use pipe-to-stdin for safeoutputs JSON payloads.');
expect(source).toContain('Never call `add_comment` or `add_labels` with empty arguments');
+ expect(source).toContain('Report turn usage');
+ expect(source).toContain('GH_AW_TURN_COUNT');
expect(source).not.toContain('tools:\n playwright:');
expect(source).not.toContain(' - playwright');
expect(source).not.toContain('Ensure playwright log directory is writable');
});
- it('compiles the workflow without playwright tools and with max-turns 5', () => {
+ it('compiles the workflow without playwright tools and with max-turns 2', () => {
const lock = fs.readFileSync(smokeClaudeLockPath, 'utf-8');
- expect(lock).toContain('--max-turns 5');
+ expect(lock).toContain('--max-turns 2');
expect(lock).toContain('Check GitHub.com reachability');
expect(lock).toContain('playwright_check=✅ PASS');
+ expect(lock).toContain('Export workflow context');
+ expect(lock).toContain('Report turn usage');
expect(lock).toContain(
'github/gh-aw-actions/setup@efa55847f72aadb03490d955263ff911bf758700 # v0.74.8'
);