Skip to content

Tower/shellper: architect session-ID collisions + non-recovering crash loops after workspace restart #1224

Description

@waleedkadous

Reported by an external adopter workspace (4 incidents in one session, 2026-07-22), after a full workspace restart: Tower restarted, 8 architects re-added via afx workspace add-architect. Details scrubbed; adopter can supply shellper PIDs/timestamps on request.

Symptom A — session-ID collision crash loop

An architect terminal crash-loops with:

Error: Session ID <uuid> is already in use

The shellper restarts its claude child forever; every child dies instantly. Two distinct holder cases observed:

  1. Stale pre-restart shellper for the same architect name still held the session ID (survivor from before the Tower restart).
  2. Unrelated foreground claude process on the user's own tty (started with wrong auth) had claimed the session ID.

Symptom B — wedged shellper / registry divergence

  • After the holder is killed, the shellper does not recover — children keep dying within seconds even with the session free.
  • The architect silently deregisters from Tower while its shellper process stays alive crash-looping. afx workspace remove-architect then fails with not found while the zombie process persists.
  • A third architect silently vanished from the registry with no crash loop observed at all.

Recovery that worked (both collision cases)

  1. Kill the wedged/stale shellper PID manually.
  2. afx workspace add-architect --name <name> fresh.
  3. Re-run /arch-init.

No state lost (state files + builders unaffected) — but the procedure is entirely manual and non-obvious.

Suggested fixes (from the reporter)

  • (a) Mint-or-reclaim session IDs atomically on add-architect — never reuse a persisted session ID without verifying no live holder; or always mint fresh.
  • (b) Crash-loop breaker in shellper — detect repeated instant-exit of the child (N failures in M seconds), give up loudly, and deregister cleanly instead of looping forever.
  • (c) Make deregistration and process death atomic — today both divergence directions occur: a registry row without a live process, and a live process without a registry row.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/towerArea: Tower server / agent farm CLI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions