fix(core): stabilize tool definition ordering (#38590)
This commit is contained in:
parent
bb3f4cc3c7
commit
c228fc4886
4 changed files with 35 additions and 5 deletions
|
|
@ -323,7 +323,10 @@ const registryLayer = Layer.effect(
|
|||
const codemodeTool = (yield* codeMode.materialize(permissions)).tool
|
||||
return {
|
||||
definitions: [
|
||||
...Array.from(direct, ([name, registration]) => toLLMDefinition(name, registration.tool)),
|
||||
// Definitions are prompt-cache prefix bytes, so order only after effective registrations settle.
|
||||
...Array.from(direct)
|
||||
.sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0))
|
||||
.map(([name, registration]) => toLLMDefinition(name, registration.tool)),
|
||||
...(codemodeTool ? [toLLMDefinition("execute", codemodeTool)] : []),
|
||||
],
|
||||
execute: (input: ExecuteInput) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue