You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
claude harness: a Cloudflare challenge mid-session is treated as a non-retryable first-attempt auth failure #80341
actions/setup/js/claude_harness.cjs treats any authentication failure on the first attempt as non-retryable:
if(attempt===0&&isAuthenticationFailed){log(`attempt ${attempt+1}: authentication failed — not retrying (first-attempt auth failure is non-retryable)`);return{action: "stop"};}
We hit a case where that is wrong. Fifteen minutes into a healthy run (45 turns, all API calls succeeding), the Claude CLI emitted a synthetic assistant message and result:
{"type":"assistant","message":{"model":"<synthetic>","content":[{"type":"text","text":"Failed to authenticate. API Error: Just a moment..."}]},"error":"authentication_failed","is_api_error_message":true}
{"is_error":true,"num_turns":45,"terminal_reason":"api_error","api_error_status":403,"result":"Failed to authenticate. API Error: Just a moment...","type":"result"}
"Just a moment..." is the title of a Cloudflare challenge page: the 403 came from the edge, not from the API's credential check, and it is transient. The harness logged:
So a run that had already authenticated successfully dozens of times was stopped with three retries unused.
Suggested change
Do not classify an HTML challenge body (Just a moment..., cf-chl, challenge-platform, or generally an HTML document where a JSON error was expected) as authentication_failed; treat it like other transient API errors.
Apply the first-attempt rule only when sessionHasProgress is false. A credential that has worked for the whole session has not become invalid in a way a retry with --continue cannot survive; a genuinely revoked key will fail the retry quickly anyway.
Seen on gh-aw v0.87.5; the same code path is on main today (claude_harness.cjs and AUTHENTICATION_FAILED_PATTERNS in harness_error_patterns.cjs).
Activity
pelikhan commentedon Nov 23, 2026
@copilot fix for all harnesses