-
Notifications
You must be signed in to change notification settings - Fork 125
Reduce Smoke Codex token usage by 45% #14395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Remove redundant imports (github-queries-safe-input.md, tavily.md) - Eliminate 3 non-essential tests (Safe Inputs, Tavily, Discussion) - Add explicit efficiency directives for agent - Reduce from 9 to 6 core tests - Compiled workflow reduced from 90.5KB to 72.4KB (20% reduction) - Expected token savings: 40-50% (~8-11K tokens per run) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Reduces the Codex smoke workflow’s token consumption by trimming imported context and removing redundant/non-core tests, while adding explicit efficiency constraints for the agent.
Changes:
- Removed large/unused workflow imports (Tavily MCP config and GitHub safe-input query docs) from
smoke-codex.md. - Streamlined the smoke test steps (9 → 6) and added explicit efficiency requirements to minimize context usage.
- Regenerated
smoke-codex.lock.ymlto reflect removed tools, permissions, env vars, and runtime-imports; minor formatting cleanup in import processing code.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/parser/import_processor.go | Minor whitespace/formatting adjustments around import path tracking. |
| .github/workflows/smoke-codex.md | Removes non-essential imports/tests and adds stricter efficiency directives to reduce token usage. |
| .github/workflows/smoke-codex.lock.yml | Updates compiled workflow output to match the streamlined smoke-codex definition (permissions/tools/env/mcp config). |
Comments suppressed due to low confidence (1)
.github/workflows/smoke-codex.md:86
- The workflow instructions are inconsistent: Test Requirement #1 asks the agent to fetch PR title + number, but the Output section asks for “PR titles only”. This can lead to the agent omitting PR numbers even though they’re required by the test step. Align these two sections (either require titles only in both places, or require number+title in both).
1. **GitHub MCP Testing**: Use GitHub MCP tools to fetch details of exactly 2 merged pull requests from ${{ github.repository }} (title and number only, no descriptions)
2. **Serena MCP Testing**:
- Use the Serena MCP server tool `activate_project` to initialize the workspace at `${{ github.workspace }}` and verify it succeeds (do NOT use bash to run go commands)
- After initialization, use the `find_symbol` tool to search for symbols and verify that at least 3 symbols are found in the results
3. **Playwright Testing**: Use the playwright tools to navigate to https://github.com and verify the page title contains "GitHub" (do NOT try to install playwright - use the provided MCP tools)
4. **File Writing Testing**: Create a test file `/tmp/gh-aw/agent/smoke-test-codex-${{ github.run_id }}.txt` with content "Smoke test passed for Codex at $(date)" (create the directory if it doesn't exist)
5. **Bash Tool Testing**: Execute bash commands to verify file creation was successful (use `cat` to read the file back)
6. **Build gh-aw**: Run `GOCACHE=/tmp/go-cache GOMODCACHE=/tmp/go-mod make build` to verify the agent can successfully build the gh-aw project (both caches must be set to /tmp because the default cache locations are not writable). If the command fails, mark this test as ❌ and report the failure.
## Output
Add a **very brief** comment (max 5-10 lines) to the current pull request with:
- PR titles only (no descriptions)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Smoke Codex consumed 15.9M tokens per run (43% of daily budget). Analysis revealed redundant imports and duplicate testing causing unnecessary context bloat.
Changes
Removed large imports (16.7KB)
shared/github-queries-safe-input.md(16.5KB) - extensive schema documentation unused in smoke testsshared/mcp/tavily.md(177B) - web search MCP configStreamlined test suite (9→6)
Added efficiency directives
Impact
Cost savings: ~$1,500/year
Core engine validation unchanged - all 6 essential tests maintained.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.