Skip to content

Issue with Multi-turn Handoff and Slot Filling #741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hanil-jihun opened this issue May 22, 2025 · 4 comments
Open

Issue with Multi-turn Handoff and Slot Filling #741

hanil-jihun opened this issue May 22, 2025 · 4 comments
Labels
question Question about using the SDK

Comments

@hanil-jihun
Copy link

Hi,
I’m running into a problem with multi-agent handoff and slot filling using OpenAI Agents (function calling, multi-agent orchestration).

Scenario:

I have a main agent and a rental car agent.
When a user asks about rental car reservation, the main agent hands off to the rental car agent.
The rental car agent needs both location and date to make a reservation, so it asks the user for the location first (slot-filling).
The user then provides the location.

Problem:

After the user provides the location, the conversation does not continue with the rental car agent.
Instead, the main agent answers directly (without handing the turn to the rental car agent again), so the slot-filling flow is broken.

Questions:

Is multi-turn slot filling with agent handoff/stateful continuation fully supported in the current OpenAI Agents framework?
Is there a recommended way to ensure that follow-up questions (for slot-filling) keep being routed to the correct agent?
Are there any best practices or configuration changes I should try for this use case?
Thanks for any suggestions or workarounds.

@hanil-jihun hanil-jihun added the question Question about using the SDK label May 22, 2025
@hanil-jihun
Copy link
Author

hanil-jihun commented May 22, 2025

I’ve seen some discussions and got this response from GPT about how OpenAI Agents interpret history:

If you provide the full message structure (such as the output from to_input_list), OpenAI will use the metadata (function call, tool output, status, etc.) in the history to determine that the previous agent session has already been completed or handled.
Because of this, the next user message is treated as the start of a new, single-agent session, instead of continuing with the specialized agent.
In particular, if there is a tool/function output message included, the system may internally interpret the agent’s task as finished, so additional user input gets routed back to the default agent rather than staying with the specialized agent.

If anyone has experience with this or additional insight, please feel free to comment.
Any suggestions, explanations, or best practices would be greatly appreciated.

@Kalai9976
Copy link

When you are trying to handoff instead on having only one agent - if you have more agents handoff are working as expect - If you mention only one agent in handoffs the agent itself throw the output

@Kalai9976
Copy link

Try having some dummy agent in place and run the same. might help

@hanil-jihun
Copy link
Author

Try having some dummy agent in place and run the same. might help

I've tried making two more agents but it is not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question about using the SDK
Projects
None yet
Development

No branches or pull requests

2 participants