Skip to content

The agent that grows with you

fix: preserve macOS bootstrap evidence and accept BOM-prefixed auth state

ethernet10cee4905a4d
diff --git a/hermes_cli/auth_oauth_grants.py b/hermes_cli/auth_oauth_grants.py
index 11913ef471d..91692b7a7ea 100644
--- a/hermes_cli/auth_oauth_grants.py
+++ b/hermes_cli/auth_oauth_grants.py
@@ -172,7 +172,7 @@ def _persisted_oauth_heal_fingerprint(provider_id: str) -> Optional[list]:
if path is None:
return None
try:
- data = json.loads(path.read_text(encoding="utf-8"))
+ data = json.loads(path.read_text(encoding="utf-8-sig"))
except Exception:
return None
if not isinstance(data, dict):
@@ -194,7 +194,7 @@ def _persist_oauth_heal_clean_mark(provider_id: str, fingerprint: tuple) -> None
from utils import atomic_json_write
try:
- existing = json.loads(path.read_text(encoding="utf-8"))
+ existing = json.loads(path.read_text(encoding="utf-8-sig"))
except Exception:
existing = {}
if not isinstance(existing, dict):
@@ -310,7 +310,7 @@ def _adopt_oauth_material(target: Dict[str, Any], winner: Dict[str, Any]) -> Dic
def _singleton_as_row(path: Path) -> Optional[Dict[str, Any]]:
"""Read a ``.anthropic_oauth.json`` as a pool-row-shaped dict, or None."""
try:
- data = json.loads(path.read_text(encoding="utf-8"))
+ data = json.loads(path.read_text(encoding="utf-8-sig"))
except (OSError, ValueError):
return None
if not isinstance(data, dict) or not str(data.get("accessToken") or "").strip():
diff --git a/tests/install/e2e-assets/drive-dmg-install.sh b/tests/install/e2e-assets/drive-dmg-install.sh
index 1335379bd67..c57d7081403 100644
--- a/tests/install/e2e-assets/drive-dmg-install.sh
+++ b/tests/install/e2e-assets/drive-dmg-install.sh
@@ -40,7 +40,12 @@ shot() {
"$APP_BIN" &
SETUP_PID=$!
log "launched $APP_BIN (pid $SETUP_PID)"
-cleanup() { kill "$SETUP_PID" 2>/dev/null || true; }
+cleanup() {
+ kill "$SETUP_PID" 2>/dev/null || true
+ if [ -d "$HOME/.hermes/logs" ]; then
+ cp -R "$HOME/.hermes/logs" "$PROOF_DIR/bootstrap-logs"
+ fi
+}
trap cleanup EXIT
# Wait for the installer window, then click the install button. The webview's
@@ -77,10 +82,10 @@ click_install() {
set -- $geo
local x=$1 y=$2 wd=$3 ht=$4
if [ -n "$LAST_ERR" ]; then
- # Error screen: Retry install sits left of center at ~59% height
- # (measured: button x 359-492, y 402-441 in the 880x620 window).
- local cx=$((x + wd * 48 / 100))
- local cy=$((y + ht * 59 / 100))
+ # Measured against the published installer: screen rect 359..492,391..430
+ # for a window at 72,58 sized 880x620.
+ local cx=$((x + wd * 40 / 100))
+ local cy=$((y + ht * 57 / 100))
cliclick "c:${cx},${cy}" 2>&1 || true
echo "clicked retry ${cx},${cy} (window ${x},${y} ${wd}x${ht})"
return 0