Skip to content

Fix: increase AI timeout and add fallback AI models v1 - #39

Merged
KEIAHNY merged 1 commit into
mainfrom
pr_agent_fallback_timeout_v1
Oct 12, 2026
Merged

KEIAHNY merged 1 commit into
mainfrom
pr_agent_fallback_timeout_v1

Conversation

@KEIAHNY

@KEIAHNY KEIAHNY commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

PR Type

Enhancement


Description

  • 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
  • Add config.ai_timeout set to 300 seconds
+2/-1     

@KEIAHNY KEIAHNY self-assigned this Oct 12, 2026
@KEIAHNY KEIAHNY changed the title Fix: increase AI timeout and add fallback AI models Fix: increase AI timeout and add fallback AI models v1 Oct 12, 2026
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Possible Issue

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.

config.fallback_models: ${{ secrets.EINFRA_FALLBACK_MODELS }}

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Quote fallback models secret to avoid null config

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.

.github/workflows/pr_agent.yml [29]

-          config.fallback_models: ${{ secrets.EINFRA_FALLBACK_MODELS }}
+          config.fallback_models: "${{ secrets.EINFRA_FALLBACK_MODELS }}"
Suggestion importance[1-10]: 6

__

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.

.github/workflows/pr_agent.yml [29-30]

-          config.fallback_models: ${{ secrets.EINFRA_FALLBACK_MODELS }}
+          config.fallback_models: ${{ secrets.EINFRA_FALLBACK_MODELS != '' && secrets.EINFRA_FALLBACK_MODELS || '[]' }}
           config.ai_timeout: "300"
Suggestion importance[1-10]: 5

__

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.

@KEIAHNY
KEIAHNY merged commit bac7f2d into main Oct 12, 2026
3 of 4 checks passed
@KEIAHNY
KEIAHNY deleted the pr_agent_fallback_timeout_v1 branch October 12, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant