Skip to content

[Feature Request] Add REPL-style run_demo_loop utility for rapid agent testing and debugging #784

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
solyarisoftware opened this issue May 29, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@solyarisoftware
Copy link

[Feature Request] Add REPL-style run_demo_loop utility for rapid agent testing and debugging


Summary

I would like to request the addition of a REPL-style utility function—analogous to swarm.repl.run_demo_loop—to the OpenAI Agents SDK. This function would facilitate rapid, interactive testing of agent behaviors from the command line, ideally supporting streaming output and preserving conversation state across multiple user-agent exchanges.


Motivation

In the previous OpenAI Swarm experimental framework, the run_demo_loop(agent, stream=True) function proved invaluable for quickly validating agent behaviors, tool invocations, and instruction tuning in a lightweight, interactive shell. This was especially useful during iterative development and debugging cycles.

As of now, the Agents SDK provides robust agent orchestration capabilities via Runner.run(), run_sync(), and run_streamed(), but lacks a simple, built-in interactive loop to simulate turn-based conversation flows in a terminal environment.

While some third-party developers have implemented ad-hoc REPL interfaces, an officially supported method would be preferable for maintainability, ergonomics, and consistency with SDK design patterns.


Requested Feature

  • A built-in utility (e.g., agents.repl.run_demo_loop(agent, stream=True)) to:
    • Prompt the developer for input in a terminal loop
    • Stream or render agent responses in real time
    • Retain context across turns (i.e., use conversation state)
    • Optionally display tool calls and trace metadata

Benefits

  • Enhances developer productivity for rapid prototyping and validation
  • Improves debugging workflows without the need to write boilerplate scaffolding
  • Encourages wider adoption by lowering the barrier to entry for experimentation

Example Usage

...
agent = Agent(
    name="Assistant",
    instructions="You are a helpful assistant.",
    tools=[...],
)

run_demo_loop(agent, stream=True)

thanks
giorgio

@solyarisoftware solyarisoftware added the enhancement New feature or request label May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant