usestrix/strix · error · RuntimeError

Cannot resume scan {scan_id}: missing SDK session database a

Error message

Cannot resume scan {scan_id}: missing SDK session database at {agents_db}

What it means

Raised on the resume path (strix/core/runner.py:198) when agents.json parses fine but the SDK session database file (agents_db, e.g. the OpenAI Agents SDK sqlite session store inside the run directory) is missing. The snapshot alone is not enough: the SDK database holds per-agent conversation history, so without it the restored graph would have amnesia and resume is refused.

Source

Thrown at strix/core/runner.py:198

        coordinator = AgentCoordinator()
    coordinator.set_snapshot_path(agents_path)

    from strix.tools.notes.tools import hydrate_notes_from_disk
    from strix.tools.todo.tools import hydrate_todos_from_disk

    hydrate_todos_from_disk(state_dir)
    hydrate_notes_from_disk(state_dir)

    root_id: str | None = None
    if is_resume:
        try:
            snap = json.loads(agents_path.read_text(encoding="utf-8"))
        except (OSError, json.JSONDecodeError) as exc:
            raise RuntimeError(
                f"Cannot resume scan {scan_id}: agents.json is unreadable: {exc}",
            ) from exc
        if not agents_db.exists():
            raise RuntimeError(
                f"Cannot resume scan {scan_id}: missing SDK session database at {agents_db}",
            )
        await coordinator.restore(snap)
        report_state = get_global_report_state()
        if report_state is not None:
            budget_stopped, reserve_stopped = recomputed_budget_flags(
                report_state.get_total_llm_cost(),
                max_budget_usd,
                interactive=interactive,
            )
            await coordinator.reset_budget_stops(
                budget_stopped=budget_stopped,
                reserve_stopped=reserve_stopped,
                budget_paused=interactive and coordinator.budget_paused,
            )
        for aid, parent in coordinator.parent_of.items():
            if parent is None:
                root_id = aid

View on GitHub (pinned to 8551339130)

Solutions

  1. Check that the file at the printed agents_db path exists in the original run directory and copy the whole run dir intact (including the db) before resuming.
  2. If the db is gone for good, start a new scan; the readable artifacts (report, notes, findings) from the old run remain usable.
  3. Re-run the previous scan with the same Strix version that created it if the mismatch came from an upgrade.

Example fix

# before
rsync -av --exclude='*.db' old-host:strix_runs/scan1 ./   # db dropped
strix resume scan1                                             # missing SDK session database

# after
rsync -av old-host:strix_runs/scan1 ./strix_runs/scan1          # copy everything
strix resume scan1
Defensive patterns

Strategy: validation

Validate before calling

import pathlib
run = pathlib.Path(run_dir)
ok = (run / 'agents.json').exists() and agents_db_path(run).exists()
if not ok:
    print('run dir incomplete: copy the ENTIRE run directory before resuming')

Type guard

def run_dir_is_complete(run_dir: str, agents_db: str) -> bool:
    import pathlib
    r = pathlib.Path(run_dir)
    return (r / 'agents.json').is_file() and pathlib.Path(agents_db).exists()

Try / catch

try:
    await run_strix_scan(..., is_resume=True)
except RuntimeError as exc:
    if 'missing SDK session database' in str(exc):
        shutil.copytree(original_run_dir, run_dir, dirs_exist_ok=True)  # restore db
        await run_strix_scan(..., is_resume=True)
    else:
        raise

Prevention

When it happens

Trigger: Resuming a scan whose run directory was partially copied or cleaned (agents.json kept, session db deleted); the scan was made by an older Strix version that did not create the db; file was excluded by a backup/glob filter.

Common situations: Copying run dirs between machines with rsync exclude patterns; cleanup scripts that remove *.db*; downgrading or jumping across Strix versions where the session-db layout changed.

Related errors


AI-assisted analysis of usestrix/strix@8551339130 (2026-08-15). Data as JSON: /api/errors/8f3a747392f3a436. Report an issue: GitHub.