openclaw - 💡(How to fix) Fix Bug: gateway service env renders Supermemory API key as literal env reference

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

On OpenClaw 2026.5.27 (27ae826), the generated gateway LaunchAgent service environment can persist the Supermemory plugin API key as a literal environment reference instead of a resolved value:

export SUPERMEMORY_OPENCLAW_API_KEY='"$SUPERMEMORY_OPENCLAW_KEY"'

The Supermemory plugin then receives the literal string "$SUPERMEMORY_OPENCLAW_KEY" and fails validation because it does not start with sm_.

This is especially visible after openclaw gateway install, openclaw gateway restart, or an OpenClaw update, because the generated service-env wrapper is overwritten and any local runtime workaround is lost.

Error Message

The generated service env contains:

Root Cause

The Supermemory plugin then receives the literal string "$SUPERMEMORY_OPENCLAW_KEY" and fails validation because it does not start with sm_.

Fix Action

Fix / Workaround

This is especially visible after openclaw gateway install, openclaw gateway restart, or an OpenClaw update, because the generated service-env wrapper is overwritten and any local runtime workaround is lost.

The generated wrapper is also rewritten to the generic wrapper on service install/restart/update, so a manual wrapper workaround that resolves the key from a secret manager is not durable.

Current local workaround:

Code Example

export SUPERMEMORY_OPENCLAW_API_KEY='"$SUPERMEMORY_OPENCLAW_KEY"'

---

{
  "plugins": {
    "entries": {
      "openclaw-supermemory": {
        "enabled": true,
        "config": {
          "apiKey": "${SUPERMEMORY_OPENCLAW_API_KEY}"
        }
      }
    }
  }
}

---

export SUPERMEMORY_OPENCLAW_API_KEY='"$SUPERMEMORY_OPENCLAW_KEY"'

---

[plugins] openclaw-supermemory failed during register ... Error: invalid API key: key must start with sm_ prefix

---

plugins.entries.openclaw-supermemory.config.apiKey: invalid config: must be string
RAW_BUFFERClick to expand / collapse

Summary

On OpenClaw 2026.5.27 (27ae826), the generated gateway LaunchAgent service environment can persist the Supermemory plugin API key as a literal environment reference instead of a resolved value:

export SUPERMEMORY_OPENCLAW_API_KEY='"$SUPERMEMORY_OPENCLAW_KEY"'

The Supermemory plugin then receives the literal string "$SUPERMEMORY_OPENCLAW_KEY" and fails validation because it does not start with sm_.

This is especially visible after openclaw gateway install, openclaw gateway restart, or an OpenClaw update, because the generated service-env wrapper is overwritten and any local runtime workaround is lost.

Environment

  • OpenClaw CLI: 2026.5.27 (27ae826)
  • Gateway service: LaunchAgent on macOS
  • Plugin: @supermemory/[email protected]
  • Config shape:
{
  "plugins": {
    "entries": {
      "openclaw-supermemory": {
        "enabled": true,
        "config": {
          "apiKey": "${SUPERMEMORY_OPENCLAW_API_KEY}"
        }
      }
    }
  }
}

Observed behavior

The generated service env contains:

export SUPERMEMORY_OPENCLAW_API_KEY='"$SUPERMEMORY_OPENCLAW_KEY"'

CLI/plugin startup then reports:

[plugins] openclaw-supermemory failed during register ... Error: invalid API key: key must start with sm_ prefix

The generated wrapper is also rewritten to the generic wrapper on service install/restart/update, so a manual wrapper workaround that resolves the key from a secret manager is not durable.

Expected behavior

One of these should happen:

  1. Service env rendering should resolve or omit nested env references rather than persisting them as literal quoted strings.
  2. The installer should preserve an already-valid durable value source for SUPERMEMORY_OPENCLAW_API_KEY.
  3. The Supermemory plugin config schema should support SecretRef/object-style secrets again, so the API key does not need to be converted into a plaintext string or brittle service env value.

Additional notes

Attempting the older SecretRef-style plugin config no longer validates on 2026.5.27; plugins.entries.openclaw-supermemory.config.apiKey is rejected unless it is a string:

plugins.entries.openclaw-supermemory.config.apiKey: invalid config: must be string

Current local workaround:

  • Keep apiKey as "${SUPERMEMORY_OPENCLAW_API_KEY}".
  • Modify the generated gateway env wrapper to detect the bad literal value and resolve the real key at runtime from the configured secret manager.

That workaround works, but it is overwritten by generated service-env updates.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

One of these should happen:

  1. Service env rendering should resolve or omit nested env references rather than persisting them as literal quoted strings.
  2. The installer should preserve an already-valid durable value source for SUPERMEMORY_OPENCLAW_API_KEY.
  3. The Supermemory plugin config schema should support SecretRef/object-style secrets again, so the API key does not need to be converted into a plaintext string or brittle service env value.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Bug: gateway service env renders Supermemory API key as literal env reference