Skip to content

fix(work-view): decide the refresh text language once from the owner's asks (#5660) - #5669

Merged
thedotmack merged 3 commits into
thedotmack:mainfrom
0xABCD01:fix/5660-focus-area-language
Nov 10, 2026
Merged

thedotmack merged 3 commits into
thedotmack:mainfrom
0xABCD01:fix/5660-focus-area-language

Conversation

@0xABCD01

Copy link
Copy Markdown
Contributor

Fixes #5660.

On an en-US system with no CLAUDE_MEM_WORK_VIEW_TEXT_LANGUAGE set, all six suggested focus areas came out in Spanish while the run's other text was in English.

Cause: resolveTextLanguage returned null when the setting was empty, so no refresh question named a language. Grouping, review, focus and story run as separate agents that each see only their own input — a focus step sees one batch of requests, or only the Other bucket — so each step guessed the owner's language from its own slice, and the focus steps guessed Spanish. The comment on the setting already names this risk: steps "left to the skill's rule … could each pick a different language". The setting was the only remedy.

Change: when the setting does not name a language, resolveTextLanguage now falls back to the system locale's language, named from the runtime's own locale data (Intl.Locale / Intl.DisplayNames, e.g. es-ES → "Spanish"). The existing rule sentence then names that language in every grouping, review, focus and story question, so one run writes in one language. Nothing is detected by a model and no extra agent call is made; the question count is unchanged. A valid setting still wins, an invalid value is still never used, the goals step still keeps the skill's own rule, and when neither the setting nor the locale names a language the previous behavior (skills pick) is unchanged.

Notes:

  • This changes what "empty" means: the steps no longer guess per batch. An owner whose asks are written in a different language than their system locale should set CLAUDE_MEM_WORK_VIEW_TEXT_LANGUAGE, which overrides the locale.
  • The issue thread suggested defaulting to the viewer's selected language. That value lives only in the browser's local storage and never reaches the worker, so this PR uses the system locale — for the reporter (en-US system, viewer on English) it is the same value. Happy to rework it if you would rather plumb the viewer language through.
  • Areas already saved in the wrong language are not renamed by this change; Refresh does not rewrite saved areas, so those still need Rename or Dismiss.
  • Verified at the prompt level with the refresh test harness: before, a run with the setting unset asked 5 questions naming no language; after, the same 5 questions name the run's language. Tests: tests/work-view/ plus the agent-runner extraction tests pass (310), typecheck is clean. Two existing language tests were updated to the new default and new cases cover the locale naming.

…s when the text-language setting is empty

With CLAUDE_MEM_WORK_VIEW_TEXT_LANGUAGE unset, resolveTextLanguage returned
null and no refresh question named a language, so each step guessed the
owner's language from the slice of asks its own question holds. A focus
batch could guess a different language than the reviews did: on an en-US
system all six suggested focus areas came out in Spanish (thedotmack#5660).

resolveTextLanguage now falls back to the system locale's language, named
through the runtime's own locale data (Intl), still never detected by a
model and still costing no extra agent call. The setting keeps priority,
an invalid value is never used, and when neither names a language the
skills' own Language rule applies as before. The goals step is unchanged.
@mintlify

mintlify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit fcc36d5.

Approve preview

thedotmack and others added 2 commits November 10, 2026 12:52
…he locale

Rework for landing (CS-2026-11-10). The system locale misnames the
language for anyone whose asks differ from their OS locale, and a
launchd/systemd daemon often has no LANG at all, so it traded one
wrong-language bug for another. The request-progress skill's rule is
"the language most of the owner's asks are written in, decided once".

- The grouping answer gains a "language" field. The grouping question
  already reads the asks, so this costs no extra model call.
- With CLAUDE_MEM_WORK_VIEW_TEXT_LANGUAGE empty, the first valid grouping
  answer (checked against LANGUAGE_NAME) becomes the run's language and is
  named in every later review, focus and story question; the setting still
  wins. It is recorded in work-view/text-language.json, so a run with
  nothing to group reuses it. With neither, the skill's own rule applies.
- The locale fallback is gone; docs, the settings comment and SKILL.md
  describe the new rule.
- Tests: the grouping language reaches every later question (fails on
  main), the setting beats it, a non-language value is never used, and a
  recorded language is reused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019FbY8dn1wxYSP3vpxpSTnS
@thedotmack

Copy link
Copy Markdown
Owner

Thanks @0xABCD01, you found the right root cause: with the setting empty, each grouping, review, focus and story question guessed the language from its own slice, so a focus batch could land in Spanish. I pushed a rework to your branch instead of the locale fallback, because the system locale misnames the language for anyone whose asks don't match their OS (a de-DE machine with English asks), and a launchd/systemd daemon often has no LANG, so it would force English on everyone. The skill's rule is "the language most of the owner's asks are written in, decided once", so:

  • the grouping answer gains a language field. The grouping question already reads the asks, so this costs no extra model call;
  • with CLAUDE_MEM_WORK_VIEW_TEXT_LANGUAGE empty, the first valid grouping answer becomes the run's language and is named in every later review, focus and story question (the setting still wins). It's recorded in work-view/text-language.json so a run with nothing to group reuses it, and only a value that passes LANGUAGE_NAME is ever put in a question;
  • tests: the grouping language reaches every later question (fails on main), the setting beats it, a non-language value is never used, and a recorded language is reused. I merged main (it now has feat(work-view): run the My Work refresh on the selected API provider, opt-in #5674) and reverted the locale wording in the docs, the settings comment and SKILL.md.

I'll merge once CI is green.

@0xABCD01

Copy link
Copy Markdown
Contributor Author

Thanks — "decided once from the owner's asks" is a better rule than my locale fallback, and the daemon-with-no-LANG case is a fair point I hadn't weighed properly. Appreciate you pushing the rework straight onto the branch; I'll leave it as is from here.

@thedotmack
thedotmack merged commit eee6ef2 into thedotmack:main Nov 10, 2026
10 checks passed
@thedotmack

Copy link
Copy Markdown
Owner

Merged, thank you @0xABCD01! With CLAUDE_MEM_WORK_VIEW_TEXT_LANGUAGE empty, a My Work refresh now decides its language once, from the grouping step's reading of your asks, and names it in every review, focus and story question, so separate batches can't drift into different languages (#5660). The setting still wins, and a run with nothing to group reuses the last decided language. As noted above, this replaced the system-locale fallback.

@thedotmack thedotmack changed the title fix(work-view): name the system locale's language in refresh questions when the text-language setting is empty fix(work-view): decide the refresh text language once from the owner's asks (#5660) Nov 10, 2026
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.

My Work focus areas generated in Spanish on an English system

3 participants