Skip to content

Suppress false ET rate-limit failures with max-ai-credits budget reconciliation#37581

Merged
pelikhan merged 9 commits into
mainfrom
copilot/aw-fix-meta-orchestrator-failure
Jun 7, 2026
Merged

Suppress false ET rate-limit failures with max-ai-credits budget reconciliation#37581
pelikhan merged 9 commits into
mainfrom
copilot/aw-fix-meta-orchestrator-failure

Conversation

Copilot AI commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

The meta-orchestrator failure path was classifying runs as legacy effective-token budget failures even when workflows were budgeted via max-ai-credits. This produced incorrect issue context and failure categorization for runs that were under budget.

  • Failure-state reconciliation update

    • In effective_tokens_context.cjs, resolveEffectiveTokensFailureState() now derives the ET-equivalent ceiling exclusively from AI credits.
    • max_effective_tokens is no longer used for ET failure-state suppression logic.
    • Conversion remains deterministic and conservative: 1 AIC = 10,000 ET, with support for fractional credit values.
  • Behavior hardening for AI-credit-budgeted workflows

    • Legacy ET rate-limit signals are suppressed only when observed ET usage is below the ET-equivalent max derived from max_ai_credits.
    • When max_ai_credits is not configured, ET rate-limit signals are no longer reconciled by max_effective_tokens fallback values.
  • Targeted coverage additions

    • Updated tests in handle_agent_failure.test.cjs to reflect AI-credit-only ET reconciliation.
    • Added coverage for:
      • ET behavior when only max_effective_tokens is present (no AI-credit reconciliation).
      • max_ai_credits taking precedence when both max_ai_credits and max_effective_tokens are present.
      • Fractional and whole AI-credit conversion behavior during ET max derivation.
  • Branch sync and recompilation

    • Merged latest main into this branch.
    • Recompiled lock workflow artifacts to align generated .lock.yml files with current workflow sources after the merge.
const maxAICredits = parseMaxAICreditsFromAuditLog() || envMaxAICredits || "";
// max_effective_tokens is deprecated for ET failure-state reconciliation.
// We only derive the ET ceiling from max_ai_credits.
const maxEffectiveTokens = deriveMaxEffectiveTokensFromAICredits(maxAICredits);

Copilot AI and others added 3 commits June 7, 2026 14:27
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 [WIP] Fix Meta-Orchestrator workflow failure due to legacy token limit Suppress false ET rate-limit failures when only max-ai-credits is configured Jun 7, 2026
Copilot AI requested a review from pelikhan June 7, 2026 14:36
@pelikhan

pelikhan commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

@copilot max effective tokens should be completely replaced my max ai credits

@pelikhan

pelikhan commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

@copilot merge main, recompile, fix conflicts

Copilot AI and others added 3 commits June 7, 2026 14:59
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 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot max effective tokens should be completely replaced my max ai credits

Updated in c9576cf: ET failure reconciliation now uses only max_ai_credits (derived ET ceiling) and no longer uses max_effective_tokens as a suppression source. Follow-up coverage/docs refinements are in abb9744.

Copilot AI changed the title Suppress false ET rate-limit failures when only max-ai-credits is configured Suppress false ET rate-limit failures with max-ai-credits budget reconciliation Jun 7, 2026
@pelikhan pelikhan marked this pull request as ready for review June 7, 2026 15:03
Copilot AI review requested due to automatic review settings June 7, 2026 15:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the setup action’s failure-state reconciliation so legacy effective-token (ET) rate-limit signals are only suppressed based on an ET-equivalent ceiling derived from max-ai-credits, preventing misclassification for AI-credit-budgeted workflows.

Changes:

  • Derives maxEffectiveTokens exclusively from max_ai_credits (1 AIC = 10,000 ET; supports fractional credits) for ET rate-limit suppression.
  • Updates/extends unit tests to reflect AI-credit-only ET reconciliation behavior and precedence.
  • Refreshes embedded action pin data in both workflow and actionpins packages.
Show a summary per file
File Description
actions/setup/js/effective_tokens_context.cjs Adds AI-credits-to-ET conversion and switches ET reconciliation to use only max_ai_credits.
actions/setup/js/handle_agent_failure.test.cjs Updates and adds tests covering AI-credit-only ET reconciliation, precedence, and fractional conversion.
pkg/actionpins/data/action_pins.json Updates embedded action pin entries with additional versions/SHAs.
pkg/workflow/data/action_pins.json Mirrors the embedded action pin updates for workflow compilation/runtime usage.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 4/4 changed files
  • Comments generated: 5

Comment on lines +80 to +85
/**
* Derive an ET-equivalent budget from AI credits when only max-ai-credits is available.
* Conversion uses 1 AIC = 10,000 ET and rounds down to avoid over-reporting ET capacity.
* @param {string} maxAICredits
* @returns {string}
*/
Comment on lines +105 to +110
// Fallback for numeric strings not matched by decimal regex (for example scientific notation).
const parsed = Number.parseFloat(normalized);
if (!Number.isFinite(parsed) || parsed <= 0) return "";
const converted = Math.floor(parsed * EFFECTIVE_TOKENS_PER_AI_CREDIT);
if (!Number.isSafeInteger(converted) || converted <= 0) return "";
return String(converted);
Comment on lines 3151 to 3155
expect(resolveEffectiveTokensFailureState()).toEqual({
effectiveTokens: "25000000",
maxEffectiveTokens: "25000000",
maxEffectiveTokens: "",
effectiveTokensRateLimitError: true,
});
Comment on lines 3184 to 3189

expect(resolveEffectiveTokensFailureState()).toEqual({
effectiveTokens: "10000000",
maxEffectiveTokens: "100000000",
maxEffectiveTokens: "",
effectiveTokensRateLimitError: false,
});
Comment on lines +51 to +60
"actions/checkout@v4": {
"repo": "actions/checkout",
"version": "v4",
"sha": "34e114876b0b11c390a56381ad16ebd13914f8d5"
},
"actions/checkout@v6.0.2": {
"repo": "actions/checkout",
"version": "v6.0.2",
"sha": "de0fac2e4500dabe0009e67214ff5f5447ce83dd"
},
Copilot AI and others added 2 commits June 7, 2026 15:09
…rchestrator-failure

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main, recompile, fix conflicts

Done in 1c5427c: merged main, recompiled workflow lock files, and resolved merge conflicts (none remained after merge).

@pelikhan pelikhan merged commit eed1439 into main Jun 7, 2026
@pelikhan pelikhan deleted the copilot/aw-fix-meta-orchestrator-failure branch June 7, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[aw] Agent Performance Analyzer - Meta-Orchestrator failed

3 participants