Skip to content

fix(ui): recover locale imports after source errors - #143776

Merged
steipete merged 1 commit into
mainfrom
codex/fix-locale-source-import-recovery
Sep 10, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-locale-source-import-recovery

Conversation

@steipete

@steipete steipete commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Related: #143376

What Problem This Solves

A failed locale source-catalog import stays cached. If it fails before its source files are watched, correcting the source and requesting the locale module again still returns the old error until an unrelated watched-file change clears the cache.

Why This Change Was Made

Clear a rejected source promise once at its producer and rethrow the original error. A later request can then load corrected source. Successful imports still share one promise, and an obsolete generation only clears its own cache. Partition caching and watcher behavior stay unchanged.

The repair adds four production lines and extends an existing regression table with one case.

User Impact

Locale module requests can recover after source corrections without an unrelated file edit. The original failure still reaches the caller; the change adds no automatic retry loop or fallback catalog.

Evidence

  • The new permanent case fails on original production while both stale-generation controls pass. The same test source passes after the repair.
  • 108 focused Vite/build/chunk/locale cases across six files and all 20 canonical changed-file checks pass.
  • A real Vite 8.2.2/tsx 4.23.13 fixture reproduces old-version recovery versus current-version cached failure after repairing an outside-UI source file. The unchanged driver succeeds on the candidate before any watch event, and its genuine filesystem-watch control also succeeds.
  • Fresh independent Codex review found no actionable findings through P2.

The real-plugin fixture uses synthetic catalog input, middleware mode, and no network listener. A paired callback control confirmed that its initial missing source watches came from the fixture’s outer TypeScript loader; removing that loader restored source watches without a product change. Full default ui:dev/HMR behavior remains outside this proof.

@steipete steipete self-assigned this Sep 10, 2026
@clawsweeper

clawsweeper Bot commented Sep 10, 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 app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Sep 10, 2026
@steipete
steipete marked this pull request as ready for review September 10, 2026 06:36
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 10, 2026
@clawsweeper

clawsweeper Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 10, 2026, 6:24 AM ET / 10:24 UTC (Revision 4).

ClawSweeper review

What this changes

The PR lets Control UI locale imports recover after a source error without waiting for a watched-file change and adds regression coverage.

Merge readiness

✅ Ready for maintainer review

The repair remains necessary on current main. The focused change preserves error propagation, successful caching, and generation isolation; no actionable patch defects were found.

Priority: P2
Reviewed head: 7afa62f93a5b16a857fd856f22e15ddcfb4b169f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with meaningful regression coverage and no identified correctness or security blockers.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate. Its captured body reports recovery through the real Vite locale plugin using synthetic source input; full default development-server HMR remains outside that evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate. Its captured body reports recovery through the real Vite locale plugin using synthetic source input; full default development-server HMR remains outside that evidence.
Evidence reviewed 8 items Introduced repair: The pinned merge-base-to-head diff clears the captured generation’s rejected promise and rethrows the original error. It introduces no automatic retry within the current generation.
Current main still retains failures: Current main retains sourceCatalogLoad after rejection. A subsequent request in the same generation therefore awaits the same failed promise; watchChange or buildStart is otherwise needed to replace the cache.
Meaningful regression coverage: The added current-rejection case checks original-error identity, requests the locale again without invalidation, executes the resulting modules, and verifies the corrected catalog. Existing stale-resolution and stale-rejection controls remain.
Findings None None.
Security None None.

How this fits together

The Control UI’s Vite plugin combines English source catalogs with translation memory to generate locale modules. Its shared import cache feeds both ordinary translations and configuration hints.

flowchart TD
  A[Locale module request] --> B[Shared source import]
  C[English source catalogs] --> B
  B --> D{Import succeeds?}
  D -->|Yes| E[Combine translation memory]
  E --> F[Locale and configuration hint modules]
  D -->|No| G[Clear failed promise and return error]
  G -->|Later request| B
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +4, Tests +11. Total +15 across 2 files.

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

Review metrics

None.

Technical review

Best possible solution:

Keep failed-import recovery in the existing cache producer while preserving shared successful loads and generation isolation.

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

Yes, from source: reject the source import, correct it, then request the locale again without invalidation; current main reuses the rejected promise. This review did not execute that path.

Is this the best way to solve the issue?

Yes. Clearing the failure at its producer repairs the cache lifecycle without adding another owner, fallback catalog, or retry loop.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 92464dc49e91.

Labels

Label justifications:

  • P2: This fixes a bounded locale-development recovery failure without evidence of an urgent production outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate. Its captured body reports recovery through the real Vite locale plugin using synthetic source input; full default development-server HMR remains outside that evidence.

Evidence

What I checked:

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: 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 (3 earlier review cycles)
  • reviewed 2026-09-10T06:42:39.956Z sha 771cdc91d4577571be47a9bc45744cfdd787900f :: needs maintainer review before merge. :: none
  • reviewed 2026-09-10T06:52:11.820Z sha 771cdc91d4577571be47a9bc45744cfdd787900f :: needs maintainer review before merge. :: none
  • reviewed 2026-09-10T08:50:32.567Z sha 1bdd51ac861a2143e67df11adc76216fc55c4b9f :: needs maintainer review before merge. :: none

steipete added a commit that referenced this pull request Sep 10, 2026
Observe the same reduced-motion style endpoint after its asynchronous reveal settles. Preserve the reveal-delay bounds, content checks, exact CSS values and existing timeout; no UI or animation behavior changes. Related: #143776.
@steipete
steipete force-pushed the codex/fix-locale-source-import-recovery branch from 771cdc9 to 1bdd51a Compare September 10, 2026 08:43
Clear a rejected source-catalog promise at its producer and preserve the original failure. Later locale requests can load corrected source while successful sharing and generation fencing stay intact. Related: #143376.
@steipete
steipete force-pushed the codex/fix-locale-source-import-recovery branch from 1bdd51a to 7afa62f Compare September 10, 2026 10:19
@steipete
steipete merged commit 50ff4b7 into main Sep 10, 2026
78 checks passed
@steipete
steipete deleted the codex/fix-locale-source-import-recovery branch September 10, 2026 10:39
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 11, 2026
Observe the same reduced-motion style endpoint after its asynchronous reveal settles. Preserve the reveal-delay bounds, content checks, exact CSS values and existing timeout; no UI or animation behavior changes. Related: openclaw#143776.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 11, 2026
Clear a rejected source-catalog promise at its producer and preserve the original failure. Later locale requests can load corrected source while successful sharing and generation fencing stay intact. Related: openclaw#143376.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

1 participant