Once profile isolation is active (multiple gateway profiles or room->profile multiplexing), get_secret() fails closed outside an installed scope. The cron ticker fires jobs from a thread with no per-turn scope, so run_job() died in resolve_runtime_provider() with UnscopedSecretError (e.g. for OPENROUTER_BASE_URL / CUSTOM_BASE_URL) before model selection - every cron job failed while interactive turns worked fine. Wrap run_job() in set_secret_scope(build_profile_secret_scope(...)) with a finally-reset, mirroring the proven per-turn pattern in gateway/run.py (_profile_runtime_scope). Single-profile installs are unaffected (the scope is just the profile's own .env). tests/cron: 611 passed, 1 pre-existing unrelated failure (TestRoutingIntents::test_all_token_case_insensitive fails identically on unmodified main in a full-suite run and passes in isolation). |
||
|---|---|---|
| .. | ||
| scripts | ||
| __init__.py | ||
| blueprint_catalog.py | ||
| jobs.py | ||
| lifecycle_guard.py | ||
| scheduler.py | ||
| scheduler_provider.py | ||
| suggestion_catalog.py | ||
| suggestions.py | ||