Approval decision transfers across runs when call ID is reused
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 53/100
Línea de trabajo
Start in agents/run_state.py at RunState.approve() and trace how approval records are stored and checked when a run resumes. Reproduce the issue with the scripted two-run example in the report, then inspect the existing changed-arguments and no-decision cases. Done when an approval from the first run cannot authorize the repeated call in the second run, while approvals within the issuing run still work.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
In the OpenAI Agents SDK (tested on v0.23.1), an approval decision issued in one run can authorize a protected tool call in a different run when the same call_id is used with identical arguments. The approval record is keyed by call_id but not bound to the run lineage.
Location: agents/run_state.py — RunState.approve() accepts a ToolApprovalItem from a previous run.
Reproduction (offline, scripted model)
# Run 1: request approval for write_marker(path="A"), approve it
result1 = await Runner.run(agent, "do it", context=ctx1)
state1 = result1.to_state()
state1.approve(result1.interruptions[0]) # approve args=A
result1b = await Runner.run(agent, state1) # executes args=A ✓
# Run 2: NEW run, same agent, same tool, same call_id, same args
result2 = await Runner.run(agent, "do it again", context=ctx2)
state2 = result2.to_state()
state2.approve(old_approval_item) # ← passes the OLD approval item
result2b = await Runner.run(agent, state2) # executes AGAIN ✓ ← bug
The second run executes the protected callback without a fresh approval decision, because state2.approve() accepts the ToolApprovalItem object from run 1.
Boundaries (verified)
- Changed arguments are correctly rejected: if args differ, the approval does not transfer
- No decision → stays interrupted: without any approval, the run correctly waits
- The issue is specifically the cross-run transfer of the approval object
Impact
In scenarios where serialized sessions are replayed, or a proxy/load balancer reassigns call IDs, a stale approval from a previous interaction can authorize a new execution. The SDK documents call IDs as unique within a run, but does not bind approval records to the issuing run's lineage.
Suggested fix
Bind approval records to the run that issued them (e.g., include a run ID in the approval record and validate it in RunState.approve()). This would prevent cross-run approval transfer without affecting the per-call binding that already works correctly.
- Lenguaje dominante
- Python
- Estrellas
- 30.4k
- Forks
- 4.9k
- Merge medio
- 14 h 33 min
- PR fusionados (30 d)
- 142
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de openai/openai-agents-python
-
fix(typing): explicitly specialize ToolContext[Any] in ToolFunctionWithToolContextQuizá libre de nuevo @AbarnaaSree la tomó hace 11 días y no hay ningún pull request abierto. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
openai/openai-agents-python#5387 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
function_tool rejects valid arguments when a parameter uses Pydantic strict mode (Enum, date, UUID)Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
openai/openai-agents-python#5448 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
openai/openai-agents-python#5447 ·
Los mantenedores suelen responder en 1 día
-
function_tool on a callable object uses an inherited or generated class docstring as the tool descriptionPosiblemente ocupada @Narendra02053 la tomó hace 2 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
openai/openai-agents-python#5443 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 70/100
openai/openai-agents-python#5441 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de openai/openai-agents-python
Issues similares
-
app: scripts status: backlog type: documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
netbox-community/netbox-scripts#68 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
marin-community/marin#10765 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
flathub/com.unity.UnityHub#230 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Claiming namespace `lang2hong`Abiertonamespace operations
Dificultad 1/5 Menos de una hora Aptitud para principiantes 63/100
EclipseFdn/open-vsx.org#14910 ·
Los mantenedores suelen responder en 1 día