SQL Server Agent appears to be treating sysprocesses (and dm_exec_sessions) differently
As pointed out in the comments by Aaron, the current session was being caught, because they are reused in the connection pool.

The solution is to filter it out:

AND session_id &lt;&gt; @@SPID