Optimize Smoke Claude workflow token footprint and turn budget#3321
Conversation
🧪 Smoke Test: Copilot BYOK (Offline) Mode
Running in BYOK offline mode ( Overall: FAIL — pre-step template variables were not substituted; smoke-data outputs unavailable.
|
Smoke Test Results✅ GitHub API: 2 PR entries confirmed in recent-prs.json Result: PASS — All smoke tests passed.
|
🔬 Smoke Test Results
Overall: FAIL — GitHub MCP auth failed; workflow template variables were not substituted before agent execution.
|
Smoke Test Results\n- GitHub MCP Testing: ❌ (mcpscripts not found)\n- GitHub.com Connectivity: ❌ (SSL error 35)\n- File Writing Testing: ✅\n- Bash Tool Testing: ✅\n\nOverall status: FAILWarning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
|
Smoke Test: FAIL Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
There was a problem hiding this comment.
Pull request overview
This PR aims to reduce the Smoke Claude workflow’s per-run token overhead and agent turn usage by removing unused GitHub MCP tooling context and moving deterministic checks into pre-agent workflow steps, while tightening the maximum turn budget.
Changes:
- Reduced Claude
max-turnsfrom 12 to 8 and updated the smoke-test prompt to rely on precomputed artifacts. - Added pre-agent steps to (a) prefetch recent merged PR metadata into
/tmp/gh-aw/agent/recent-prs.jsonand (b) verify the smoke-test file exists. - Regenerated
.github/workflows/smoke-claude.lock.ymlto reflect the updated source workflow.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/smoke-claude.md | Trims workflow context, adds pre-agent deterministic checks, and tightens agent turn budget. |
| .github/workflows/smoke-claude.lock.yml | Compiled artifact refresh reflecting (and operationalizing) the workflow changes. |
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-claude.lock.yml:730
- This lock file now starts a
githubMCP server (and wiresGITHUB_MCP_SERVER_TOKEN/guard policies), which contradicts the PR goal of removing GitHub MCP tooling from the Smoke Claude workflow. If the workflow is intended to useghin pre-agent steps and have the agent only read/tmp/gh-aw/agent/recent-prs.json, remove thegithubMCP server from the generated MCP config and drop the associated secret/env plumbing to avoid reintroducing tool-schema/token overhead and network surface.
"github": {
"container": "ghcr.io/github/github-mcp-server:v1.0.3",
"env": {
"GITHUB_HOST": "$GITHUB_SERVER_URL",
"GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_MCP_SERVER_TOKEN",
"GITHUB_READ_ONLY": "1",
"GITHUB_TOOLSETS": "context,repos,issues,pull_requests"
},
.github/workflows/smoke-claude.lock.yml:906
- Even after removing
tools.githubfrom the source workflow, the agent invocation still allowlists a large set ofmcp__github__*tools. If GitHub MCP is no longer required for this smoke test, the compiled--allowed-toolslist should dropmcp__github__*to realize the intended first-turn token savings; otherwise the workflow will still carry the GitHub tool schemas in context.
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 4 -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 || echo node)"; fi; "$GH_AW_NODE_EXEC" ${RUNNER_TEMP}/gh-aw/actions/claude_harness.cjs claude --print --no-chrome --max-turns 8 --mcp-config "${{ runner.temp }}/gh-aw/mcp-config/mcp-servers.json" --allowed-tools Bash,BashOutput,Edit,ExitPlanMode,Glob,Grep,KillBash,LS,MultiEdit,NotebookEdit,NotebookRead,Read,Task,TodoWrite,Write,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__playwright__browser_click,mcp__playwright__browser_close,mcp__playwright__browser_console_messages,mcp__playwright__browser_drag,mcp__playwright__browser_evaluate,mcp__playwright__browser_file_upload,mcp__playwright__browser_fill_form,mcp__playwright__browser_handle_dialog,mcp__playwright__browser_hover,mcp__playwright__browser_install,mcp__playwright__browser_navigate,mcp__playwright__browser_navigate_back,mcp__playwright__browser_network_requests,mcp__playwright__browser_press_key,mcp__playwright__browser_resize,mcp__playwright__browser_select_option,mcp__playwright__browser_snapshot,mcp__playwright__browser_tabs,mcp__playwright__browser_take_screenshot,mcp__playwright__browser_type,mcp__playwright__browser_wait_for,mcp__safeoutputs --debug-file /tmp/gh-aw/agent-stdio.log --verbose --permission-mode bypassPermissions --output-format stream-json --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log
- Files reviewed: 2/2 changed files
- Comments generated: 1
| GH_AW_PROMPT_79d5280c95226aae_EOF | ||
| cat "${RUNNER_TEMP}/gh-aw/prompts/github_mcp_tools_with_safeoutputs_prompt.md" | ||
| cat << 'GH_AW_PROMPT_79d5280c95226aae_EOF' |
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test: GitHub Actions Services Connectivity
Overall: FAIL —
|
Smoke Claudewas carrying unnecessary first-turn context (unused MCP tool schemas) and spending agent turns on deterministic checks. This change reduces per-run token overhead by trimming workflow context and moving predictable work into pre-agent steps.Tooling + network surface reduction
githubMCP tool configuration fromsmoke-claude.md(agent usesghviabashin this workflow).githubfromnetwork.allowed, keepingplaywright.Deterministic checks moved out of agent turns
/tmp/gh-aw/agent/recent-prs.json./tmp/gh-aw/agent/smoke-test-claude-${{ github.run_id }}.txt.Turn budget tightening
max-turnsfrom12to8to cap runaway-cost scenarios while preserving observed run headroom.Compiled artifact refresh
.github/workflows/smoke-claude.lock.ymlto reflect the source workflow updates.