Use detect_kwargs in runner, fix #5259