Skip to content

fix(test): Control UI tests fail on non-US-English host locales - #161899

Merged
obviyus merged 3 commits into
openclaw:mainfrom
DonnieFi:fix/ui-usage-view-host-locale
Oct 7, 2026
Merged

obviyus merged 3 commits into
openclaw:mainfrom
DonnieFi:fix/ui-usage-view-host-locale

Conversation

@DonnieFi

@DonnieFi DonnieFi commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #161898

What Problem This Solves

Control UI tests inherit the developer's default locale, although their currency/date assertions expect US-English output. This produces false failures on non-US-English machines.

User Impact

Test-runner only: pin LANG and LC_ALL to C.UTF-8 before root Vitest child processes start, matching CI and the existing isolated runner. Production formatting is unchanged. Thanks to @DonnieFi for reporting, reproducing, and implementing the fix.

This intentionally overrides shell LANG/LC_ALL for root test runs. Locale-specific suites still choose their own locale explicitly: the Control UI formatting and wizard locale-selection suites pass under a German parent environment. No test relying on an inherited non-English locale was found. The direct pnpm --dir ui test entry point remains outside this root-runner change.

Evidence

Integrated main 2ae568e850a67b2b1d79c778c4cd833f129ae805 because the runner tests had materially changed; retained the contributor commits and ported the regression into the current table-driven test.

Secretless Linux Docker, Node 24.16.0, generated locales, all six issue-listed files through node scripts/run-vitest.mjs run (83 tests on this base). The baseline restores the exact main environment owner; all other source and UI tests are identical:

Parent locale Baseline Candidate
de_DE.UTF-8 10 failed, 73 passed 83 passed
ja_JP.UTF-8 7 failed, 76 passed 83 passed
en_US.UTF-8 83 passed 83 passed
C.UTF-8 83 passed 83 passed

Both English controls are unchanged. The parent Node process independently reported de-DE/ja-JP, so the failing controls did not silently fall back to English. Representative baseline failures include 1. Mai 2026 / 2026年5月1日 versus May 1, 2026, and localized provider currencies.

  • Real tsgo scripts typecheck passed (47.1 s wall).
  • The locale regression fails with the baseline owner and passes with the candidate; it adds one in-process table row without timers, subprocesses, or I/O.
  • Explicit-locale coverage: ui/src/lib/format.test.ts and src/wizard/i18n/index.test.ts pass under de_DE.UTF-8.
  • Additional runner siblings: isolated-runner and worker-shutdown suites passed. vitest-worker-artifacts hit the same existing uncertain output compiler-lifetime assertion on candidate and revert baseline (live versus indeterminate); a focused candidate run passed. This process-lifetime assertion is outside the locale change; it is not claimed fixed.
  • The PR's own run-vitest and ci-run-node-test-shard suites pass: 334 tests, 38.3 s combined wall with --maxWorkers=1 (36.6 s Vitest duration). The added locale table row is in-process; the existing shard/process scenarios account for the suite cost.
  • Both incoming cancelled checks were PR context and evidence, not test shards. One recorded its actual evidence-check step as successful and the other had no steps. Replayed scripts/github/real-behavior-proof-check.mjs against the public PR payload without credentials: exit 0, “External PR includes problem context and evidence.” No cancelled selected test lists were omitted.
  • No live-provider gate: this is test infrastructure only.

No overlap with Pash/Sarah changes.

@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS labels Sep 30, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 30, 2026
@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 6, 2026, 10:23 PM ET / October 7, 2026, 02:23 UTC (Revision 3).

ClawSweeper review

What this changes

The PR pins root Vitest test-process locales to C.UTF-8 and updates runner regression coverage so host locales cannot change expected currency and date output.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary on current main. The focused patch and supplied before/after locale results support readiness, with no actionable correctness findings or additional contributor blocker.

Priority: P2
Reviewed head: 2ec6c261c00ac410e6ec4c582cef897b1268acb1

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow owner-boundary repair, meaningful regression coverage, and convincing locale controls support normal good PR quality.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The supplied Linux Docker before/after matrix exercises the changed shared environment through the real root runner: German and Japanese baseline failures become 83 passing tests per locale, with English controls and explicit-locale suites preserved. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The supplied Linux Docker before/after matrix exercises the changed shared environment through the real root runner: German and Japanese baseline failures become 83 passing tests per locale, with English controls and explicit-locale suites preserved. No stored-data contract changes.
Evidence reviewed 9 items Verified introduced change: The pinned merge-base-to-head delta sets LANG and LC_ALL in the existing shared child-environment owner and adjusts runner tests; it does not change application formatting or dependencies.
Current main still needs the fix: Current main resolves local scheduling and native worker budgets without overriding inherited locale variables.
Latest release comparison: The same owner in the supplied latest release, v2026.9.8, also inherits locale variables; that release does not contain this correction.
Findings None None.
Security None None.

How this fits together

