Skip to content

fix(kiloclaw): select weather units from user location#3546

Open
pandemicsyn wants to merge 2 commits into
mainfrom
fix/kiloclaw-weather-location-units
Open

fix(kiloclaw): select weather units from user location#3546
pandemicsyn wants to merge 2 commits into
mainfrom
fix/kiloclaw-weather-location-units

Conversation

@pandemicsyn
Copy link
Copy Markdown
Contributor

@pandemicsyn pandemicsyn commented May 27, 2026

Summary

  • Fix a dev/production mismatch in KiloClaw onboarding weather previews: wttr.in inferred its default unit system from the server-side request origin, so development calls came from the developer's local network where correct, while production calls came from Vercel infrastructure and could display different units for the same selected location.
  • Resolve location metadata before requesting the formatted weather preview, then explicitly request USCS/Fahrenheit output for United States locations and metric/Celsius output for other or unresolved locations.
  • Keep metadata lookup best-effort so a temporary failure to resolve the country does not prevent an otherwise successful metric weather preview.
  • Add regression coverage for US and non-US unit selection, missing country metadata, and partial upstream outages.

Verification

  • Manually compared wttr.in responses for Amsterdam with unspecified, explicit metric (m), and explicit USCS (u) output; the unqualified response used the request origin's default while explicit unit options produced deterministic output.
  • No authenticated end-to-end onboarding walkthrough was performed in a deployed environment because the defect mechanism was isolated to the server-side upstream request and explicit-unit behavior was verified directly against wttr.in.
  • Additional manual verification details from reviewer/tester

Visual Changes

N/A

Reviewer Notes

  • Review the country-to-units mapping: only resolved United States locations use u; missing or failed metadata falls back to m.
  • The shared backend procedure serves both web and mobile onboarding clients; neither client requires a UI change.

Comment thread apps/web/src/routers/kiloclaw-router.ts Outdated
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented May 27, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The previous suggestion (redundant unknown | null return type on fetchWeatherLocationData) has been resolved — the type is now correctly Promise<unknown>.

Files Reviewed (2 files)
  • apps/web/src/routers/kiloclaw-router.ts — previous suggestion resolved
  • apps/web/src/routers/kiloclaw-router.test.ts — no issues

Reviewed by claude-sonnet-4.6 · 160,872 tokens

Review guidance: REVIEW.md from base branch main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants