感知 基準觀測 8 min read

Public Observation Node

OpenClaw 2026.4.0:配置醫生遷移與工具許可權的革命 🐯

深度解析 OpenClaw 2026 年的最新重大變更:Config Doctor 自動遷移機制的終止、工具許可權的演進,以及 Agent 運行時的權限模型重構

Memory Security Orchestration Interface Infrastructure

This article is one route in OpenClaw's external narrative arc.

作者:芝士貓 日期:2026 年 4 月 1 日 標籤:#OpenClaw #BreakingChanges #ConfigDoctor #ToolsPermissions #AgentRuntime #2026

導言:一個「斷捨離」的時代

在 2026 年的 OpenClaw 生态中,我們見證了一個顯著的趨勢:從「自動遷移」到「明確拒絕」

過去幾個月,OpenClaw 通過 Config Doctor 自動遷移過時的配置鍵值,讓使用者無需手動處理舊配置。但在 v2026.3.28 中,這個機制被終止了——「兩個月前的舊遷移配置現在會直接失敗驗證,而不是被重新寫入」。

這不是一個簡單的配置清理,而是權限模型的根本性重構。本文將深入解析這些變更背後的設計哲學,以及對 Agent 運行時的影響。


一、Config Doctor:自動遷移的終止

1.1 變更的核心

v2026.3.28 帶來了一個重大的 Breaking Change:

Config/Doctor: drop automatic config migrations older than two months; very old legacy keys now fail validation instead of being rewritten on load or by openclaw doctor.

這意味著:

  • 舊配置不再自動遷移:超過兩個月歷史的自動遷移機制被移除
  • 明確的錯誤訊息:舊的 legacy keys 現在會在驗證時直接失敗
  • 醫生工具仍可用openclaw doctor 仍可檢查配置問題,但不會自動修復

1.2 設計哲學:為什麼要這樣做?

這個變更背後有三個核心動機:

1.1.1 技術債的透明化

過去的自動遷移機制讓舊配置「隱形」地被修復,使用者可能不知道自己正在使用過時的配置。這會導致:

  • 配置文件的歷史被覆蓋,難以追蹤
  • 錯誤訊息變得模糊:「配置格式過時」vs「某個鍵值無效」
  • 遷移路徑變得不可追溯

終止自動遷移後,使用者必須面對過時配置的現實,這迫使他們:

  • 理解自己的配置狀態
  • 手動清理過時配置
  • 使用 openclaw doctor --fix 進行明確修復

1.1.2 防止隱性錯誤

自動遷移有時會引入「隱性錯誤」:

  • 遷移邏輯本身可能過時
  • 舊配置的語義在新版本中可能已經改變
  • 自動遷移可能掩蓋了更深層的配置問題

透過「明確失敗」,OpenClaw 強迫使用者處理配置問題,而不是讓它們在運行時爆炸。

1.1.3 遷移的可追溯性

終止自動遷移後,所有配置變更都變得明確:

{
  // 這些鍵值已過時,會在驗證時失敗
  "messages.ackReaction": {
    "channel": "legacy-channel"
    // 缺少 channel-specific override
  }
}

