microsoft / microsoft/agent-framework
Python: Magentic workflow, sharing files from agent1 to agent2 for HostedCodeInterpreter use
@TaoChenOSU is already working on this.
Since Jun 2, 2026.
- Dominant language
- Python
- Stars
- 13.6k
- Forks
- 2.3k
- Avg merge
- 2d 45m
- Merged PRs (30d)
- 358
Description
IDK if this is an error or smt
but here is my problem:
my system (Magentic) has 2 agent (agent1 and agent2)
- agent1 is a producer, has a tool in my backend that generates a csv File
i want this file to be analised in agent2.
agent2 has "tools=[HostedCodeInterpreterTool()]," . I don't want the LLM to read all csv file, i just want the csv to be upload to agent2-codeInterpreter space
but theres seems not to be a proper way to do this.
i tried:
- using Share State:
- when agent1 tool (generate_csv) was finish , it was upload to a global sharestate . and passing file_id
failed because shareState is running in local (my backend, {correct me if not}) and model has not access to file in my backend
- using "project_client.agents.files.upload_and_poll(...)" same way
- failed because agent2 cant find file.
idk if environments ( in agents.files.upload_and_poll) are per agent.
apparently the only way for an agent to use a file in code interpreter is when:
project.agents.messages.create(
thread_id=thread_id,
role="user",
content="load this csv file to do your task.",
attachments=attachments,
)
but this would break the intention of Magentic workflow cause the orch is the one in charge of creating messages.
Is someone dealing with this already?
how its supposed to be done?
If a new featured is needed, are you guys releasing something soon?
if more context is needed please ask.
thanks!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.