Skip to content

[Bug]: Studio GUI overwrites openclaw.json with __OPENCLAW_REDACTED__ placeholders, breaking gateway #13058

@backtime1993

Description

@backtime1993

Bug: Studio GUI overwrites openclaw.json with __OPENCLAW_REDACTED__ placeholders, breaking gateway

Description

Opening OpenClaw Studio causes it to read ~/.openclaw/openclaw.json, redact sensitive fields for display, and then write the redacted values back to disk. This corrupts the config file and prevents the gateway from starting.

Affected fields

All sensitive fields are replaced with the string "__OPENCLAW_REDACTED__":

Field path Original type After Studio overwrite
models.providers.minimax.apiKey string (API key) "__OPENCLAW_REDACTED__"
models.providers.moonshot.apiKey string (API key) "__OPENCLAW_REDACTED__"
models.providers.minimax.models.0.maxTokens number (8192) "__OPENCLAW_REDACTED__" (string!)
models.providers.moonshot.models.0.maxTokens number (8192) "__OPENCLAW_REDACTED__" (string!)
channels.telegram.botToken string (bot token) "__OPENCLAW_REDACTED__"
channels.feishu.appSecret string "__OPENCLAW_REDACTED__"
channels.feishu.accounts.main.appSecret string "__OPENCLAW_REDACTED__"
agents.defaults.memorySearch.remote.apiKey string (API key) "__OPENCLAW_REDACTED__"
skills.entries.nano-banana-pro.apiKey string (API key) "__OPENCLAW_REDACTED__"
tools.web.search.apiKey string (API key) "__OPENCLAW_REDACTED__"

Impact

  1. Gateway fails to start — config validation rejects maxTokens as string instead of number:

    Config validation failed:
    - models.providers.minimax.models.0.maxTokens: Invalid input: expected number, received string
    - models.providers.moonshot.models.0.maxTokens: Invalid input: expected number, received string
    
  2. Telegram channel deadgetMe returns 404 because botToken is a placeholder string

  3. Feishu channel deadfailed to obtain token because appSecret is a placeholder

  4. All model providers broken — API keys are placeholder strings

Steps to Reproduce

  1. Have a working OpenClaw CLI setup with configured API keys, bot tokens, etc.
  2. Open OpenClaw Studio GUI
  3. Close Studio (or just let it run)
  4. Check ~/.openclaw/openclaw.json — all sensitive values are now "__OPENCLAW_REDACTED__"
  5. Gateway crashes on next restart with config validation errors

Expected Behavior

Studio should redact values only in memory/UI display. When writing config back to disk, it must preserve the original values. Alternatively, Studio should not write to openclaw.json at all if it cannot preserve sensitive field values.

Additional Notes

  • The redaction logic doesn't distinguish between data types — it replaces numeric maxTokens: 8192 with string "__OPENCLAW_REDACTED__", causing a type mismatch that fails schema validation.
  • Workaround: restore from backup files (openclaw.json.bak.*) and avoid using Studio GUI.

Environment

  • OpenClaw CLI: v2026.2.9
  • OpenClaw Studio: latest (uninstalled after discovering this bug)
  • OS: macOS (Apple Silicon)
  • Node: v22.22.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions