"""低频位探测:每 WAIT 秒单次干净尝试(只选高质量题),直到通过或轮次用完。 用法: python try/rate_limit_probe.py [wait_sec] [rounds] [max_score] """ import asyncio import sys import cold_start_attempt as csa async def main(): try: wait_sec = int(sys.argv[1]) if len(sys.argv) > 1 else 600 rounds = int(sys.argv[2]) if len(sys.argv) > 2 else 6 max_score = float(sys.argv[3]) if len(sys.argv) > 3 else 5.0 except ValueError: print("用法: python try/rate_limit_probe.py [wait_sec] [rounds] [max_score]", file=sys.stderr) return for i in range(rounds): print(f"===== round {i + 1}/{rounds} =====", flush=True) try: r = await csa.main_once(max_questions=4, max_score=max_score) except RuntimeError as e: print(f"attempt error: {e}", flush=True) r = "error" print(f"round {i + 1} -> {r}", flush=True) if r == "PASS": print("*** PASS ***", flush=True) return if i < rounds - 1: print(f"冷却 {wait_sec}s...", flush=True) await asyncio.sleep(wait_sec) print("轮次用完", flush=True) if __name__ == "__main__": asyncio.run(main())