You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix: increase AI timeout and add fallback AI models v1 - #39
Add fallback AI models via EINFRA_FALLBACK_MODELS secret
Increase AI timeout to 300 seconds
Diagram Walkthrough
flowchart LR
workflow["PR Agent Workflow"] -- "fallback models from secret" --> fallback["config.fallback_models"]
workflow -- "timeout set to 300s" --> timeout["config.ai_timeout"]
Loading
File Walkthrough
Relevant files
Configuration changes
pr_agent.yml
Configure fallback models and AI timeout for PR agent
.github/workflows/pr_agent.yml
Replace empty config.fallback_models with secrets.EINFRA_FALLBACK_MODELS
config.fallback_models previously defaulted to the valid JSON value "[]" and is now sourced from ${{ secrets.EINFRA_FALLBACK_MODELS }}. If that secret is not configured or set to an empty value, the environment variable becomes an empty string, which pr-agent will attempt to parse as a JSON list and can fail on (unlike the explicit "[]" used before). Similarly, the secret must contain a valid JSON array (e.g. ["model-a", "model-b"]); a plain comma-separated value would not parse. This only manifests when the secret is missing, empty, or not in the expected JSON format.
If the EINFRA_FALLBACK_MODELS secret is unset or empty, this line evaluates to config.fallback_models: with no value, which YAML parses as null and can break the tool's config parsing. Wrap the expression in double quotes so it always renders as a string, matching the style of the other quoted config values. This ensures an empty secret gracefully resolves to an empty string instead of an invalid null value.
Why: If EINFRA_FALLBACK_MODELS is unset, the unquoted expression renders config.fallback_models: as YAML null, which can break config parsing. Quoting it matches the style of other quoted values like config.custom_model_max_tokens and safely yields an empty string.
Low
General
Default empty fallback models to valid JSON
An empty EINFRA_FALLBACK_MODELS secret would set fallback models to an empty string, which may not be a valid JSON list (like the previous "[]" value). Guard the secret so the workflow falls back to a valid empty JSON array when the secret is missing, preventing config errors in the PR agent job. Use a conditional expression to supply "[]" as the default.
Why: The suggestion correctly addresses that an empty secret would no longer produce the previous valid "[]" JSON default, potentially causing config errors. The conditional expression is valid GitHub Actions syntax, though it adds complexity compared to a simpler quoting or default-value approach.
Low
Author self-review: I have reviewed the PR code suggestions, and addressed the relevant ones.
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
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.
PR Type
Enhancement
Description
Add fallback AI models via
EINFRA_FALLBACK_MODELSsecretIncrease AI timeout to 300 seconds
Diagram Walkthrough
File Walkthrough
pr_agent.yml
Configure fallback models and AI timeout for PR agent.github/workflows/pr_agent.yml
config.fallback_modelswithsecrets.EINFRA_FALLBACK_MODELSconfig.ai_timeoutset to300seconds