Optimize Smoke Claude retry behavior and prompt flow#5286
Closed
Copilot wants to merge 2 commits into
Closed
Conversation
Copilot
AI
changed the title
[WIP] Optimize Claude token usage for smoke test
Optimize Smoke Claude retry behavior and prompt flow
Jun 19, 2026
Contributor
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Smoke Claude agentic workflow to reduce wasted CI runs from retry/concurrency bursts and to streamline the agent prompt so the precomputed smoke result is available via runtime-import (instead of spending a turn reading JSON via bash).
Changes:
- Adds workflow-level
concurrencywithcancel-in-progress: trueto cancel stale in-flight runs for the same PR/ref. - Generates an inline markdown file from
final-result.jsonand imports it into the prompt via{{#runtime-import ...}}. - Updates the smoke workflow test assertions and recompiles
smoke-claude.lock.ymlto reflect the new concurrency/prompt shape.
Show a summary per file
| File | Description |
|---|---|
| scripts/ci/smoke-claude-workflow.test.ts | Extends test coverage to assert concurrency + runtime-import usage and to avoid legacy “read JSON via bash” prompt patterns. |
| .github/workflows/smoke-claude.md | Adds concurrency; creates inline-result.md; switches prompt to runtime-import; removes explicit bash allowlist from frontmatter. |
| .github/workflows/smoke-claude.lock.yml | Regenerated compiled workflow reflecting concurrency, prompt import, and updated gh-aw compiler/setup versions. |
| .github/aw/actions-lock.json | Updates the pinned github/gh-aw-actions/setup version/SHA mapping used for compilation. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 5
Comment on lines
48
to
49
| tools: | ||
| bash: | ||
| - bash | ||
| github: false |
| --> | ||
|
|
||
| All data is pre-computed. Read `/tmp/gh-aw/agent/final-result.json` (one bash call: `cat /tmp/gh-aw/agent/final-result.json`). | ||
| All data is pre-computed below. Do not call bash or any GitHub tools. |
Comment on lines
28
to
+30
| expect(source).toContain('github: false'); | ||
| expect(source).not.toContain('bash:\n - "*"'); | ||
| expect(source).not.toContain('tools:\n bash:'); | ||
| expect(source).not.toContain('one bash call'); |
Comment on lines
60
to
+62
| expect(lock).toMatch(/github\/gh-aw-actions\/setup@[a-f0-9]{40} # v\d+\.\d+\.\d+/); | ||
| expect(lock).not.toContain('Bash(bash)'); | ||
| expect(lock).not.toContain('Read `/tmp/gh-aw/agent/final-result.json`'); |
Comment on lines
763
to
767
| - name: Execute Claude Code CLI | ||
| id: agentic_execution | ||
| # Allowed tools (sorted): | ||
| # - Bash(bash) | ||
| # - Bash(cat) | ||
| # - Bash(date) | ||
| # - Bash(echo) | ||
| # - Bash(grep) | ||
| # - Bash(head) | ||
| # - Bash(ls) | ||
| # - Bash(printf) | ||
| # - Bash(pwd) | ||
| # - Bash(safeoutputs:*) | ||
| # - Bash(sort) | ||
| # - Bash(tail) | ||
| # - Bash(uniq) | ||
| # - Bash(wc) | ||
| # - Bash(yq) | ||
| # - Bash | ||
| # - BashOutput |
Collaborator
|
@copilot address review feedback and merge main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Smoke Claude was burning runs on retry bursts and spending an extra turn just to read a precomputed JSON file. This change tightens execution by canceling stale in-flight runs and moving the precomputed result directly into prompt context.
Retry / concurrency control
Smoke ClaudePrompt data flow
final-result.json/tmp/gh-aw/agent/inline-result.md) generated from that JSONruntime-import, so the agent starts with the result already in contextTool surface reduction
add_comment,add_labels,noop) instead of spending a turn on file I/OGenerated workflow + guardrails
smoke-claude.lock.ymlto reflect the new concurrency and prompt shapefinal-result.jsonfrom the prompt bodyExample of the new prompt flow:
All data is pre-computed below. Do not call bash or any GitHub tools. {{#runtime-import /tmp/gh-aw/agent/inline-result.md}}And the added concurrency guard: