[Bug] Apply deletes entire file or fails to patch correctly when using custom edit/apply promptTemplates (JetBrains 1.0.46) #8165
-
Hello, I’m using Continue with a Local Agent connected to my own OpenAI-compatible local API. When I define custom prompts for ⚙️ Environment
🔍 Example config snippetExample of my models:
- name: Test-model
provider: openai
model: my-continue-model
apiBase: https://myownAPI
roles:
- chat
- edit
- apply
promptTemplates:
edit: |
`Here is the code before editing:
\`\`\`{{{language}}}
{{{codeToEdit}}}
\`\`\`
Here is the edit requested:
"{{{userInput}}}"
Here is the code after editing:`
apply: |
Original:
{{{original_code}}}
New:
{{{new_code}}}
Please generate the final code without any markers or explanations. (This configuration follows the official documentation for [Edit role](https://docs.continue.dev/customize/model-roles/edit) and [Apply role](https://docs.continue.dev/customize/model-roles/apply)). ✅ What worksWhen I use the same configuration in VS Code (Continue v1.2.8), it works perfectly — Apply correctly patches the selected region and shows the diff as expected. ❌ What fails (JetBrains)
🔧 What I’ve triedTo debug the issue, I’m currently using a large 🙏 RequestCould you please:
Thanks a lot for your help and for maintaining such a great project! 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I found my bug ! In my environment the API returns responses that aren’t strictly OpenAI-format, which is what breaks Apply/Edit on IntelliJ. I’ve made a small change to harden the flow so it behaves like VS Code and remains robust to non-standard API responses. If this direction looks good, I’ll open a PR❗ |
Beta Was this translation helpful? Give feedback.
I found my bug ! In my environment the API returns responses that aren’t strictly OpenAI-format, which is what breaks Apply/Edit on IntelliJ.
I’ve made a small change to harden the flow so it behaves like VS Code and remains robust to non-standard API responses. If this direction looks good, I’ll open a PR❗
Schrodinger4Cats@f832c2b