OpenClaw’s root test runners turn developer and CI commands into test child processes. Their startup environment determines the default locale used by Control UI formatting tests.

flowchart LR
  A[Developer or CI command] --> B[Root test runner]
  B --> C[Shared child environment]
  C --> D[Fixed test locale]
  D --> E[Vitest child process]
  E --> F[Formatting assertions]
  F --> G[Test results]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +5, Other +6. Total +11 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 7 2 +5
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 7 1 +6
Total 3 14 3 +11

Review metrics

Metric Value Why it matters
Locale behavior validation 4 parent locales; 83 tests per candidate run Non-English failing controls and unchanged English controls exercise the actual root-runner boundary.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #161898
Summary: This PR is the implementation candidate for the paired root-runner locale defect.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep locale normalization in the shared root-runner environment owner while preserving explicit-locale tests and browser-dependent application formatting.

Do we have a high-confidence way to reproduce the issue?

Yes. Source confirms current main inherits the host locale, and the linked issue plus supplied baseline/candidate runs identify concrete formatting failures through the root runner; this review did not execute tests.

Is this the best way to solve the issue?

Yes. Normalizing the environment before child startup fixes the shared root entry point, matches existing isolation practice, and avoids changing correct application formatting.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2ba33cb84999.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Locale-dependent false test failures disrupt local development with limited impact outside test infrastructure.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The supplied Linux Docker before/after matrix exercises the changed shared environment through the real root runner: German and Japanese baseline failures become 83 passing tests per locale, with English controls and explicit-locale suites preserved. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied Linux Docker before/after matrix exercises the changed shared environment through the real root runner: German and Japanese baseline failures become 83 passing tests per locale, with English controls and explicit-locale suites preserved. No stored-data contract changes.

Evidence

What I checked:

  • Verified introduced change: The pinned merge-base-to-head delta sets LANG and LC_ALL in the existing shared child-environment owner and adjusts runner tests; it does not change application formatting or dependencies. (scripts/lib/vitest-process-env.mts:35, 2ec6c261c00a)
  • Current main still needs the fix: Current main resolves local scheduling and native worker budgets without overriding inherited locale variables. (scripts/lib/vitest-process-env.mts:35, 2ba33cb84999)
  • Latest release comparison: The same owner in the supplied latest release, v2026.9.8, also inherits locale variables; that release does not contain this correction. (scripts/lib/vitest-process-env.mts:35, fc23bc864e45)
  • Actual runner boundary: The root runner passes the shared resolved environment into Vitest spawn options. The isolated runner already uses C.UTF-8, establishing an existing test-environment precedent rather than a competing implementation. (scripts/run-vitest.mts:218, 2ec6c261c00a)
  • After-fix behavior proof: The complete supplied PR body reports secretless Linux Docker runs with Node 24.16.0 through node scripts/run-vitest.mjs run. With identical UI tests and the baseline environment owner restored, German and Japanese parents produce 10 and 7 failures respectively; the candidate passes all 83 tests under each of four locales. Independent parent Intl observations verify non-English controls. Explicit-locale suites also pass under German. This assessment preserves supplied sourceRevision 313662b7704cfdc8636f2a20a50cad6a994e911ee1e52a24a78c17c639309272 and does not claim reviewer execution. (2ec6c261c00a)
  • Bounded regression and validation: The added German-locale row exercises the existing spawn-environment contract without new timers, subprocesses, I/O, or test-only production seams. The supplied proof reports baseline failure, candidate success, scripts typecheck success, and 334 runner tests passing in 38.3 seconds combined wall time. An unrelated compiler-lifetime assertion failed on both baseline and candidate and is explicitly not claimed fixed. (test/scripts/run-vitest.test.ts:933, 2ec6c261c00a)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • RoboClaw: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-30T13:42:25.125Z sha caf4838 :: needs changes before merge. :: none
  • reviewed 2026-09-30T17:25:20.477Z sha 7ddb7bc :: needs maintainer review before merge. :: none

@obviyus

obviyus commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus
obviyus merged commit 9cb0aff into openclaw:main Oct 7, 2026
123 of 127 checks passed
@clawsweeper

clawsweeper Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(test): Control UI tests fail on non-US-English host locales This is item 1/1 in the current shard. Shard 0/1.

This temporary status tracks the active review worker. The completed review will appear in the durable ClawSweeper review comment.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@obviyus

obviyus commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Landed in 9cb0aff. Thanks @DonnieFi! Reproduced in Docker with generated locales: main had 10 false failures under de_DE and 7 under ja_JP, all 83 pass with this, and en_US/C runs are unchanged.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 7, 2026
…claw#161899)

Pin the locale for root vitest child processes so local node scripts/run-vitest.mjs and pnpm test runs match CI on any host locale instead of reporting false Control UI failures under locales such as de_DE or ja_JP.

Closes openclaw#161898.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Control UI unit tests fail on non-US-English host locales (currency and date formatting)

2 participants