fix: align ET budget error strings with gh-aw detection patterns#2770
fix: align ET budget error strings with gh-aw detection patterns#2770
Conversation
Update the event type, JSON error body type, and error message in
proxy-request.js to use 'exceeded' terminology instead of 'reached'.
This aligns AWF log events and error responses with the detection
patterns in gh-aw's parse_mcp_gateway_log.cjs, which require 'exceeded'
after 'effective tokens'. The previous 'reached' wording caused all
three detection regexes to fail on AWF log lines:
Before: event=effective_tokens_limit_reached
type=effective_tokens_limit_reached
message='Maximum effective tokens reached (X / Y).'
After: event=effective_tokens_limit_exceeded
type=effective_tokens_limit_exceeded
message='Maximum effective tokens exceeded (X / Y).'
The updated strings satisfy the existing gh-aw pattern:
/effective[\s_-]*tokens?.*exceeded/i
There was a problem hiding this comment.
Pull request overview
This PR fixes effective-token (ET) budget exhaustion detection by aligning AWF’s emitted error type/message and log event name with the downstream gh-aw regex patterns that look for “effective tokens … exceeded”.
Changes:
- Renamed the structured error
typefromeffective_tokens_limit_reached→effective_tokens_limit_exceeded. - Updated the structured error
messageto use “exceeded” instead of “reached”. - Updated the existing Jest test assertion to expect the new
type.
Show a summary per file
| File | Description |
|---|---|
| containers/api-proxy/proxy-request.js | Updates ET budget block error payload and log event name to use “exceeded”. |
| containers/api-proxy/server.proxy.test.js | Updates the ET guard test to assert the new error type. |
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
|
Smoke Test Results ✅ GitHub MCP: Last 2 merged PRs retrieved Overall Status: PASS
|
|
Smoke Test: Copilot BYOK — Running in BYOK offline mode (
Overall: PASS —
|
🔬 Smoke Test Results
PR: fix: align ET budget error strings with gh-aw detection patterns Overall: PASS
|
Chroot Smoke Test Results
Overall: ❌ FAILED — Python and Node.js versions differ between host and chroot.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test: Codex✅ GitHub PR review: docs: add missing apiProxy CLI mappings and sync schema descriptions; docs: proofread AWF config spec for W3C-style conformance 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: FAIL ❌
|
Bug Fix
What was the bug?
gh-aw's
parse_mcp_gateway_log.cjsdetects ET budget exhaustion by matching "exceeded" after "effective tokens", but AWF emitted "reached" — causing the specific-match regexes to silently miss AWF log lines. Only the generic429 Too Many Requestspattern fired, which can't distinguish ET exhaustion from ordinary rate limits.How did you fix it?
Renamed the event type and updated the error message in
proxy-request.jsto use "exceeded":Both
logRequestcall sites (HTTP and CONNECT paths) updated to emiteffective_tokens_limit_exceeded. This makes all three AWF log sources — log event, JSON error body, and the raw log line — match the existing gh-aw regex/effective[\s_-]*tokens?.*exceeded/iwith no changes required on the gh-aw side.