fix: write SECURITY_BANNER_DISMISSED_FLAG after security reset to prevent banner reappearing after reboot

Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/8a33795f-2791-4029-98c3-1d703054404f

Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-12 18:08:22 +00:00
committed by GitHub
parent fe51d69700
commit 8caee2ec22

View File

@@ -3383,6 +3383,14 @@ async def api_security_reset():
except Exception as exc: except Exception as exc:
errors.append(f"keyring wipe: {exc}") errors.append(f"keyring wipe: {exc}")
# The user performed a full security reset — the banner's purpose is served.
try:
os.makedirs(os.path.dirname(SECURITY_BANNER_DISMISSED_FLAG), exist_ok=True)
with open(SECURITY_BANNER_DISMISSED_FLAG, "w"):
pass
except OSError:
pass # Non-fatal
return {"ok": True, "new_password": new_free_password, "errors": errors} return {"ok": True, "new_password": new_free_password, "errors": errors}