SIGN IN SIGN UP

Keep nested agents' hooks from acting as the hcom-launched parent

An agent launched by hcom exports HCOM_PROCESS_ID to its shells. A plain
sub-worker started from them (codex exec, opencode run, ...) inherited it,
and its globally installed hcom hooks bound to and acted as the parent:
overwriting its session, consuming its inbox, moving its status.

- Hooks know their tool from the hook command. A hook whose tool differs
  from the launched HCOM_TOOL, or a Codex/Gemini hook carrying its tool's
  shell-only markers (CODEX_SESSION_ID/CODEX_THREAD_ID, GEMINI_CLI), serves
  a nested agent: scrub the inherited identity, parent markers and Claude
  session/actor vars at startup so it runs as a plain unlaunched session.
  Kilo/OpenCode and Antigravity/Gemini hook sharing is kept apart via
  OPENCODE_PID and GEMINI_CLI/GEMINI_CLI_NO_RELAUNCH, which the launcher
  now strips from launched agents.
- start never mints a second identity for, or repoints, a process id bound
  to a live instance; if that instance's session is not bound yet, it binds
  it and prints the bootstrap.

Other same-tool children (OpenCode, Kilo, Pi, Omp, Kimi, Cursor,
Antigravity, Copilot) remain unsupported until per-run hook isolation.
A
aannoo committed
744088c501249402e3c0045e4c4f668a478e2005
Parent: 2eb7fdf