Skip to content

Large-fleet takeover support: bot stalls reconciling a big inherited fleet on a cold DB #15

Description

@jdkajewski

Context

Found while live-testing the TS bot as a takeover of a mature account (agent UPRISING, ~264 ships, gate built) with a cold DB. Ran twice — the 2nd time with the recovery-loop fix (#14) merged AND 20 home-system markets pre-seeded.

Symptom

The bot never reaches the trade loop. After 4–13 min: 0 completed lanes; activity is dominated by per-ship recovery / refuel / navigate events (e.g. 34 recovery + 23 ship events vs 0 trades). It auto-detects home and reconciles correctly, but drowns in processing every inherited ship's leftover state before it can trade. Also throws 400 Navigate errors during salvage on some ships.

Root cause

The bot is designed to grow from ~2 ships (greenfield). Taking over a large pre-existing fleet overwhelms startup reconcile/recovery — it processes ships individually and the 2 req/s budget is consumed by reconcile, starving market discovery + trade execution.

Market data is NOT the blocker — pre-seeding the home system's 20 priced markets (so boot: loaded 20 markets) did not unstick it. (Other systems' prices weren't cached anywhere; only the home system was.)

Proposed fix

  • Bulk/parallel-friendly reconcile for a large inherited fleet (cap recovery work per tick; don't block trading on full-fleet recovery).
  • Defer/curtail orphan-cargo recovery so the trade loop starts first; let normal trading absorb cargo-laden ships.
  • Guard salvage-navigate against 400s (invalid/cross-system destinations).
  • Consider a 'takeover/adopt' mode distinct from greenfield bootstrap.

Priority

Post-reset enhancement. Does NOT affect greenfield (the intended scenario) — greenfield starts small and grows, which works. Only matters if hot-swapping onto an existing large fleet is desired.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions