{"version":"2.1.225","anchor":"code-session-failures-are-now-a-terminal-non-terminal-discri","canonical_anchor":"code-session-failures-are-now-a-terminal-non-terminal-discri","heading":"Code-session failures are now a terminal\/non-terminal discriminated union","tier":"notice","area":"Auth","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.225\/e\/code-session-failures-are-now-a-terminal-non-terminal-discri","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.225","markdown":"### Code-session failures are now a terminal\/non-terminal discriminated union\n\nExpired logins during code sessions now refresh and retry automatically instead of failing the operation.\n\n**What**\n\nHTTP failures from code-session calls are classified in one place, and a 401 is treated as recoverable so the caller refreshes OAuth and retries instead of failing the operation.\n\n**Details**\n\n- one helper returns `\"oauth_rejected\"` for 401, `\"transient\"` for 408, 429 and any status >= 500, and `\"rejected\"` otherwise\n- 401 yields `{ terminal: !1, reason: \"oauth_rejected\" }`\n- the type guards now check `e.terminal === !0` \/ `e.terminal === !1` rather than testing for the presence of a `terminal` key\n- the bridge's 401 retry path also fires when the result is any non-terminal failure\n\n**Evidence**\n\n`oauth_rejected`\n\n- Area: Auth\n- Tier: You'll notice\n- Useful: 3\/5\n- Signal: 0\/5"}