ToolFlag.IGNORE_ON_ENTER Is Broken With Amazon Nova 2 Sonic
Los mantenedores suelen responder en 1 día
@uuzzrm ya está trabajando en esto.
Desde el 12/8/2026.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- aws, python
- Área
- audio-video-rtc
Línea de trabajo
Start with the supplied reproduction, focusing on the three generate_reply calls in TestAgent.on_enter and the function_tool decorated with ToolFlag.IGNORE_ON_ENTER. Compare behavior with versions 1.6.4 and 1.6.5 or later using the listed Nova 2 Sonic setup. Done means each on_enter call plays audio while the flag still excludes the tool; a linked pull request is already open.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug Description
When using the ToolFlag.IGNORE_ON_ENTER flag on a function_tool with AWS nova 2 sonic, multiple generate_reply calls in an on_enter function won't play audio. IE, the first generate_reply call will generate audio, however subsequent generate_reply calls will not. This only affects livekit-agents and livekit-plugins-aws[realtime] versions greater or equal to 1.6.5. Version 1.6.4 is does not contain the defect.
Expected Behavior
ToolFlag.IGNORE_ON_ENTER won't affect audio being played from an on_enter function. The flag is only supposed to exclude any tool from any generate_reply calls made inside the agent's on_enter method.
Reproduction Steps
Test file:
from livekit.agents import AgentServer, WorkerOptions, JobContext, AutoSubscribe, function_tool, RunContext
from livekit.agents.cli import run_app
from livekit.agents.llm import ToolFlag
from livekit.plugins import aws
from livekit.agents import TurnHandlingOptions, AgentSession, Agent
import dotenv
# loads the following env vars in .env file.
# AWS_ACCESS_KEY_ID
# AWS_SECRET_ACCESS_KEY
# AWS_SESSION_TOKEN
# AWS_REGION
# LIVEKIT_URL
# LIVEKIT_API_KEY
# LIVEKIT_API_SECRET
dotenv.load_dotenv()
def main() -> None:
server = AgentServer.from_server_options(
WorkerOptions(
entrypoint_fnc=entrypoint,
agent_name='fake-agent-name', # CHANGE THIS
load_threshold=0.99,
max_retry=6,
port=8080,
drain_timeout=900,
prometheus_port=9095,
multiprocessing_context="spawn",
)
)
run_app(server)
async def entrypoint(ctx: JobContext) -> None:
session = AgentSession(
llm=aws.realtime.RealtimeModel(
model="amazon.nova-2-sonic-v1:0",
tool_choice="auto",
max_tokens=6000,
temperature=0,
region='us-west-2',
turn_detection="HIGH",
),
tts=aws.TTS(voice="Ruth", region='us-west-2'),
turn_handling=TurnHandlingOptions(
interruption={"resume_false_interruption": True, "false_interruption_timeout": 1.0},
),
)
await session.start(room=ctx.room, agent=TestAgent())
await ctx.connect(auto_subscribe=AutoSubscribe.AUDIO_ONLY)
class TestAgent(Agent):
def __init__(self, *args, **kwargs) -> None:
super().__init__(
*args,
instructions='you are test agent. just have a conversation',
tools=[test_tool],
**kwargs,
)
async def on_enter(self):
await self.session.generate_reply(instructions='say hello') # will generate audio
await self.session.generate_reply(instructions='introduce yourself') # doesn't generate audio
await self.session.generate_reply(instructions='say goodbye') # doesn't generate audio
@function_tool(flags=ToolFlag.IGNORE_ON_ENTER)
def test_tool(context: RunContext) -> None:
"""Call this tool when the user requests that you execute the test tool."""
context.session.generate_reply(instructions='announce that you just called the test tool')
if __name__ == "__main__":
main()
Call into the agent, and the generate_reply calls in the on_enter function will not play audio. Removing ToolFlag.IGNORE_ON_ENTER from the function tool and calling back will play audio
Operating System
macOS Tahoe/Linux Debian GNU/Linux 12 (bookworm)
Models Used
Nova 2 Sonic
Package Versions
livekit-agents==1.6.8
livekit-plugins-aws[realtime]==1.6.8
livekit==1.1.14
livekit-api==1.2.0
Session/Room/Call IDs
No response
Proposed Solution
Additional Context
No response
Screenshots and Recordings
No response
- Lenguaje dominante
- Python
- Estrellas
- 14.6k
- Forks
- 3.9k
- Merge medio
- 2 d 21 h
- PR fusionados (30 d)
- 249
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 livekit/agents
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
livekit/agents#8284 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
ci: unit tests pin Python 3.12 while the package advertises 3.14 supportPosiblemente ocupada @huong8373tt-beep la tomó hace 6 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
livekit/agents#8231 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Assistant markup is stripped from chat history when expressive mode is offPosiblemente ocupada @ShivamSharma43 la tomó hace 27 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
livekit/agents#7647 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
docs: openai.LLM vs openai.responses.LLM for HTTP OpenAI-compat hostsQuizá libre de nuevo @AbarnaaSree la tomó hace 67 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
livekit/agents#7022 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de livekit/agents
Issues similares
-
needs-area-label
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 2 días
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Official-Space-AI/OpenPhysGraspGen#114 ·
Los mantenedores suelen responder en 2 días
-
changelog investigate
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
ramnes/notion-sdk-py#441 ·
-
qa_bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NVIDIA-NeMo/Gym#5644 ·
Los mantenedores suelen responder en 2 días
-
BUG: catalog database credentials printed to logs at startupPosiblemente ocupada @cjboyle la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día