Realtime: with async_tool_calls=True, an interruption mid-tool is answered with no pending marker for the call, and the model claims the action already happened
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 44/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- ai, backend-api-design
Research direction
Start by reading the RealtimeSession async tool call and interruption handling paths; the issue names no source files or tests. Reproduce with the linked stopbench realtime_run.py command using --async-tools true and inspect how an in-flight call is represented in conversation context. Done means the model can identify a still-running call without claiming its result, with tests covering interruption during execution.
Written by the indexing model from the issue text.
Description
Versions
- openai-agents 0.24.0,
RealtimeSession - gpt-realtime-2.1, text output
Summary
When the user interrupts while a function tool is running, the stop is answered before the tool has a result, and the model has nothing in its conversation saying the call is still pending. It then guesses, and its guess can be wrong.
Setup: a refund tool with a 400 ms backend commit. The stop is session.interrupt() then session.send_message("Wait, stop. Don't do the refund."). A local ledger records whether the refund committed.
interrupt()cancelled nothing in this text session. Every response in all 40 runs endedcompleted, and the tool always ran to completion.- With
async_tool_calls=True(the default), the stop gets its own response right away while the call has no output yet. In 15 of 15 stop runs the first reply said the refund was "already" in progress, sent or submitted before the model had a result. - When the stop came before the tool's HTTP request was sent, the reply ("I can't stop it at this point because the refund request has already been submitted.") was false when it was said. The ledger received the request 202 to 207 ms later.
- With
async_tool_calls=False, the stop waits for the tool, and the model answers from the real result. But the user hears nothing until the tool returns (6.2 to 6.5 s with a 6 s backend).
Expected
With async_tool_calls=True, a call that's still running should show in the model's context as pending (e.g. a placeholder function output, or a note that a tool call is in progress), so the model can say "it's still processing" and not guess. A way to cancel the running tool task on interrupt() would also help tools that can still be stopped.
Repro
https://github.com/chrislazar25/stopbench
.venv-realtime/bin/python realtime_run.py --async-tools true --runs 5 --moments before_send in_flight --out runs/mine/realtime.jsonl
Data: runs/realtime-gpt-realtime-2.1.jsonl (e.g. refund 5c7a420531e0, before send: "I can't stop it at this point—the refund request has already been sent and is still processing."). README section "Results: OpenAI Agents SDK 0.24.0 realtime".
- Dominant language
- Python
- Stars
- 30.2k
- Forks
- 4.9k
- Avg merge
- 12h 50m
- Merged PRs (30d)
- 162
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from openai/openai-agents-python
-
fix(typing): explicitly specialize ToolContext[Any] in ToolFunctionWithToolContextMay be free again @AbarnaaSree claimed this 9 days ago, and no pull request is open. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
openai/openai-agents-python#5387 · 4 comments ·
Maintainers usually reply within 1 day
-
function_tool on a callable object uses an inherited or generated class docstring as the tool descriptionPossibly taken @Narendra02053 claimed this today. Open
Difficulty 3/5 1-2 days Newbie friendliness 58/100
openai/openai-agents-python#5443 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 70/100
openai/openai-agents-python#5441 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 53/100
openai/openai-agents-python#5413 · 6 comments ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 45/100
openai/openai-agents-python#5412 · 1 comment ·
Maintainers usually reply within 1 day
All issues in openai/openai-agents-python
Similar issues
-
component:benchmark
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
agentic-os-org/ANOLISA#9177 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
distrochooser/distrochooser#520 ·
Maintainers usually reply within 2 days
-
Status: Needs confirmation Status: Needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
[BUG] Published Docker images lack the redis extra: HEADROOM_COMPRESS_SESSION_STORE stops startupPossibly taken @AlessandroSpallina claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
headroomlabs-ai/headroom#4513 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
codespell-project/codespell#4060 ·
Maintainers usually reply within 1 day