From 30a42ba6d575e6c8e84da38691e5f9144490a0be Mon Sep 17 00:00:00 2001 From: Daniel Dolezal Date: Sun, 3 May 2026 17:08:26 +0200 Subject: [PATCH] fix(auth): skip agent keys with comment (none) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gpg-agent retains YubiKey entries after card removal but resets the comment to "(none)". Treating those as valid keys causes auth to succeed against a ghost identity — skip them so the caller gets None and the missing-card error path fires correctly. --- browser_cli/auth.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/browser_cli/auth.py b/browser_cli/auth.py index 94dca13..21d2dd5 100644 --- a/browser_cli/auth.py +++ b/browser_cli/auth.py @@ -103,6 +103,8 @@ def agent_find_key(selector: str | None = None) -> AgentKey | None: except Exception: return None for key in keys: + if key.comment == "(none)": + continue if selector is None or selector in key.comment: return key return None