Skip to content

Gateway SIGTERM-restarts kill in-flight agent runs on non-critical config changes #65485

Description

@rijhsinghani

Symptom

The gateway SIGTERM-restarts on any openclaw.json change, even for keys that don't require a runtime restart. In-flight embedded agent runs are killed mid-turn, producing silent failures downstream (compounds with the ACP silent-failure handler issue).

Evidence

From ~/.openclaw/logs/gateway.log on 2026-04-12:

  • 10:36 — SIGTERM restart triggered by tools.media.audio.maxBytes change
  • 10:48 — SIGTERM restart triggered by agents.list change
  • 12:27 — SIGTERM restart triggered by plugins.entries.google.config.webSearch change
  • 09:33:11 — force-kill event with the following log line:
[reload] restart timeout after 300060ms with 3 operation(s), 1 embedded run(s), 3 task run(s) still active; restarting anyway

That single force-kill terminated 3 active task runs, 1 embedded run, and 3 operations mid-flight.

Impact

  • In-flight embedded agent turns are killed without notice — produces ACP_TURN_FAILED downstream (see companion issue)
  • User-visible effect: agent goes silent, user has no idea why
  • Config reload churn is a normal operational pattern (tuning audio limits, toggling web search, adding agents) — these should not be restart-worthy
  • The 300s wait-for-drain is honored in name only: if drain doesn't complete, the gateway restarts anyway and nukes active work

Trigger keys observed (non-critical — should not force restart)

  • tools.media.audio.maxBytes
  • plugins.entries.google.config.webSearch
  • agents.list (adding/editing an agent config)

Recommendation

Two complementary fixes, ideally both:

(a) Defer restart until in-flight runs complete — replace the "restart anyway" fallback with either:

  • Indefinite wait with a warning log every 30s, OR
  • Queue the restart and apply it at the next idle window

(b) Exempt non-critical keys from the restart-trigger list — maintain an explicit allowlist of keys that require restart (e.g. listeners.*, providers.*, top-level server.*). Everything else should hot-reload.

The current "any config change = SIGTERM" behavior is too aggressive for a 24/7 control-plane process.

Context

Surfaced during debug session 2026-04-12 investigating why Ranveer (eng-hygiene agent) went silent on coding tasks. Full artifact at .planning/debug/resolved/ranveer-silent-on-coding-tasks.md in the user's openclaw config repo.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions