Fix the cache keyshop
The cache returns stale results when the locale changes. Can you fix it and make sure the tests pass?

I'll start by finding where the cache key is built and how the tests exercise it.

The key ignores the locale, so two languages share one entry. I'll thread it through getKey and update the callers.

Fixed. The cache key now includes the locale, so switching language no longer returns another language's entry.

  • src/cache.ts:18: getKey(url, locale) builds the key from both
  • src/api.ts:44: callers pass ctx.locale

A new test covers the locale case, and all 13 tests pass.

claude-sonnet-5-5 · 14.2s · 41k tokens
Changed 3 files
shopAGENTS.md