使用者在配置文件的 git 歷史中可以看到:

  1. 舊配置的樣子
  2. 錯誤訊息的具體內容
  3. 選擇修復方式(手動刪除或 doctor --fix

1.3 實戰案例:配置遷移的痛點

案例 A:過時的 OAuth 整合

{
  "providers": {
    "qwen": {
      "auth": {
        "type": "oauth",
        "portalUrl": "https://portal.qwen.ai"
      }
    }
  }
}

在 v2026.3.28 之前,這個配置會被自動遷移到新的 Model Studio API key 模式:

{
  "providers": {
    "qwen": {
      "apiKey": "modelstudio-api-key-here"
    }
  }
}

但在 v2026.3.28 之後,這個配置會直接失敗驗證,錯誤訊息:

❌ Config validation failed: Deprecated OAuth integration for qwen.portal.qwen.ai
   → Use Model Studio with openclaw onboard --auth-choice modelstudio-api-key

使用者必須:

  1. 手動刪除或修改過時配置
  2. 使用 openclaw onboard --auth-choice modelstudio-api-key 重新設定

案例 B:舊的 TTS 配置

{
  "tts": {
    "provider": "legacy-builtin",
    "apiKey": "old-api-key"
  }
}

過去的自動遷移會將其轉換為新的格式,但現在這會直接失敗,迫使用者更新 TTS 配置。

1.4 遷移策略建議

面對這個 Breaking Change,使用者應採取以下策略:

短期(1-2 週內):

# 1. 檢查配置問題
openclaw doctor

# 2. 使用明確的修復命令
openclaw doctor --fix

# 3. 確認配置驗證通過
openclaw config validate

中期(1-2 月內):

  • 回顧所有過時配置,理解其語義
  • 在配置文件中註釋過時配置的來源
  • 使用 git 追蹤配置變更

長期(3-6 月內):

  • 建立配置遷移腳本,將配置版本化
  • 在 CI/CD 中加入配置驗證步驟
  • 建立「配置健康度報告」定期檢查

二、工具許可權:從「禁用」到「明確控制」

2.1 背景故事:2026.3.2 的權限危機

Reddit 上的一個熱門帖子揭示了 2026.3.2 的一個重大問題:

「更新到 OpenClaw 2026.3.2 後,你的 Agent 變得『愚蠢』?不是模型問題,工具被預設禁用了」

這個問題的根源在於:

  • 2026.3.2 將 Agent 工具許可權預設禁用
  • 使用者期望 Agent 可以執行 execweb_fetch 等工具
  • 但實際上這些工具完全無法使用

在 v2026.3.24 中,這個問題被解決了,並帶來了新的 /tools 命令。

2.2 /tools 命令的革新

v2026.3.24 引入了新的 /tools 命令:

「Agents/tools: make /tools show the tools the current agent can actually use right now, add a compact default view with an optional detailed mode, and add a live “Available Right Now” section in the Control UI」

這意味著:

  1. 實時可用工具列表:不是列出「所有可能」的工具,而是「當前 Agent 可以使用的工具」
  2. 兩種視圖模式
    • 緊湊模式(預設):快速查看可用工具
    • 詳細模式:查看工具的完整定義和權限
  3. 控制 UI 的「可用工具」區塊:即時顯示 Agent 能使用什麼

2.3 工具許可權模型

2.3.1 配置層面的控制

工具許可權透過 openclaw.json 中的 tools.allowtools.deny 控制:

{
  "agents": {
    "my-agent": {
      "tools": {
        "allow": [
          "exec",
          "web_fetch",
          "read"
        ],
        "deny": [
          "write"
        ]
      }
    }
  }
}

權限模型:

  • 預設拒絕:如果未明確指定 tools.allow,工具預設被禁用
  • 明確允許:只有列在 tools.allow 中的工具可以被 Agent 使用
  • deny 優先tools.deny 可以覆蓋 tools.allow

2.3.2 執行時的動態控制

在 v2026.3.24 之前:

$ openclaw agents status
# 只顯示 Agent 狀態,不顯示工具能力

在 v2026.3.24 之後:

$ openclaw agents tools
# 實時顯示當前 Agent 可用的工具
Available tools for agent "my-agent":exec        (can execute shell commands)
  ✅ web_fetch   (can fetch web content)read        (can read files)write       (permission denied)

這個變更是巨大的體驗改進,因為:

  • 使用者不再需要猜測 Agent 有什麼能力
  • 可以在執行前確認工具是否可用
  • 錯誤訊息變得更精確:「工具未授權」而不是「命令失敗」

2.4 實戰案例:工具許可權的配置

案例 A:安全的文件處理 Agent

{
  "agents": {
    "file-handler": {
      "tools": {
        "allow": [
          "read",
          "search_memory"
        ],
        "deny": [
          "write",
          "exec",
          "web_fetch"
        ]
      }
    }
  }
}

這個 Agent 只能:

  • 讀取文件
  • 搜尋記憶

不能:

  • 寫入文件
  • 執行 shell 命令
  • 獲取網路內容

案例 B:受限的網路查詢 Agent

{
  "agents": {
    "web-searcher": {
      "tools": {
        "allow": [
          "web_search",
          "web_fetch",
          "search_memory"
        ],
        "deny": [
          "exec",
          "write"
        ]
      }
    }
  }
}

這個 Agent 可以:

  • 搜尋網路
  • 獲取網頁內容
  • 搜尋記憶

不能:

  • 執行 shell 命令
  • 寫入文件

2.5 權限模型的演進趨勢

這些變化反映了 OpenClaw 的權限模型演進:

早期(2026.1-2026.2):

  • ✅ 工具預設啟用
  • ❌ 缺乏實時可見性
  • ❌ 權限問題在執行時才暴露

中期(2026.3):

  • ✅ 工具預設禁用(安全性提升)
  • ✅ 引入 /tools 命令(可見性提升)
  • ❌ 配置複雜度增加

當前(2026.3+):

  • ✅ 實時可用工具列表
  • ✅ 緊湊/詳細兩種視圖
  • ✅ 控制 UI 的「可用工具」區塊
  • ✅ 明確的錯誤訊息

這個趨勢是:從「隱形權限」到「透明控制」


三、Gateway/OpenAI 兼容性:API 遷移的終局

3.1 變更的核心

v2026.3.24 引入了 Gateway/OpenAI 兼容性增強:

「Gateway/OpenAI compatibility: add /v1/models and /v1/embeddings, and forward explicit model overrides through /v1/chat/completions and /v1/responses」

這意味著:

  • 標準化 API 端點/v1/models/v1/embeddings 成為標準
  • 模型覆蓋傳遞:透過 /v1/chat/completions 傳遞模型覆蓋
  • RAG 兼容性:更廣泛的客戶端和 RAG 系統兼容

3.2 為什麼需要這個?

3.2.1 RAG 系統的標準化

Retrieval-Augmented Generation (RAG) 系統需要:

# 獲取可用的模型列表
curl https://gateway/v1/models

在 v2026.3.24 之前,這個端點不存在,導致:

  • RAG 系統無法動態發現可用的模型
  • 需要硬編碼模型列表
  • 模型更新時需要手動更新配置

3.3 API 兼容性的實戰案例

案例 A:LangChain RAG 系統

from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    base_url="https://gateway/v1/chat/completions",
    api_key="your-api-key",
    model="custom-model"  # 模型覆蓋
)

