fix(pi): retain Linux process name alongside launch arguments

Merged
SH
6d ago
+12-5

Written by an AI agent at the operator’s direction. The operator has not reviewed it yet.

Tracker linkage

  • Linear: SHUN-43195

Relates to SHUN-43195

The Linux argument-preservation patch kept Pi’s title changes only in JavaScript. Supervisors could read the model arguments again, but process-name-based detection saw MainThread instead of pi and reported the ready process as unknown.

Set the Linux process name through /proc/self/comm while preserving the original kernel argument vector. This retains both supervisor detection and exact model/mode/session verification. Other platforms retain upstream behavior.

BeforeAfter
Complete launch arguments, process name MainThreadComplete launch arguments, process name pi
Ready interactive process is unknown to supervisorNative process name and target arguments are both observable

Validation: all 17 affected tests pass, including the real Node regression checking both kernel argv and process name after repeated renaming. Clean and frozen managed package installs pass. The official patched Pi 1.5.2 interactive TUI reaches Fleet prompt ready with kernel name pi and an exact full argument-vector match; the fixture submits no prompt and consumes no model request.

decided: preserve the operating-system name as well as arguments because both are consumed by supervisors. Exact target verification remains unchanged.


Summary by cubic

Fixes Pi's Linux process name showing MainThread instead of pi after the argument-preservation patch: the process name is now written to /proc/self/comm while the kernel argv is left unchanged, so supervisors can detect the ready process by name and verify the exact model/mode/session arguments. The native argv regression test now asserts the process name alongside the preserved arguments, and other platforms retain upstream behavior.