agent: Fixing regression, invoke does append a newline