Skip to content

fix(openclaw): avoid /dev/tty crash in --non-interactive and handle allowlist bootstrap#1310

Open
nillin wants to merge 1 commit intothedotmack:mainfrom
nillin:fix/openclaw-installer-headless-allowlist
Open

fix(openclaw): avoid /dev/tty crash in --non-interactive and handle allowlist bootstrap#1310
nillin wants to merge 1 commit intothedotmack:mainfrom
nillin:fix/openclaw-installer-headless-allowlist

Conversation

@nillin
Copy link

@nillin nillin commented Mar 9, 2026

Summary

This patch fixes two installer failure modes seen during --upgrade on OpenClaw:

  1. Headless/non-TTY installs still touched /dev/tty and failed with:
    main: line 85: /dev/tty: No such device or address
  2. Config bootstrap deadlock when plugins.allow already includes claude-mem but the plugin is not installed yet.
    OpenClaw validates config before plugins install can complete, so install fails with:
    plugins.allow: plugin not found: claude-mem

Changes

  • setup_tty() now short-circuits when --non-interactive is set (never opens /dev/tty).
  • Added safer /dev/tty open path (-r /dev/tty + guarded exec).
  • During stale-plugin cleanup before install, also remove claude-mem from plugins.allow temporarily.
  • Restore plugins.allow entry after successful install+enable if it existed previously.

Why this is safe

  • Allowlist handling is round-trip: only restored when it existed originally.
  • Existing plugin config restoration logic (entries.claude-mem.config) remains intact.
  • Interactive behavior is unchanged for normal TTY sessions.

Validation

  • bash -n openclaw/install.sh passes.
  • Reproduced both failures on a live OpenClaw host, applied this logic, and confirmed upgrade completes and memory plugin loads.

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.

1 participant