#11362: fix: name parent shim processes for clarity in ps output
channel: telegram
stale
Cluster:
Session Management and Fixes
## 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
#13881: fix: Address Greptile feedback - test isolation and channel resolution
by trevorgordon981 · 2026-02-11
76.7%
#15306: fix: explicit exit after onboarding command completes
by jeroenbaas · 2026-02-13
75.8%
#11159: fix(cli): parse --profile flag after subcommand name
by hclsys · 2026-02-07
75.7%
#3783: Fix/3038 cli name moltbot
by Shuimo03 · 2026-01-29
75.5%
#11347: fix: scope Telegram update offset to bot token
by anooprdawar · 2026-02-07
75.4%
#18126: Fix process tree kill leaving orphans on Unix (manual traversal fal...
by Clawborn · 2026-02-16
75.3%
#16157: fix(security): OC-31 scope process cleanup to owned PIDs
by aether-ai-agent · 2026-02-14
75.2%
#11048: fix: address repository issues (env, author, CI comments, security ...
by cavula · 2026-02-07
75.2%
#21271: fix(commands): pass channel/capabilities/shell/os to runtime in com...
by evansantos · 2026-02-19
75.2%
#3186: fix(telegram): sanitize update offset + lock polling
by daxiong888 · 2026-01-28
74.7%