fix: use actual model name from token-usage.jsonl in effective tokens footer prefix#34303
Closed
Copilot wants to merge 2 commits into
Closed
fix: use actual model name from token-usage.jsonl in effective tokens footer prefix#34303Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
When a user configures an alias like "agent" as the model name, the effective tokens footer was showing "age00" (the reduced form of "agent") instead of the real model identifier (e.g. "son46" for claude-sonnet-4-6). Fix: - Export the primary actual model name from token-usage.jsonl as `effective_tokens_model` step output in parse_mcp_gateway_log.cjs - Expose it as an agent job output in compiler_main_job.go - Pass it as GH_AW_EFFECTIVE_TOKENS_MODEL env var in compiler_safe_outputs_job.go and notify_comment.go - Prefer GH_AW_EFFECTIVE_TOKENS_MODEL over GH_AW_ENGINE_MODEL in messages_footer.cjs and effective_tokens.cjs when building the compact model prefix for effective-token suffixes - Recompile all 234 workflow lock files - Update golden test snapshots Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
fix: use actual model name in effective tokens footer entry
fix: use actual model name from token-usage.jsonl in effective tokens footer prefix
May 23, 2026
Copilot created this pull request from a session on behalf of
pelikhan
May 23, 2026 21:25
View session
Collaborator
|
@copilot merge main and recompile, fix conflicts |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes effective-token (ET) footer rendering when workflows use a model alias (e.g., agent) by propagating the actual resolved model name from token-usage.jsonl through job outputs/env vars so the compact ● <model> <ET> prefix uses the real model identifier (e.g., son46) instead of the alias-derived identifier.
Changes:
- Add a new
effective_tokens_modelstep/job output sourced fromtoken-usage.jsonl(selecting the model with the highest ET). - Propagate
GH_AW_EFFECTIVE_TOKENS_MODELinto safe-outputs and failure-notification paths and prefer it overGH_AW_ENGINE_MODELfor ET suffix/prefix rendering. - Recompile/update workflow lockfiles to include the new output and env var wiring.
Show a summary per file
| File | Description |
|---|---|
actions/setup/js/parse_mcp_gateway_log.cjs |
Exports effective_tokens_model based on the primary model from token-usage.jsonl (highest ET). |
actions/setup/js/messages_footer.cjs |
Prefers GH_AW_EFFECTIVE_TOKENS_MODEL for ET model-prefix rendering (with fallback). |
actions/setup/js/effective_tokens.cjs |
Uses GH_AW_EFFECTIVE_TOKENS_MODEL (fallback to GH_AW_ENGINE_MODEL) when building the ET suffix. |
actions/setup/js/messages.test.cjs |
Adds coverage ensuring the ET model prefix prefers the actual model over a configured alias. |
pkg/workflow/compiler_main_job.go |
Exposes effective_tokens_model as an agent job output. |
pkg/workflow/compiler_safe_outputs_job.go |
Passes GH_AW_EFFECTIVE_TOKENS_MODEL into the safe-outputs job environment. |
pkg/workflow/notify_comment.go |
Passes GH_AW_EFFECTIVE_TOKENS_MODEL into failure-notification/conclusion job environment. |
.github/workflows/*.lock.yml (many files) |
Updates generated workflow lockfiles to include the new effective_tokens_model output and env var propagation. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 251/251 changed files
- Comments generated: 0
Copilot stopped work on behalf of
pelikhan due to an error
May 23, 2026 21:56
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.
When a user configures a model alias (e.g.
agent) in their workflow frontmatter, the ET footer suffix showedage00— the reduced form of the alias — instead of the real model identifier resolved by the API (e.g.son46forclaude-sonnet-4-6).Root cause
GH_AW_ENGINE_MODELstores the user-supplied alias. Footer rendering read that variable for the compact● <model> <ET>prefix, with no access to the actual model name reported intoken-usage.jsonl.Changes
parse_mcp_gateway_log.cjs— AddedgetPrimaryModel(byModel)to pick the model with the highest ET fromtoken-usage.jsonldata; exports it as a neweffective_tokens_modelstep output alongsideeffective_tokens.compiler_main_job.go— Exposeseffective_tokens_modelas an agent job output.compiler_safe_outputs_job.go/notify_comment.go— PassesGH_AW_EFFECTIVE_TOKENS_MODELenv var (from agent job output) to the safe-outputs and failure-notification jobs.messages_footer.cjs— AddedresolveEffectiveTokensModelName()(GH_AW_EFFECTIVE_TOKENS_MODEL || GH_AW_ENGINE_MODEL); all ET-prefix paths use it. The XMLmodel:marker intentionally keepsGH_AW_ENGINE_MODEL— it records the configured alias.effective_tokens.cjs—getEffectiveTokensSuffix()prefersGH_AW_EFFECTIVE_TOKENS_MODELoverGH_AW_ENGINE_MODEL.Lock files / golden snapshots — Recompiled 234 workflows; golden files updated with new
effective_tokens_modeljob output.Result