molecule-core/scripts/ops
Hongming Wang a117a60eed fix(sweep-cf-tunnels): buffer pages to disk to avoid argv ARG_MAX
The page-merge loop passed the entire accumulating tunnel JSON to
python3 -c via argv on every iteration. On a busy account (verified
2026-05-02: 672 tunnels, 14 pages on Hongmingwangrabbit account) this
exceeds the GH Ubuntu runner's combined argv+envp limit (~128 KB) and
dies with `python3: Argument list too long` at exit 126 — the workflow
has been silently failing this way since the very first run that hit a
real account, masked earlier by a missing-CF_ACCOUNT_ID secret check.

Buffer each page response to a file under a temp dir, merge from disk
at the end. Also bumps the page cap from 20 to 40 (1000 → 2000 tunnel
ceiling) so the existing soft-cap warning has headroom; the disk-merge
shape is O(n) in tunnel count rather than the previous O(n^2) so the
larger ceiling is cheap.

Verified locally against the live account (672 tunnels): script now
runs cleanly to the existing MAX_DELETE_PCT safety gate, which trips
at 99% > 90% as designed and surfaces the actual orphan backlog for
operator-driven cleanup.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 00:42:25 -07:00
..
audit-railway-sha-pins.sh ops: add Railway SHA-pin drift audit script + regression test (#2001) 2026-04-27 05:01:23 -07:00
check_migration_collisions.py ci: hard gate against migration version collisions (#2341) 2026-04-29 21:42:42 -07:00
check-prod-versions.sh ops: scripts/ops/check-prod-versions.sh — one-line "is each tenant on latest?" 2026-04-30 13:13:47 -07:00
sweep_cf_decide.py refactor(ops): apply simplify findings on #2027 PR 2026-04-26 00:28:15 -07:00
sweep-cf-orphans.sh refactor(ops): apply simplify findings on #2027 PR 2026-04-26 00:28:15 -07:00
sweep-cf-tunnels.sh fix(sweep-cf-tunnels): buffer pages to disk to avoid argv ARG_MAX 2026-05-02 00:42:25 -07:00
test_check_migration_collisions.py fix(test): convert migration-collision tests from pytest to unittest (#2341) 2026-04-30 01:47:27 -07:00
test_sweep_cf_decide.py refactor(ops): apply simplify findings on #2027 PR 2026-04-26 00:28:15 -07:00