Skip to content

CLI should detect and handle stale pre-rename gateway processes #2

@yourfriendfitz

Description

@yourfriendfitz

Problem

After the engiefamiliar rename (commit 8a1e743), running familiar with no arguments fails with:

Failed to connect to gateway: Gateway auth failed: {"code":"INVALID_REQUEST","message":"invalid connect params: at /client/id: must be equal to constant; at /client/id: must match a schema in anyOf"}

This happens because the old gateway process (clawdbot-gateway) is still running from before the rename. It validates against a JSON Schema that expects the old client ID (engie-ui / clawdbot-ui), but the updated CLI now sends familiar-ui.

Expected Behavior

The CLI (or familiar doctor) should detect stale gateway processes running under old names and either:

  1. Warn the user that an old gateway is running and needs to be restarted
  2. Automatically kill the old process and start the new one

Suggested Implementation

  • In familiar doctor and/or the chat connect flow, scan for processes matching old gateway names (clawdbot-gateway, engie-gateway, etc.)
  • If found, surface a clear message: "Found a stale gateway process (clawdbot-gateway, PID 1553). Run familiar stop && familiar start or kill it manually."
  • Consider adding a --force-restart flag to familiar start that kills any old-named gateway processes before starting
  • familiar status could also flag when the running gateway PID doesn't match the expected process name

Context

Old process names to check for:

  • clawdbot-gateway
  • engie-gateway

Current expected process name should be derived from the updated codebase.

🤖

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions