diff --git a/packages/core/src/tool/plugin/edit.ts b/packages/core/src/tool/plugin/edit.ts index c449b444b69..949fc767bef 100644 --- a/packages/core/src/tool/plugin/edit.ts +++ b/packages/core/src/tool/plugin/edit.ts @@ -272,7 +272,9 @@ export const Plugin = { .transform((editor) => editor.add({ name, - options: { codemode: flags.resolve(loaded.entries).full_codemode.enabled, permission: "edit" }, + options: flags.resolve(loaded.entries).full_codemode.enabled + ? { codemode: true, pinned: true, permission: "edit" } + : { codemode: false, permission: "edit" }, description: "Edit the contents of a file by finding and replacing exact text. When editing text from Read output, preserve the exact indentation (tabs or spaces) and omit the line-number prefix, such as `1: `. Never include the prefix in oldString or newString. Write line breaks as \\n; the file's existing CRLF or LF line endings are matched and preserved. To change line endings themselves, make oldString and newString differ only in \\r; that edit applies to the exact bytes. If there is no exact match, the edit retries while ignoring typographic quote, dash, and space variants, then trailing whitespace on each line. The edit fails if oldString is not found. By default, oldString must identify a UNIQUE location. Multiple matches FAIL unless replaceAll is true. Add more surrounding context to disambiguate, or set replaceAll to true to replace every occurrence. Use replaceAll when the change should apply to every occurrence, such as renaming a variable.", input: Input, diff --git a/packages/core/src/tool/plugin/patch.ts b/packages/core/src/tool/plugin/patch.ts index e08655e3a5b..8b58eaa3bb5 100644 --- a/packages/core/src/tool/plugin/patch.ts +++ b/packages/core/src/tool/plugin/patch.ts @@ -68,7 +68,9 @@ export const Plugin = { .transform((editor) => editor.add({ name, - options: { codemode: flags.resolve(loaded.entries).full_codemode.enabled, permission: "edit" }, + options: flags.resolve(loaded.entries).full_codemode.enabled + ? { codemode: true, pinned: true, permission: "edit" } + : { codemode: false, permission: "edit" }, description: DESCRIPTION, input: Input, freeform: { type: "lark", grammar: GRAMMAR }, diff --git a/packages/core/src/tool/plugin/read.ts b/packages/core/src/tool/plugin/read.ts index e85490bd75d..d9e1bdce34e 100644 --- a/packages/core/src/tool/plugin/read.ts +++ b/packages/core/src/tool/plugin/read.ts @@ -53,7 +53,7 @@ export const Plugin = { const codeMode = flags.resolve(loaded.entries).full_codemode.enabled editor.add({ name, - options: { codemode: codeMode }, + options: codeMode ? { codemode: true, pinned: true } : { codemode: false }, description: [ "Read the contents of a file or directory. Supports text files, images, and PDFs.", ...(codeMode diff --git a/packages/core/src/tool/plugin/write.ts b/packages/core/src/tool/plugin/write.ts index 472035af3c6..882ef22d69a 100644 --- a/packages/core/src/tool/plugin/write.ts +++ b/packages/core/src/tool/plugin/write.ts @@ -44,7 +44,9 @@ export const Plugin = { .transform((editor) => editor.add({ name, - options: { codemode: flags.resolve(loaded.entries).full_codemode.enabled, permission: "edit" }, + options: flags.resolve(loaded.entries).full_codemode.enabled + ? { codemode: true, pinned: true, permission: "edit" } + : { codemode: false, permission: "edit" }, description: "Writes a file to the local filesystem, overwriting if one exists.\n\nMissing parent directories are created automatically.\n\nUse this tool to create new files or overwrite existing files. For partial changes, use the edit tool instead.", input: Input,