Skip to content

fix(cron): inherit fallback_provider_ids for scheduled agent runs - #10040

Closed
he-yufeng wants to merge 1 commit into
AstrBotDevs:masterfrom
he-yufeng:fix/cron-fallback-providers
Closed

he-yufeng wants to merge 1 commit into
AstrBotDevs:masterfrom
he-yufeng:fix/cron-fallback-providers

Conversation

@he-yufeng

@he-yufeng he-yufeng commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Fixes #10026. The interactive pipeline forwards agent_runner.config.model.fallback_provider_ids into MainAgentBuildConfig, but the cron wakeup path (cron/manager.py::_woke_main_agent) left the field at its default, so a scheduled run had no fallback model to switch to when the primary model failed.

Changes

  • _woke_main_agent now reads agent_runner.config.model.fallback_provider_ids and passes it into MainAgentBuildConfig, matching the interactive pipeline.

Tests

New regression test test_woke_main_agent_forwards_fallback_provider_ids drives the cron wakeup with fallback ids configured and asserts the build config carries them; red on current master, green here. Full tests/unit/test_cron_manager.py 45/45 green; ruff clean.

Signed-off-by: Yufeng He 40085740+he-yufeng@users.noreply.github.com

Summary by Sourcery

Propagate configured fallback provider IDs to scheduled agent runs and verify the behavior with a regression test.

Bug Fixes:

  • Ensure scheduled agent runs inherit configured fallback providers so they can switch models when the primary provider fails.

Tests:

  • Add regression coverage confirming cron wakeups propagate configured fallback provider IDs.

The interactive pipeline forwards agent_runner.config.model.fallback_provider_ids
into MainAgentBuildConfig, but the cron wakeup path left the field at its
default, so a scheduled run had no fallback model to switch to when the
primary failed (AstrBotDevs#10026). _woke_main_agent now reads the same config path,
with a regression test pinning the forwarded ids.

Signed-off-by: Yufeng He <40085740+he-yufeng@users.noreply.github.com>

@sourcery-ai sourcery-ai Bot 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.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. If the inherited fallback list is wrong, a scheduled run could use an unintended provider and write an incorrect agent response or history. Reverting stops future fallback use, but any response or history already produced would need to be identified and repaired or the job rerun.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@kilisamemarisaaa kilisamemarisaaa 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.

I reviewed the current head and the added regression test. The cron path reads the same agent_runner.config.model fallback_provider_ids used by the interactive pipeline and passes the list into MainAgentBuildConfig without mutating the session configuration. The test captures the built config through the real _woke_main_agent path and asserts both fallback IDs are preserved; the full CI matrix, CodeQL, format check, and smoke tests are green. I found no correctness or compatibility blocker.

@Soulter

Soulter commented Sep 12, 2026

Copy link
Copy Markdown
Member

#10028 fixed

@Soulter Soulter closed this Sep 12, 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.

[Bug] Future Task / Cron 未继承 fallback_provider_ids,主模型失败时无法切换备用模型

3 participants