[GH-ISSUE #24572] feat: Take CODE_INTERPRETER_PROMPT_TEMPLATE into account when native function calling mode is enabled #107335

Open
opened 2026-05-18 06:07:46 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @alexandrumc on GitHub (May 11, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24572

Check Existing Issues

  • I have searched for all existing open AND closed issues and discussions for similar requests. I have found none that is comparable to my request.

Verify Feature Scope

  • I have read through and understood the scope definition for feature requests in the Issues section. I believe my feature request meets the definition and belongs in the Issues section instead of the Discussions.

Problem Description

As can be seen here, CODE_INTERPRETER_PROMPT_TEMPLATE is only considered when native function calling is disabled. In this case, only CODE_INTERPRETER_PYODIDE_PROMPT is used.

However, given that CODE_INTERPRETER_PYODIDE_PROMPT is a Python variable, one cannot change this default prompt without modifying the OWUI code directly.

Desired Solution you'd like

Either consider CODE_INTERPRETER_PROMPT_TEMPLATE when native function calling is enabled or make CODE_INTERPRETER_PYODIDE_PROMPT configurable.

Alternatives Considered

No response

Additional Context

No response

Originally created by @alexandrumc on GitHub (May 11, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/24572 ### Check Existing Issues - [x] I have searched for all existing **open AND closed** issues and discussions for similar requests. I have found none that is comparable to my request. ### Verify Feature Scope - [x] I have read through and understood the scope definition for feature requests in the Issues section. I believe my feature request meets the definition and belongs in the Issues section instead of the Discussions. ### Problem Description As can be seen [here](https://github.com/open-webui/open-webui/blob/main/backend/open_webui/utils/middleware.py#L2518-L2550), `CODE_INTERPRETER_PROMPT_TEMPLATE` is only considered when native function calling is disabled. In this case, only `CODE_INTERPRETER_PYODIDE_PROMPT` is used. However, given that `CODE_INTERPRETER_PYODIDE_PROMPT` is a Python variable, one cannot change this default prompt without modifying the OWUI code directly. ### Desired Solution you'd like Either consider `CODE_INTERPRETER_PROMPT_TEMPLATE` when native function calling is enabled or make `CODE_INTERPRETER_PYODIDE_PROMPT` configurable. ### Alternatives Considered _No response_ ### Additional Context _No response_
Author
Owner

@owui-terminator[bot] commented on GitHub (May 11, 2026):

🔍 Related Issues Found

I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions:

  1. 🟣 #19943 issue: Code Interpreter doesn't work under Native Function Calling Mode
    Directly related: this issue reports that code interpreter fails when native function calling mode is enabled. The new issue is also specifically about native function calling mode and code interpreter prompt behavior.
    by swiftdev29 · bug

  2. 🟣 #23269 issue: Pyodide prompt injection constantly poisons the token cache (native tool calling)
    Related to the same native function calling + code interpreter path, but from the caching/prompt-injection angle. It shows the Pyodide prompt is handled differently under native tool calling and causes side effects there.
    by arbv · bug

  3. 🟣 #22965 issue: Code interpreter prompt (Pyodide) injected into user turn instead of system prompt
    Related because it focuses on the Pyodide/code interpreter prompt injection mechanism itself. The new request is about making the code-interpreter prompt template respected or configurable, which is the same prompt plumbing area.
    by AirRunner · bug

  4. 🟣 #20864 issue: IMAGE_PROMPT_GENERATION_PROMPT_TEMPLATE is ignored when clicking the IMAGE button on LLM response. The prompt is sent directly to ComfyUI without translation/enhancement.
    This is a broader example of a prompt template being ignored in a specific UI/action path. It is relevant as a parallel issue where a configured prompt template is bypassed, similar to CODE_INTERPRETER_PROMPT_TEMPLATE being ignored under native function calling.
    by karoldydo · bug


💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead.

This comment was generated automatically. React with 👍 if helpful, 👎 if not.

<!-- gh-comment-id:4419516413 --> @owui-terminator[bot] commented on GitHub (May 11, 2026): <!-- terminator-bot:related-issues-reply --> 🔍 **Related Issues Found** I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions: 1. 🟣 [#19943](https://github.com/open-webui/open-webui/issues/19943) **issue: Code Interpreter doesn't work under Native Function Calling Mode** *Directly related: this issue reports that code interpreter fails when native function calling mode is enabled. The new issue is also specifically about native function calling mode and code interpreter prompt behavior.* *by swiftdev29 · `bug`* 2. 🟣 [#23269](https://github.com/open-webui/open-webui/issues/23269) **issue: Pyodide prompt injection constantly poisons the token cache (native tool calling)** *Related to the same native function calling + code interpreter path, but from the caching/prompt-injection angle. It shows the Pyodide prompt is handled differently under native tool calling and causes side effects there.* *by arbv · `bug`* 3. 🟣 [#22965](https://github.com/open-webui/open-webui/issues/22965) **issue: Code interpreter prompt (Pyodide) injected into user turn instead of system prompt** *Related because it focuses on the Pyodide/code interpreter prompt injection mechanism itself. The new request is about making the code-interpreter prompt template respected or configurable, which is the same prompt plumbing area.* *by AirRunner · `bug`* 4. 🟣 [#20864](https://github.com/open-webui/open-webui/issues/20864) **issue: IMAGE_PROMPT_GENERATION_PROMPT_TEMPLATE is ignored when clicking the IMAGE button on LLM response. The prompt is sent directly to ComfyUI without translation/enhancement.** *This is a broader example of a prompt template being ignored in a specific UI/action path. It is relevant as a parallel issue where a configured prompt template is bypassed, similar to CODE_INTERPRETER_PROMPT_TEMPLATE being ignored under native function calling.* *by karoldydo · `bug`* --- 💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead. *This comment was generated automatically.* React with 👍 if helpful, 👎 if not.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#107335