Skip to content

fix(cron): inherit runtime provider on gateway create#13337

Open
sgaofen wants to merge 1 commit into
NousResearch:mainfrom
sgaofen:codex/fix-13288-gateway-cron-provider
Open

fix(cron): inherit runtime provider on gateway create#13337
sgaofen wants to merge 1 commit into
NousResearch:mainfrom
sgaofen:codex/fix-13288-gateway-cron-provider

Conversation

@sgaofen

@sgaofen sgaofen commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Fixes #13288.

Root cause:
Gateway/Weixin-created cron jobs could be created without explicit runtime provider fields, leaving the persisted job to fall back to the invalid legacy openai provider at execution time. Equivalent CLI-created jobs had a working active runtime provider available.

Fix summary:

  • Fill missing cron create provider and base_url from resolve_runtime_provider() before persisting the job.
  • Preserve explicit cron provider / base_url values when supplied.
  • Keep failures non-fatal: if runtime resolution is unavailable, creation falls back to the previous optional values.
  • Add a Weixin/gateway-session regression proving the stored job inherits the active runtime provider/base URL instead of openai.

Tests:

  • uv run --frozen --python 3.11 --extra dev pytest -o addopts= tests/tools/test_cronjob_tools.py -q -> 26 passed
  • git diff --check -- tools/cronjob_tools.py tests/tools/test_cronjob_tools.py

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cron Cron scheduler and job management comp/gateway Gateway runner, session dispatch, delivery labels Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cron Cron scheduler and job management comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 微信创建的定时任务执行失败

2 participants