Problem: AtCoder file upload always used a `.cpp` temp file regardless of language. CF submit used `solve_cloudflare=True` causing a spurious "No Cloudflare challenge found" error, and `_wait_for_gate_reload` in `login_action` was dead code. Stale or expired cookies caused silent auth failures with no recovery. The `uv.spawn` ndjson path for submit had no overall timeout, so a hung browser process would live forever. Solution: Replace AtCoder's temp file with `page.set_input_files` using an in-memory buffer and correct extension via `_LANGUAGE_ID_EXTENSION`. Replace CF's temp-file/fallback dance with a direct `textarea[name="source"]` fill and set `solve_cloudflare=False` on the submit fetch. Add a fast-path that skips the homepage login check when cookies exist, with automatic stale-cookie recovery via `_retried` flag on redirect-to-login detection. Remove `_wait_for_gate_reload`. Fix `_ensure_browser` to propagate install errors instead of swallowing them. Add a 120s kill timer to the ndjson `uv.spawn` submit path. |
||
|---|---|---|
| .. | ||
| cp | ||