Add per-actor `setproctitle` via `devx._proctitle`

New `tractor.devx._proctitle` mod sets each
sub-actor's `argv[0]` (and kernel `comm`) to
`tractor[<aid.reprol()>]` — e.g.
`tractor[doggy@1027301b]` — so `ps`/`top`/`htop`
and `acli.pytree`/reaper tooling can identify
actors at a glance without parsing full cmdlines.

Deats,
- `set_actor_proctitle()` wraps the `setproctitle`
  pkg with `ImportError` guard; optional at runtime
  but listed in `pyproject.toml` so default installs
  benefit.
- called early in `_child._actor_child_main()` after
  `Actor` construction, before `_trio_main()` entry.
- tests in `tests/devx/test_proctitle.py`: format
  unit test, `/proc/{cmdline,comm}` integration
  test, negative detection test.

Resolves #457

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code

(cherry picked from commit d60245777e)
trionics_start_or_cancel
Gud Boi 2026-05-08 00:04:48 -04:00
parent 15b8bd27ae
commit ac3bc11332
1 changed files with 0 additions and 2 deletions

View File

@ -43,10 +43,8 @@ dependencies = [
"tricycle>=0.4.1,<0.5", "tricycle>=0.4.1,<0.5",
"wrapt>=1.16.0,<2", "wrapt>=1.16.0,<2",
"colorlog>=6.8.2,<7", "colorlog>=6.8.2,<7",
# built-in multi-actor `pdb` REPL # built-in multi-actor `pdb` REPL
"pdbp>=1.8.2,<2", # windows only (from `pdbp`) "pdbp>=1.8.2,<2", # windows only (from `pdbp`)
# typed IPC msging # typed IPC msging
"msgspec>=0.20.0", "msgspec>=0.20.0",
"bidict>=0.23.1", "bidict>=0.23.1",