Skip to content
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

OpenAI S2S Error: Your session hit the maximum duration of 15 minutes. #1073

Open
ramikalai opened this issue Nov 12, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@ramikalai
Copy link

I'm looking to run sessions in the 30+ minutes range and need to handle disconnects more gracefully, especially a timeout where it is inevitable at the 15 minute mark.

Would be great if the SDK could create a new connection, pass the messages across (assuming they fit in the context window) and restart the conversation seamlessly.

Here's the error log I received:

{"message": "OpenAI S2S error {'type': 'error', 'event_id': 'event_ASrZ7rjANnmB9VU5pR7YR', 'error': {'type': 'invalid_request_error', 'code': 'session_expired', 'message': 'Your session hit the maximum duration of 15 minutes.', 'param': None, 'event_id': None}}", "level": "ERROR", "name": "livekit.plugins.openai.realtime", "session_id": "sess_ASrKbnhOx1ypg69LBJTRo", "pid": 10, "job_id": "AJ_KdcwoYrsmwFA", "timestamp": "2024-11-12T20:14:13.590702+00:00"}
{"message": "Error in _recv_task\nTraceback (most recent call last):\n  File \"/home/appuser/.local/lib/python3.11/site-packages/livekit/agents/utils/log.py\", line 16, in async_fn_logs\n    return await fn(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/appuser/.local/lib/python3.11/site-packages/livekit/plugins/openai/realtime/realtime_model.py\", line 835, in _recv_task\n    raise Exception(\"OpenAI S2S connection closed unexpectedly\")\nException: OpenAI S2S connection closed unexpectedly", "level": "ERROR", "name": "livekit.plugins.openai.realtime", "pid": 10, "job_id": "AJ_KdcwoYrsmwFA", "timestamp": "2024-11-12T20:14:13.600141+00:00"}
{"message": "Error in _main_task\nTraceback (most recent call last):\n  File \"/home/appuser/.local/lib/python3.11/site-packages/livekit/agents/utils/log.py\", line 16, in async_fn_logs\n    return await fn(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/appuser/.local/lib/python3.11/site-packages/livekit/plugins/openai/realtime/realtime_model.py\", line 902, in _main_task\n    await asyncio.gather(*tasks)\n  File \"/home/appuser/.local/lib/python3.11/site-packages/livekit/agents/utils/log.py\", line 16, in async_fn_logs\n    return await fn(*args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/appuser/.local/lib/python3.11/site-packages/livekit/plugins/openai/realtime/realtime_model.py\", line 835, in _recv_task\n    raise Exception(\"OpenAI S2S connection closed unexpectedly\")\nException: OpenAI S2S connection closed unexpectedly", "level": "ERROR", "name": "livekit.plugins.openai.realtime", "pid": 10, "job_id": "AJ_KdcwoYrsmwFA", "timestamp": "2024-11-12T20:14:13.648497+00:00"}
@ramikalai ramikalai added the bug Something isn't working label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant