Skip to content

feat: support OPENCLAW_CONFIG_PATH to persist openclaw.json on PVC #1174

@mahu888

Description

@mahu888

Problem Statement

Currently openclaw.json is stored in /sandbox/.openclaw/, which lives in the container writable layer. This means every pod restart wipes the config, requiring manual re-application via kubectl exec each time.

The PVC at /sandbox/.openclaw-data/ survives pod restarts — all agent workspaces, credentials, and memory already live there. The config file should too.

Without a fix, users must maintain a separate restore script that re-applies the full config after every restart, which is error-prone and defeats the purpose of a persistent setup.

Proposed Design

Respect an OPENCLAW_CONFIG_PATH environment variable (similar to the existing --profile flag) that lets users redirect where openclaw.json is read from and written to.

In NemoClaw, the gateway startup command in nemoclaw-start.sh would set:

OPENCLAW_CONFIG_PATH=/sandbox/.openclaw-data/openclaw.json \
  gosu gateway openclaw gateway run

This way the config lives on the PVC and survives pod restarts with zero manual intervention.

The existing --profile mechanism already isolates OPENCLAW_STATE_DIR and OPENCLAW_CONFIG_PATH — exposing OPENCLAW_CONFIG_PATH as a standalone env var (or ensuring NemoClaw sets it) is a minimal change with high impact.

Alternatives Considered

Symlink /sandbox/.openclaw/openclaw.json → PVC path: The symlink itself lives in the container writable layer and disappears on pod restart — doesn't solve the problem.

Copy config to PVC on every restart via init container: Works but requires orchestration changes and still needs the config to be seeded somewhere.

Use --profile flag: Creates a full isolated state dir, which is overkill if only the config path needs to be redirected. Also not easily injectable into the existing NemoClaw startup flow.

Category

enhancement: feature

Checklist

  • I searched existing issues and this is not a duplicate
  • This is a design proposal, not a "please build this" request

Metadata

Metadata

Assignees

No one assigned

    Labels

    Integration: OpenClawSupport for OpenClawNemoClaw CLIUse this label to identify issues with the NemoClaw command-line interface (CLI).enhancementNew feature or requestenhancement: featureUse this label to identify requests for new capabilities in NemoClaw.enhancement: integrationPRs or issues proposing integration of a third-party product or service into NemoClaw.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions