From a6d4bb0e47687792460e409d8d5dabeb2da773f7 Mon Sep 17 00:00:00 2001 From: Kail Tian Date: Sun, 9 Aug 2026 16:05:00 +0800 Subject: [PATCH 1/2] fix(skills): make weather workflow Windows-safe --- nanobot/skills/weather/SKILL.md | 26 ++++++++++++++++++----- tests/agent/test_builtin_weather_skill.py | 14 ++++++++++++ 2 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 tests/agent/test_builtin_weather_skill.py diff --git a/nanobot/skills/weather/SKILL.md b/nanobot/skills/weather/SKILL.md index 8073de192a8..23cabce9a3e 100644 --- a/nanobot/skills/weather/SKILL.md +++ b/nanobot/skills/weather/SKILL.md @@ -11,23 +11,39 @@ Two free services, no API keys needed. ## wttr.in (primary) -Quick one-liner: +Choose one request that matches the user's scope. Do not fetch current +conditions separately when a today or forecast request already includes them. + +Platform notes: +- On Windows PowerShell, use `curl.exe`; bare `curl` may resolve to + `Invoke-WebRequest`. +- On macOS and Linux, use `curl`. + +Current conditions only: ```bash -curl -s "wttr.in/London?format=3" +curl -s "https://wttr.in/London?format=3" # Output: London: ⛅️ +8°C ``` -Compact format: +Custom current conditions format: ```bash -curl -s "wttr.in/London?format=%l:+%c+%t+%h+%w" +curl -s "https://wttr.in/London?format=%l:+%c+%t+%h+%w" # Output: London: ⛅️ +8°C 71% ↙5km/h ``` +Today's weather, including current conditions (use this single request for +questions about today's weather): +```bash +curl -s "https://wttr.in/London?1&m" +``` + Full forecast: ```bash -curl -s "wttr.in/London?T" +curl -s "https://wttr.in/London?T&m" ``` +On Windows PowerShell, replace `curl` with `curl.exe` in the commands above. + Format codes: `%c` condition · `%t` temp · `%h` humidity · `%w` wind · `%l` location · `%m` moon Tips: diff --git a/tests/agent/test_builtin_weather_skill.py b/tests/agent/test_builtin_weather_skill.py new file mode 100644 index 00000000000..ab17f814ddb --- /dev/null +++ b/tests/agent/test_builtin_weather_skill.py @@ -0,0 +1,14 @@ +from nanobot.agent.skills import BUILTIN_SKILLS_DIR + + +def test_weather_skill_uses_windows_safe_single_today_request() -> None: + content = (BUILTIN_SKILLS_DIR / "weather" / "SKILL.md").read_text(encoding="utf-8") + normalized = " ".join(content.split()) + + assert "On Windows PowerShell, use `curl.exe`" in normalized + assert "bare `curl` may resolve to `Invoke-WebRequest`" in normalized + assert "https://wttr.in/London?1&m" in content + assert ( + "Do not fetch current conditions separately when a today or forecast " + "request already includes them." + ) in normalized From 9d2a922c1050e580fb1ceddcccfacd413a415ddc Mon Sep 17 00:00:00 2001 From: Xubin Ren <52506698+Re-bin@users.noreply.github.com> Date: Wed, 12 Aug 2026 00:12:46 +0900 Subject: [PATCH 2/2] fix(skills): make PNG weather example Windows-safe --- nanobot/skills/weather/SKILL.md | 3 ++- tests/agent/test_builtin_weather_skill.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/nanobot/skills/weather/SKILL.md b/nanobot/skills/weather/SKILL.md index 23cabce9a3e..6dfffa9ac23 100644 --- a/nanobot/skills/weather/SKILL.md +++ b/nanobot/skills/weather/SKILL.md @@ -51,7 +51,8 @@ Tips: - Airport codes: `wttr.in/JFK` - Units: `?m` (metric) `?u` (USCS) - Today only: `?1` · Current only: `?0` -- PNG: `curl -s "wttr.in/Berlin.png" -o /tmp/weather.png` +- PNG (macOS/Linux): `curl -s "https://wttr.in/Berlin.png" -o weather.png` +- PNG (Windows PowerShell): `curl.exe -s "https://wttr.in/Berlin.png" -o weather.png` ## Open-Meteo (fallback, JSON) diff --git a/tests/agent/test_builtin_weather_skill.py b/tests/agent/test_builtin_weather_skill.py index ab17f814ddb..d94104ca57d 100644 --- a/tests/agent/test_builtin_weather_skill.py +++ b/tests/agent/test_builtin_weather_skill.py @@ -8,6 +8,8 @@ def test_weather_skill_uses_windows_safe_single_today_request() -> None: assert "On Windows PowerShell, use `curl.exe`" in normalized assert "bare `curl` may resolve to `Invoke-WebRequest`" in normalized assert "https://wttr.in/London?1&m" in content + assert 'curl.exe -s "https://wttr.in/Berlin.png" -o weather.png' in content + assert "/tmp/weather.png" not in content assert ( "Do not fetch current conditions separately when a today or forecast " "request already includes them."