Hello everyone,
I have enabled Code Interpreter on a couple of agents I am currently working on, and I am seeing inconsistent behaviour that I am trying to understand.
Agent A
- Code Interpreter is enabled at the agent level
- No prompt tools and no flows explicitly invoking Code Interpreter
- I have only added/tuned the agent instructions
- This works extremely well:
- It creates Python‑based visualisations
- Charts are rendered correctly both in Copilot Studio canvas and in Teams
- In Teams, I’m prompted for permission to upload the chart to OneDrive, and once accepted:
- The visual is rendered in chat
- A copy is stored in my OneDrive
Agent B
- Code Interpreter is also enabled at the agent level
- I copied the Code Interpreter‑related instructions from Agent A and pasted it on this agent.
- However, rendering does not work in this agent
Some additional context:
- Both agents have a similar overall architecture
- Both use flows to retrieve data from SQL Server
- Agent B has two additional flows compared to Agent A
- Knowledge sources:
- Agent A: none
- Agent B: SQL tables added as knowledge (in addition to flows), mainly to provide a semantic layer
my questions are:
I’m essentially trying to understand whether I’ve:
- Bumped into something that “just works” in Agent A, or
- Whether differences in instructions, flows, or knowledge sources can realistically change the model’s decision to invoke Code Interpreter.
- Is Agent A working because the instructions are sufficient to make the model consistently trigger Code Interpreter?
- Is this behaviour expected but inherently non‑deterministic?
- Or should I assume that the most robust and supported approach is to always use a Prompt tool (with Code Interpreter enabled) invoked from a flow, even if agent‑level instructions sometimes appear to be enough?

Report
All responses (
Answers (