← Back to PRs

#11362: fix: name parent shim processes for clarity in ps output

by anooprdawar open 2026-02-07 18:48 View on GitHub →
channel: telegram stale
## Problem When OpenClaw respawns to inject `--disable-warning=ExperimentalWarning`, the parent process keeps the generic `openclaw` title. This makes `ps` output confusing: ``` 5717 openclaw ← which one is this? 5718 openclaw-gateway ← the real gateway 7735 openclaw ← and this? 7736 openclaw-tui ← the real TUI ``` ## Fix Set the parent shim's `process.title` to `openclaw-{subcommand}-shim` before spawning the child: ``` 5717 openclaw-gateway-shim ← parent (signal forwarder) 5718 openclaw-gateway ← actual gateway 7735 openclaw-tui-shim ← parent (signal forwarder) 7736 openclaw-tui ← actual TUI ``` One-line change in `entry.ts`. The subcommand is extracted from `process.argv` (first non-flag argument), which is already available before the respawn. Fixes #11309 <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR improves process visibility during CLI respawn by setting the parent shim’s `process.title` based on the invoked subcommand, so `ps` output distinguishes the shim from the actual child command. It also changes Telegram update offset persistence to scope stored offsets to a specific bot by persisting the bot ID extracted from the bot token and validating it on read; the monitor now passes the bot token through to the offset store, and tests were expanded to cover token changes, legacy files, and malformed tokens. <h3>Confidence Score: 2/5</h3> - This PR needs fixes before merging due to a test file syntax/structure issue and an argv-derived title edge case. - The Telegram offset scoping change is coherent and test-covered, but the updated test file appears to have unbalanced closing braces/parentheses that would break compilation, and the shim title extraction runs before argv normalization/rewrites done later in the same entrypoint, which can produce incorrect shim titles in some invocations (notably Windows / profile arg rewriting). - src/telegram/update-offset-store.test.ts, src/entry.ts <!-- greptile_other_comments_section --> <sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub> <!-- /greptile_comment -->

Most Similar PRs