From 1428505413b786523fd00f9a454f4953f28fb703 Mon Sep 17 00:00:00 2001 From: Danathar <6772335+Danathar@users.noreply.github.com> Date: Tue, 17 Nov 2026 12:55:48 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Sessions:=20adopt=20a=20Codex=20?= =?UTF-8?q?or=20OpenCode=20login=20refreshed=20in=20a=20session=20back=20i?= =?UTF-8?q?nto=20the=20shared=20login?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A session gets a full copy of .codex/auth.json and .local/share/opencode/auth.json. Codex's ChatGPT login and an OpenCode OAuth entry rotate their refresh token on refresh, so a session that refreshed its copy held the only valid login and the shared file the agents link to went stale. Reuse the Claude adopt-back from #18728 for these two files: when a session HOME holds a strictly newer login (Codex: later last_refresh, different refresh token; OpenCode per provider entry: later expires, different refresh token; file written after the shared one), adopt it into the shared file atomically, keep the replaced file as .stale-