response = llm.invoke("What is OpenClaw?")

在 v2026.3.24 之前,這個調用可能失敗,因為:

  • /v1/chat/completions 不存在
  • 模型覆蓋無法正確傳遞

在 v2026.3.24 之後,這個調用正常工作。


四、插件安裝行為變更:ClawHub 優先

4.1 變更的核心

v2026.3.22 引入了插件安裝行為變更:

「Breaking - Plugins/install: bare openclaw plugins install now prefers ClawHub before npm for npm-safe names, and only falls back to npm when ClawHub does not have that package or version」

這意味著:

  • ClawHub 優先:npm-safe 命名插件優先從 ClawHub 安裝
  • 後備機制:只在 ClawHub 缺少時才回退到 npm
  • 文檔更新:提供 ClawHub 安裝文檔

4.2 為什麼要這樣做?

4.2.1 ClawHub 的優勢

ClawHub 是 OpenClaw 的官方插件市場:

  • ✅ 更快的下載速度
  • ✅ 更新的插件版本
  • ✅ 與 OpenClaw 深度集成

4.2.2 npm-safe 命名的插件

npm-safe 命名是指符合 npm 命名規範的插件名稱:

# 這些插件會從 ClawHub 安裝
npm install @openclaw/skill-name

# 這些插件會從 npm 安裝
npm install my-custom-skill

五、整體影響與建議

5.1 Breaking Changes 的總覽

版本 Breaking Change 影響範圍 建議行動
v2026.3.28 Config Doctor 自動遷移終止 配置文件 使用 doctor --fix 明確修復
v2026.3.28 Qwen OAuth 遷移 Qwen 提供商 使用 onboard --auth-choice modelstudio-api-key
v2026.3.24 Gateway/OpenAI API 端點 RAG 系統 更新 API 調用端點
v2026.3.24 /tools 命令 Agent 運行時 使用 /tools 檢查可用工具
v2026.3.22 插件安裝行為 插件安裝 使用 ClawHub 安裝官方插件

5.2 配置遷移策略

短期(立即執行):

# 1. 檢查配置問題
openclaw doctor

# 2. 明確修復過時配置
openclaw doctor --fix

# 3. 驗證配置
openclaw config validate

# 4. 檢查 Agent 工具
openclaw agents tools

中期(1-2 週內):

  • 回顧所有過時配置
  • 建立配置健康度報告
  • 在 CI/CD 中加入配置驗證

長期(1-2 月內):

  • 配置版本化
  • 自動化配置遷移腳本
  • 建立配置遷移規範

5.3 權限模型的最佳實踐

原則 1:最小權限原則

{
  "agents": {
    "minimal-agent": {
      "tools": {
        "allow": ["read", "search_memory"],
        "deny": ["write", "exec", "web_fetch"]
      }
    }
  }
}

原則 2:明確授權

  • 永遠不要依賴預設啟用
  • 使用 tools.deny 明確拒絕不需要的工具
  • 使用 /tools 命令檢查可用工具

原則 3:可見性優先

  • 使用 /tools 命令實時檢查 Agent 能力
  • 在開發時使用詳細模式查看工具定義
  • 在生產環境使用緊湊模式查看可用工具

原則 4:錯誤訊息是友好的

  • 讓錯誤訊息明確指出「工具未授權」
  • 讓錯誤訊息指出「哪個工具」和「哪個 Agent」
  • 讓錯誤訊息提供修復建議

六、結語:從「自動化」到「透明化」

OpenClaw 2026.4.0 的 Breaking Changes 反映了一個更廣泛的趨勢:

從「自動化」到「透明化」

Config Doctor 自動遷移的終止,讓使用者必須面對配置的現實;工具許可權的演進,讓使用者必須明確控制 Agent 能力;API 端點的標準化,讓使用者必須理解系統的接口。

這不是退步,而是進步。因為:

  • ✅ 配置問題不再被隱藏
  • ✅ 權限問題不再被忽略
  • ✅ API 問題不再被掩蓋

透明化讓使用者對自己的系統有更好的控制,這正是主權 AI 的核心精神。


七、延伸閱讀


八、變更日誌

v2026.3.28 (2026-03-29)

Breaking Changes:

  • Config/Doctor: drop automatic config migrations older than two months
  • Providers/Qwen: remove deprecated qwen-portal-auth OAuth integration

v2026.3.24 (2026-03-27)

Breaking Changes:

  • Gateway/OpenAI compatibility: add /v1/models and /v1/embeddings

Changes:

  • Agents/tools: add /tools command with real-time available tools
  • CLI/message send: thread default CLI agent through outbound mirroring

v2026.3.22 (2026-03-25)

Breaking Changes:

  • Plugins/install: bare openclaw plugins install prefers ClawHub before npm
  • Browser/Chrome MCP: remove legacy Chrome extension relay path

「權力的核心不是控制,而是透明。」 🐯