Format effective token values in rendered failure messages#31130
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
Format effective tokens in rendered failure messages
Format effective token values in rendered failure messages
May 9, 2026
Copilot created this pull request from a session on behalf of
pelikhan
May 9, 2026 02:48
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes user-facing ET budget exhaustion messaging by rendering effectiveTokens / maxEffectiveTokens in the same compact, human-friendly format already used in footers (e.g., 10000000 → 10M).
Changes:
- Reuses
formatETto compact-format effective token values inbuildEffectiveTokensRateLimitErrorContext. - Exports
buildEffectiveTokensRateLimitErrorContextfor direct unit testing. - Adds unit tests for compact formatting, fallback behavior, and omission of optional lines; also updates
necromancer.lock.yml.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/handle_agent_failure.cjs | Formats ET values in the rate-limit failure context using formatET and exports the helper. |
| actions/setup/js/handle_agent_failure.test.cjs | Adds targeted unit tests for the ET rate-limit context rendering. |
| .github/workflows/necromancer.lock.yml | Updates generated lock workflow content (includes AWF/container version bumps and related config changes). |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 2
Comment on lines
148
to
152
| GH_AW_INFO_ALLOWED_DOMAINS: '["defaults","github","node","go"]' | ||
| GH_AW_INFO_FIREWALL_ENABLED: "true" | ||
| GH_AW_INFO_AWF_VERSION: "v0.25.41" | ||
| GH_AW_INFO_AWF_VERSION: "v0.25.42" | ||
| GH_AW_INFO_AWMG_VERSION: "" | ||
| GH_AW_INFO_FIREWALL_TYPE: "squid" |
Comment on lines
+855
to
+860
| const formatEffectiveTokensForMessage = value => { | ||
| const parsed = Number.parseInt(value || "", 10); | ||
| if (Number.isInteger(parsed) && parsed > 0) { | ||
| return formatET(parsed); | ||
| } | ||
| return value; |
Collaborator
|
@copilot Merge main and recompile |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Done. I merged |
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.
Bug Fix
Rendered message paths still showed raw effective-token integers in ET budget failure context. This change aligns those displays with footer formatting so token values are compact and human-friendly (e.g.,
10000000→10M).What was the bug?
effectiveTokens/maxEffectiveTokensas raw strings in user-facing text, while footer paths already used compact formatting.How did you fix it?
formatETfromeffective_tokens.cjs) inbuildEffectiveTokensRateLimitErrorContext.Effective tokens usedConfigured ET budgetExample
Testing
mainand recompiled generated workflow artifacts (.github/workflows/approach-validator.lock.yml) per follow-up feedback.