fix: skip redundant openclaw config + gateway restart when already configured by inmean · Pull Request #53 · aiming-lab/MetaClaw · GitHub
Skip to content

fix: skip redundant openclaw config + gateway restart when already configured - #53

Open
inmean wants to merge 1 commit into
aiming-lab:mainfrom
inmean:main
Open

inmean wants to merge 1 commit into
aiming-lab:mainfrom
inmean:main

Conversation

@inmean

@inmean inmean commented Apr 1, 2026

Copy link
Copy Markdown

Summary

Two changes that together break the gateway restart loop when MetaClaw is already configured.

Root cause

launcher._configure_openclaw() ran openclaw config set + gateway restart unconditionally — even when OpenClaw was already correctly configured. The TypeScript plugin also ran a blocking pip index versions on every restart (~30s timeout).

Changes

  1. launcher.py: Early-exit guard in _configure_openclaw() — skip if agents.defaults.model.primary already contains metaclaw/{model_id}
  2. index.ts: Removed pip index versions spawnSync; when metaclaw is already installed the version check short-circuits before any pip activity

Testing

Verified locally: restart loop broken, metaclaw start exits cleanly when already configured, Telegram and Matrix load normally.

…nfigured

Two changes that together break the gateway restart loop:

1. launcher.py (_configure_openclaw): Add early-exit guard — if
   'agents.defaults.model.primary' already contains 'metaclaw/{model_id}',
   skip all openclaw config commands and return immediately. Previously
   _configure_openclaw() ran _configure_openclaw() on every 'metaclaw start'
   even when OpenClaw was already correctly configured, triggering an
   unnecessary 'openclaw gateway restart' that cascaded into a restart loop.

2. index.ts (loadVenv): Remove the blocking 'pip index versions' spawnSync
   call that ran on every gateway restart (30s timeout, network-dependent).
   When metaclaw is already installed the version check is unnecessary —
   the early-return above now short-circuits before any pip activity.
@richard-peng-xia

Copy link
Copy Markdown
Contributor

@lanxevo3 lanxevo3 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by Rollo scanner lane per Ragnar executive decision

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants