Skip to content

Use tiered low-cost AI Gateway fallbacks#75

Merged
hxddh merged 1 commit into
mainfrom
agent/tiered-low-cost-fallbacks
Jul 21, 2026
Merged

Use tiered low-cost AI Gateway fallbacks#75
hxddh merged 1 commit into
mainfrom
agent/tiered-low-cost-fallbacks

Conversation

@hxddh

@hxddh hxddh commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • back up Nano screening with Gemini 2.5 Flash Lite
  • back up GPT-OSS long-form synthesis with GPT-5 Nano
  • log the reason when a fallback is actually used
  • document the workload-aware low-cost route

Validation

  • python3 -m unittest discover -s tests (255 tests)
  • python3 -m py_compile scripts/cloud_agent_runner.py
  • git diff --check

Live evidence

Daily run 29849327304 succeeded on Nano + GPT-OSS without fallback. Weekly run 29850411317 parsed successfully but Flash Lite failed the repository bilingual-content gate, so Flash Lite is now limited to screening recovery and Nano handles synthesis recovery.

@hxddh
hxddh merged commit 9e4c84b into main Jul 21, 2026
2 checks passed
@hxddh
hxddh deleted the agent/tiered-low-cost-fallbacks branch July 21, 2026 17:00

@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: 4cbcf91979

ℹ️ 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".

# Reuse Nano for synthesis recovery: it is cheaper than Mini, retains a
# long output window, and avoids asking Flash Lite to write the long
# bilingual reports that it failed the production quality gate on.
fallback = split_env_list("AI_GATEWAY_FALLBACK_MODELS", [DEFAULT_CHEAP_SCREEN_MODEL])

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 Keep synthesis fallbacks on the long timeout

When a daily/weekly/monthly synthesis call falls back through this new Nano default, call_ai_gateway_model still uses model_call_timeout(candidate_model), and model_call_timeout treats openai/gpt-5-nano as the cheap screening model with the 300s SCREEN_MODEL_TIMEOUT. That means the long bilingual synthesis recovery path can be killed after five minutes even though the primary GPT-OSS synthesis call gets the 900s synthesis timeout; use the workload/original model to choose the timeout instead of the fallback model name.

Useful? React with 👍 / 👎.

@hxddh hxddh mentioned this pull request Jul 21, 2026
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