mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-21 17:27:54 +00:00
feat(tool): sort tool list alphabetically for deterministic output (#3095)
Co-authored-by: Pascal Birchler <pascalb@google.com>
This commit is contained in:
@@ -308,7 +308,9 @@ export class ToolRegistry {
|
||||
* Returns an array of all registered and discovered tool instances.
|
||||
*/
|
||||
getAllTools(): Tool[] {
|
||||
return Array.from(this.tools.values());
|
||||
return Array.from(this.tools.values()).sort((a, b) =>
|
||||
a.displayName.localeCompare(b.displayName),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -321,7 +323,7 @@ export class ToolRegistry {
|
||||
serverTools.push(tool);
|
||||
}
|
||||
}
|
||||
return serverTools;
|
||||
return serverTools.sort((a, b) => a.name.localeCompare(b.name));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user