agent: Fix full path agent detection