Follow-up requested by the platform session. On prod, Orca's reconciler redeployed the agent at 21:50, which interrupted the customer scans car-system and gt-mobile. They stayed interrupted until the 02:00 run.
Change
lifecycle::resume_interrupted_scans, started in the background by main right after recover_orphaned_runs:
Which tenants: the same list as the scheduler (scheduler_tenants, from the registry, runnable tenants only), so a suspended tenant gets nothing restarted.
Which scans: the code scans closed as interrupted by this startup, matched on the identical completed_at.
How: through the normal path, run_target_scan (scan gate, concurrency), as a Scheduled scan, so usage isn't counted as a customer action.
Not restarted:
archived or deleted targets;
a target already interrupted once in the last 24 hours. The scan itself may be what stops the agent (OOM, crash), and restarting it would loop. The next scheduled run tries again.
scheduler::scheduler_tenants is now pub(crate).
Tests
only_scans_this_start_interrupted_are_resumed_once (Mongo), with four targets:
Follow-up requested by the platform session. On prod, Orca's reconciler redeployed the agent at 21:50, which interrupted the customer scans `car-system` and `gt-mobile`. They stayed `interrupted` until the 02:00 run.
## Change
- **`lifecycle::resume_interrupted_scans`**, started in the background by `main` right after `recover_orphaned_runs`:
- **Which tenants:** the same list as the scheduler (`scheduler_tenants`, from the registry, runnable tenants only), so a suspended tenant gets nothing restarted.
- **Which scans:** the code scans closed as `interrupted` by **this** startup, matched on the identical `completed_at`.
- **How:** through the normal path, `run_target_scan` (scan gate, concurrency), as a `Scheduled` scan, so usage isn't counted as a customer action.
- **Not restarted:**
- archived or deleted targets;
- **a target already interrupted once in the last 24 hours.** The scan itself may be what stops the agent (OOM, crash), and restarting it would loop. The next scheduled run tries again.
- `scheduler::scheduler_tenants` is now `pub(crate)`.
## Tests
- `only_scans_this_start_interrupted_are_resumed_once` (Mongo), with four targets:
- left open at this startup → resumed;
- already interrupted 1 hour ago → not resumed;
- archived → not resumed;
- only an older interrupted run → not resumed.
- fmt and clippy with the CI flags.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
A redeploy or restart closes the scans it cut off as `interrupted`
(#65), and nothing started them again: on prod the reconciler's redeploy
interrupted two customer scans that then waited for the nightly run.
After recover_orphaned_runs, resume_interrupted_scans starts those scans
again in the background, for every tenant the scheduler runs for (so a
suspended tenant is not), through the normal scan path (scan gate,
concurrency), as a scheduled scan. It finds them by the completed_at
this startup gave them. A target that is archived or gone is skipped, and
so is one whose scan was already interrupted within the last day: the
scan itself may be what stops the agent, and restarting it would loop.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang
merged commit 0da96110c3 into main2026-10-05 20:14:28 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Follow-up requested by the platform session. On prod, Orca's reconciler redeployed the agent at 21:50, which interrupted the customer scans
car-systemandgt-mobile. They stayedinterrupteduntil the 02:00 run.Change
lifecycle::resume_interrupted_scans, started in the background bymainright afterrecover_orphaned_runs:scheduler_tenants, from the registry, runnable tenants only), so a suspended tenant gets nothing restarted.interruptedby this startup, matched on the identicalcompleted_at.run_target_scan(scan gate, concurrency), as aScheduledscan, so usage isn't counted as a customer action.scheduler::scheduler_tenantsis nowpub(crate).Tests
only_scans_this_start_interrupted_are_resumed_once(Mongo), with four targets:🤖 Generated with Claude Code
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p