mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 09:20:43 +00:00
fix: pin localeCompare to 'en' locale for cross-environment stability
Addresses review feedback: localeCompare without a fixed locale uses the runtime default, which varies across servers. Pinning 'en' ensures byte-identical prompts for cache stability. Applied at all three sort points in workspace.ts.
This commit is contained in:
committed by
Peter Steinberger
parent
a4b94f77b9
commit
c4488d5ef5
@@ -500,7 +500,7 @@ function loadSkillEntries(
|
||||
if (loadedSkills.length > limits.maxSkillsLoadedPerSource) {
|
||||
return loadedSkills
|
||||
.slice()
|
||||
.sort((a, b) => a.name.localeCompare(b.name))
|
||||
.sort((a, b) => a.name.localeCompare(b.name, "en"))
|
||||
.slice(0, limits.maxSkillsLoadedPerSource);
|
||||
}
|
||||
|
||||
@@ -575,7 +575,7 @@ function loadSkillEntries(
|
||||
}
|
||||
|
||||
const skillEntries: SkillEntry[] = Array.from(merged.values())
|
||||
.sort((a, b) => a.name.localeCompare(b.name))
|
||||
.sort((a, b) => a.name.localeCompare(b.name, "en"))
|
||||
.map((skill) => {
|
||||
const frontmatter =
|
||||
readSkillFrontmatterSafe({
|
||||
@@ -764,7 +764,7 @@ function resolveWorkspaceSkillPromptState(
|
||||
// resolvedSkills keeps canonical paths for snapshot / runtime consumers.
|
||||
const promptSkills = compactSkillPaths(resolvedSkills)
|
||||
.slice()
|
||||
.sort((a, b) => a.name.localeCompare(b.name));
|
||||
.sort((a, b) => a.name.localeCompare(b.name, "en"));
|
||||
const { skillsForPrompt, truncated, compact } = applySkillsPromptLimits({
|
||||
skills: promptSkills,
|
||||
config: opts?.config,
|
||||
|
||||
Reference in New Issue
Block a user