Address PR feedback: error on stream=false for ChatGPT, fix auth file permissions

This commit is contained in:
Spherrrical 2026-04-20 13:18:44 -07:00
parent c0cc226b74
commit 5af3199f5a
4 changed files with 45 additions and 12 deletions

View file

@ -51,7 +51,8 @@ def load_auth() -> Optional[Dict[str, Any]]:
def save_auth(data: Dict[str, Any]):
"""Save auth data to disk."""
_ensure_auth_dir()
with open(CHATGPT_AUTH_FILE, "w") as f:
fd = os.open(CHATGPT_AUTH_FILE, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600)
with os.fdopen(fd, "w") as f:
json.dump(data, f, indent=2)