Skip to content

feat: say why a run failed when the LLM quota runs out or the key is rejected - #136

Merged
ivanmilevtues merged 1 commit into
mainfrom
feat/name-llm-failures
Sep 26, 2026
Merged

ivanmilevtues merged 1 commit into
mainfrom
feat/name-llm-failures

Conversation

@ivanmilevtues

Copy link
Copy Markdown
Member

Summary

The Action side of CodeBoarding/CodeBoarding#610, which makes the engine fail on the first LLM error instead of shipping folder-named components. With that engine, a failed LLM call already fails the job here: the engine exits non-zero, analyze_repository.py raises, and there is no retried full run because incremental no longer answers requiresFullAnalysis for it. What was missing is why.

  • The engine exits 3 when the LLM quota is exhausted (#610) and 2 when the key is rejected (already the case).
  • analyze_repository.py maps those two codes to one line saying what to fix. It becomes the ::error:: annotation, in sync and review mode alike, and is written to the step's failure_reason output.
  • The review failure comment shows failure_reason above the link to the logs. It is empty for any other failure, so that comment reads as before.

This replaces the quota half of #124 (exit code only, no JSON contract, no diagnostics reading).

What it looks like

In review mode, the failure comment for an exhausted quota reads:

CodeBoarding review · failed

The LLM provider's token or credit quota is exhausted. Add credits or raise the quota, then re-run.

See the workflow logs.

Before it takes effect

Exit 2 works with the pinned engine (codeboarding==0.14.4). Exit 3 needs a release containing #610 and a bump of that pin.

Tests

tests/test_analyze_repository.py: exit 3 names the quota and writes failure_reason, exit 2 names the key, and exit 1 keeps today's message and writes nothing. 178 tests pass; black is clean.

🤖 Generated with Claude Code

…rejected

The engine exits 3 when the LLM quota is exhausted and 2 when the key is
rejected, and stops without publishing an analysis. analyze_repository.py maps
those codes to one line saying what to fix, raises it as the error annotation,
and writes it to the step's failure_reason output, which the review failure
comment now shows above the link to the logs. Any other failure is reported as
before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codeboarding-review

codeboarding-review Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

CodeBoarding review

Status: 1 changed component

See the full change in CodeBoarding.

graph LR
    n_action_scripts["action_scripts"]
    classDef added fill:#1f883d,stroke:#0b5d23,color:#ffffff;
    classDef modified fill:#bf8700,stroke:#7d4e00,color:#ffffff;
    classDef deleted fill:#cf222e,stroke:#82071e,color:#ffffff,stroke-dasharray:5 3;
    class n_action_scripts modified;
Loading

download artifacts · run 36264607871

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-26T19:06:47.677222Z db3e96c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db3e96c18f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# The engine's exit codes for an LLM refusal the user has to fix, and what to tell them.
ENGINE_REFUSALS = {
2: "The LLM provider rejected the API key. Check the key's secret and re-run.",
3: "The LLM provider's token or credit quota is exhausted. Add credits or raise the quota, then re-run.",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Bump the engine before advertising quota failures

action.yml:362 still installs codeboarding==0.14.4, which does not emit the newly handled exit code 3; the corresponding engine change requires a later release. Consequently, quota exhaustion can retain the old behavior—including publishing partial analysis—while this commit's README promises an actionable failure and no partial output. Ship the supporting engine release and update both the pin and mirrored provider table with this change.

AGENTS.md reference: AGENTS.md:L12-L16

Useful? React with 👍 / 👎.

Comment on lines +18 to +19
2: "The LLM provider rejected the API key. Check the key's secret and re-run.",
3: "The LLM provider's token or credit quota is exhausted. Add credits or raise the quota, then re-run.",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Tailor refusal advice for hosted tiers

When llm: hosted or llm: license is selected, neither message describes a fix the caller controls: these modes use the constant placeholder key from configure-auth.sh and authenticate through the OIDC relay, which forwards upstream HTTP failures unchanged. A rejected OIDC/license credential can therefore be reported as a provider API-key secret to check, while a hosted-quota rejection tells the caller to add provider credits they do not own. Pass the resolved tier into this mapping and give hosted/license users the corresponding OIDC, licence, or plan remedy.

Useful? React with 👍 / 👎.

@ivanmilevtues
ivanmilevtues merged commit 9c586bb into main Sep 26, 2026
4 checks passed
@ivanmilevtues
ivanmilevtues deleted the feat/name-llm-failures branch September 26, 2026 19:17
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.

1 participant