Merge "Generate per-use prompt only when the process is foreground" into tm-dev