Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Approval decision transfers across runs when call ID is reused

Abierto
#5,413 6 comentarios 0 reacciones 0 asignados Ver en GitHub

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
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python
Área
backend, security

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

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de openai/openai-agents-python

Todos los issues de openai/openai-agents-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.