{"version":"2.1.221","anchor":"web-sessions-can-adopt-refreshed-credentials-from-the-heartb","canonical_anchor":"web-sessions-can-adopt-refreshed-credentials-from-the-heartb","heading":"Web sessions can adopt refreshed credentials from the heartbeat","tier":"internal","area":"Auth","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.221\/e\/web-sessions-can-adopt-refreshed-credentials-from-the-heartb","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.221","markdown":"### Web sessions can adopt refreshed credentials from the heartbeat\n\nWeb sessions can swap in a refreshed credential mid-run instead of waiting for the old one to expire.\n\n**What**\n\nThe Claude-Code-on-the-web worker client can pick up a new credential mid-session when the server sends one on a heartbeat, rather than waiting for the existing credential to lapse.\n\n**Details**\n\n- New `adoptRefreshedAuth`: if a heartbeat response carries `refreshed_auth` with `expires_in_seconds`, the worker adopts the credential in place.\n- Diagnostics `cli_heartbeat_refreshed_auth_signal`, `cli_heartbeat_refreshed_auth_late_adopted` and `cli_heartbeat_refreshed_auth_adopt_threw`.\n- Repeated failure reasons are deduped via `lastAuthRefreshBadReason`.\n- Only wired in when `CLAUDE_CODE_ENVIRONMENT_KIND` is unset; otherwise the handler is not passed at all.\n\n**Evidence**\n\n`cli_heartbeat_refreshed_auth_signal`\n\n- Area: Auth\n- Names: `CLAUDE_CODE_ENVIRONMENT_KIND`\n- Tier: Under the hood\n- Useful: 2\/5\n- Signal: 0\/5"}