Skip to content

AI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary

fix: skip POSIX secret warning on Windows

Dinakar Sarbada8ea207b3481d
diff --git a/skills/last30days/scripts/lib/env.py b/skills/last30days/scripts/lib/env.py
index 58751a4d..c7abc817 100644
--- a/skills/last30days/scripts/lib/env.py
+++ b/skills/last30days/scripts/lib/env.py
@@ -70,6 +70,10 @@ class OpenAIAuth:
def _check_file_permissions(path: Path) -> None:
"""Warn to stderr if a secrets file has overly permissive permissions."""
+ if os.name == "nt":
+ # Windows reports synthesized POSIX mode bits that do not reflect NTFS ACLs.
+ return
+
try:
mode = path.stat().st_mode
# Check if group or other can read (bits 0o044)
diff --git a/tests/test_env_v3.py b/tests/test_env_v3.py
index a79ec690..811e3f82 100644
--- a/tests/test_env_v3.py
+++ b/tests/test_env_v3.py
@@ -41,6 +41,14 @@ class EnvV3Tests(unittest.TestCase):
with mock.patch.dict(os.environ, {}, clear=False):
self.assertIsNone(bird_x.is_bird_authenticated())
+ def test_file_permission_check_skips_windows_posix_mode_bits(self):
+ path = mock.Mock(spec=Path)
+ with mock.patch.object(env.os, "name", "nt"), mock.patch.object(env.sys.stderr, "write") as write:
+ env._check_file_permissions(path)
+
+ path.stat.assert_not_called()
+ write.assert_not_called()
+
if __name__ == "__main__":
unittest.main()