Skip to content

Feature: Hot-reload bindings without gateway restart (SIGUSR2 / config.reload-bindings) #27706

Description

@ericsr

Summary

When bindings are added or removed via config.patch, the gateway always performs a full restart. For use cases that dynamically create and destroy agent-channel bindings at runtime (e.g., task channel orchestration), this causes unnecessary downtime on every routing change.

Use Case

We're building a Discord Channel Orchestrator that:

  1. Creates Discord channels on-demand (e.g., #task-tesla-research, #task-audi-research)
  2. Binds a specific agent to each new channel via config.patch
  3. Archives channels and removes bindings when tasks are complete

This pattern requires a binding update per task batch. Each update triggers a ~3-5 second gateway restart. For infrequent use, this is tolerable. At higher frequency (multiple parallel task batches per day), the restart overhead becomes disruptive — especially since existing sessions must reconnect after each restart.

Proposed Solution

Add a hot binding reload path: a signal or API call that causes the gateway to re-read the bindings[] array from config and update its routing table without restarting.

Option A — SIGUSR2 for binding reload

# Send SIGUSR2 to reload only the bindings section
kill -USR2 
# or
openclaw gateway reload-bindings

Option B — Dedicated config.reload method

openclaw gateway call config.reload --params '{sections: [bindings]}'

This would:

  1. Re-read the config file on disk
  2. Diff the bindings[] array against the current in-memory state
  3. Update routing tables atomically
  4. Return { ok: true, added: 2, removed: 0 }
  5. No restart. No session disruption. No reconnect.

Why This Is Safe

Bindings are routing rules only — they don't affect model config, auth, channels, or agent definitions. Updating them at runtime doesn't require tearing down sessions or reconnecting to providers. It's a pure in-memory routing table update.

A failed binding reload (invalid config) should return an error and leave existing bindings intact, with no gateway restart.

What Would Change in config.patch

Add an optional field restartRequired to the response:

{
  "ok": true,
  "restart": { "required": false, "reason": "bindings-only-change" }
}

Or expose a config.patch --no-restart flag for binding-only patches that the caller can use when they know a restart isn't needed.

Environment

  • OpenClaw version: 2026.2.25
  • OS: macOS (arm64), Darwin 25.3.0
  • Channel: Discord (guild channels)

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions