diff --git a/backend/open_webui/utils/agents/codex.py b/backend/open_webui/utils/agents/codex.py index 8e00acd17d..7d5824d75b 100644 --- a/backend/open_webui/utils/agents/codex.py +++ b/backend/open_webui/utils/agents/codex.py @@ -169,6 +169,9 @@ async def run(transport, output, prompt, images, options): ) elif method == 'turn/completed': turn = params.get('turn') or {} + # Subagent turns complete on this stream too. + if turn.get('id') != turn_id: + continue if turn.get('status') == 'failed' or turn.get('error'): raise ValueError(str(turn.get('error') or 'Codex turn failed')) return