fix: handle grep no-match exit in claude-token-optimizer step#3261
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a step failure in the claude-token-optimizer workflow caused by grep -Flx returning exit code 1 (no match) under set -euo pipefail. Appending || true ensures the no-match case falls through to the kebab-case filename fallback instead of aborting the step.
Changes:
- Append
|| trueto thegrepcommand so unmatched names produce an empty$FILEand trigger the existing fallback. - Recompile the lock file (also picks up unrelated compiler-driven updates: sparse-checkout list, awf install script, session-state copy script, prompt hash regeneration).
Show a summary per file
| File | Description |
|---|---|
.github/workflows/claude-token-optimizer.md |
Adds ` |
.github/workflows/claude-token-optimizer.lock.yml |
Regenerated lock file reflecting the source change plus compiler-driven updates. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@copilot fix the failing ci check https://github.com/github/gh-aw-firewall/actions/runs/25967201693/job/76333044699?pr=3261 |
The CI failure was |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Chroot Smoke Test Results
Result: ❌ Not all runtimes match — Python and Node.js versions differ between host and chroot environments. Go matched successfully.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@copilot merge main |
…claude-token-optimization
Done. Merged |
🔥 Smoke Test: Copilot BYOK (Offline Mode)
Running in BYOK offline mode ( Overall: PARTIAL PASS — BYOK inference path confirmed working; GitHub MCP unauthenticated in sandbox (expected limitation).
|
Smoke Test Results
Overall status: FAIL Warning 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: Copilot Engine — PASS
Overall: PASS — Core connectivity and file I/O working. MCP 401 is a sandbox limitation, not a failure. PR: #3261 | Actor:
|
|
Codex smoke test 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.
|
Smoke Test Results❌ GitHub API: gh CLI authentication unavailable Result: 2/3 PASSED — Playwright and file verification passed; GitHub API test blocked by missing authentication.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test Results
Overall: FAIL — Service containers unreachable via
|
The "Identify top workflow and stage its file" pre-agent step was failing when the top-ranked Claude workflow (e.g.
security-guard.md) has noname:frontmatter field — only a markdown heading.grep -Flxexits 1 on no match, andset -euo pipefailpropagated that into a step failure, skipping the entire agent execution.Changes
claude-token-optimizer.md— append|| trueto thegreppipeline so a no-match result yields an empty$FILErather than a non-zero exit; the existing kebab-case fallback then correctly resolves the filenameclaude-token-optimizer.lock.yml— recompiled from the updated sourceThe fallback path (
[ -z "$FILE" ] && FILE=".github/workflows/${KEBAB}.md") was already correct — it just never ran.