#我的龍蝦壞了
1 messages · Page 1 of 1 (latest)
這個錯誤意思很單純:你目前設定的 model id(google/gemini-2-0-flash-preview / google/gemini-2.0-flash-preview)在你正在用的 Google 端點上 不存在,所以 gateway 送出請求直接被回 model_not_found,兩個 fallback 都掛了就變成 All models failed。
建議你照這個順序排查/修:
- 先貼一下版本(很重要,模型 catalog/命名常跟版本有關)
openclaw --version
- 看你目前到底解析到哪個 provider/baseUrl、以及 primary/fallback 是什麼
openclaw models status
- 列出你這台機器「google provider」可用的模型清單(用清單裡的 精確字串 來設定)
openclaw models list --all --provider google
# 或想要一行一個更好讀:
openclaw models list --all --provider google --plain
- 從清單選一個存在的,直接用 CLI 設成預設(比手改 config 安全)
openclaw models set google/<從 list 裡複製的model-id>
- 如果你有設定
agents.defaults.models(模型 allowlist),記得把你選的那個也加進 allowlist,不然會變成「Model is not allowed」的另一種卡死情況(這點在 models doc 有寫)。
如果你跑完第 2 步的 models status,把輸出(請先把 API key/token 打馬賽克)貼上來,我可以幫你看是:
- 單純 model 名稱打錯 / 過期(最常見),還是
- 你用的是不同 Google API 模式(AI Studio vs Vertex / 不同 baseUrl),導致同名模型不可用。
相關文件(Models CLI):https://docs.openclaw.ai/concepts/models
(修好了的話,也麻煩把解法那則訊息右鍵 → Apps → ✅ Mark Solution,讓 Answer Overflow 能收錄。)
Restarted LaunchAgent: gui/501/ai.openclaw.gateway
steve@renbaixuedeMacBook-Air ~ % openclaw --version
2026.3.2
steve@renbaixuedeMacBook-Air ~ %
steve@renbaixuedeMacBook-Air ~ % openclaw models status
🦞 OpenClaw 2026.3.2 (85377a2) — I'm not AI-powered, I'm AI-possessed. Big difference.
Config : ~/.openclaw/openclaw.json
Agent dir : ~/.openclaw/agents/main/agent
Default : google/gemini-3-pro-preview
Fallbacks (0) : -
Image model : -
Image fallbacks (0): -
Aliases (1) : Gemini -> google/gemini-3-pro-preview
Configured models (1): google/gemini-3-pro-preview
Auth overview
Auth store : ~/.openclaw/agents/main/agent/auth-profiles.json
Shell env : off
Providers w/ OAuth/tokens (0): -
- google effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=0, api_key=1) | google:default=AIzaSyD9...RXlqKvrw | env=AIzaSyD9...RXlqKvrw | source=env: GEMINI_API_KEY
OAuth/token status
- none
steve@renbaixuedeMacBook-Air ~ %
但我是改成2.0 flash 他沒改到
你這份輸出其實很關鍵:你現在的「全域預設模型」根本還是 google/gemini-3-pro-preview,所以你說的「我改成 2.0 flash 但他沒改到」通常是下面兩種情況之一:
A) 你改的是「某個對話/session 的 /model」,不是改全域預設
openclaw models status顯示的是 config 層級的預設(global default)- 你在 Discord/Web UI 裡切的 model,很多時候是 只影響那個對話,不會反映在
openclaw models status
想確認目前那個 Discord 對話到底用哪個模型:在那個 thread 裡跑:
/model status(或/model打開 picker 看目前選到哪個)
B) 你改錯 config 檔案 / 沒有真的寫進 OpenClaw 讀的那一份
你這裡顯示 OpenClaw 讀的是:
Config : ~/.openclaw/openclaw.json
如果你去改了 openclaw.json5 或別的檔,CLI 當然不會變。
正確把預設改成 2.0 flash(建議做法)
先不要用「猜的 model 名稱」(你之前的 *-preview 就是 Google 端點不認才炸掉)。請用清單裡存在的精確 ID:
- 列出 google provider 可用模型(全 catalog)
openclaw models list --all --provider google --plain
- 從輸出裡找 flash(擇一)
openclaw models list --all --provider google --plain | grep -i flash
- 用清單裡的那個 精確字串 設為預設
openclaw models set google/<那個model-id>
- 重啟 gateway(你用 LaunchAgent 的話這步很重要)
openclaw gateway restart
你把第 1/2 步 grep 出來那幾行貼上來就好(不用貼任何 key),我可以跟你說該選哪個字串,避免再踩到 model_not_found。
steve@renbaixuedeMacBook-Air ~ % openclaw models list --all --provider google --plain
🦞 OpenClaw 2026.3.2 (85377a2) — Open source means you can see exactly how I judge your config.
google/gemini-1.5-flash
google/gemini-1.5-flash-8b
google/gemini-1.5-pro
google/gemini-2.0-flash
google/gemini-2.0-flash-lite
google/gemini-2.5-flash
google/gemini-2.5-flash-lite
google/gemini-2.5-flash-lite-preview-06-17
google/gemini-2.5-flash-lite-preview-09-2025
google/gemini-2.5-flash-preview-04-17
google/gemini-2.5-flash-preview-05-20
google/gemini-2.5-flash-preview-09-2025
google/gemini-2.5-pro
google/gemini-2.5-pro-preview-05-06
google/gemini-2.5-pro-preview-06-05
google/gemini-3-flash-preview
google/gemini-3-pro-preview
google/gemini-3.1-pro-preview
google/gemini-3.1-pro-preview-customtools
google/gemini-flash-latest
google/gemini-flash-lite-latest
google/gemini-live-2.5-flash
google/gemini-live-2.5-flash-preview-native-audio
steve@renbaixuedeMacBook-Air ~ %
steve@renbaixuedeMacBook-Air ~ % openclaw models list --all --provider google --plain | grep -i flash
google/gemini-1.5-flash
google/gemini-1.5-flash-8b
google/gemini-2.0-flash
google/gemini-2.0-flash-lite
google/gemini-2.5-flash
google/gemini-2.5-flash-lite
google/gemini-2.5-flash-lite-preview-06-17
google/gemini-2.5-flash-lite-preview-09-2025
google/gemini-2.5-flash-preview-04-17
google/gemini-2.5-flash-preview-05-20
google/gemini-2.5-flash-preview-09-2025
google/gemini-3-flash-preview
google/gemini-flash-latest
google/gemini-flash-lite-latest
google/gemini-live-2.5-flash
google/gemini-live-2.5-flash-preview-native-audio
steve@renbaixuedeMacBook-Air ~ %
清單很清楚了:你之前用的 google/gemini-2.0-flash-preview / google/gemini-2-0-flash-preview 真的不存在,所以才會 model_not_found。
你要的「2.0 flash」正確 ID 是:
google/gemini-2.0-flash
(如果想更省/更快:google/gemini-2.0-flash-lite也在清單裡)
改「全域預設」(建議)
openclaw models set google/gemini-2.0-flash
openclaw gateway restart
openclaw models status
確認 Default : google/gemini-2.0-flash
只改「這個 Discord thread/對話」的模型
在那個 thread 裡用:
/model google/gemini-2.0-flash
(你之前那個對話可能被 session override 卡在不存在的 preview model,所以用 /model ... 直接覆蓋掉最乾淨。)
如果你做完後 web UI 還是顯示用舊的 model,貼一下新的 openclaw models status 我再幫你看是不是還有 session override 或 allowlist 沒更新。
Restarted LaunchAgent: gui/501/ai.openclaw.gateway
🦞 OpenClaw 2026.3.2 (85377a2) — Deployed locally, trusted globally, debugged eternally.
Config : ~/.openclaw/openclaw.json
Agent dir : ~/.openclaw/agents/main/agent
Default : google/gemini-2.0-flash
Fallbacks (0) : -
Image model : -
Image fallbacks (0): -
Aliases (1) : Gemini -> google/gemini-3-pro-preview
Configured models (2): google/gemini-3-pro-preview, google/gemini-2.0-flash
Auth overview
Auth store : ~/.openclaw/agents/main/agent/auth-profiles.json
Shell env : off
Providers w/ OAuth/tokens (0): -
- google effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=0, api_key=1) | google:default=AIzaSyD9...RXlqKvrw | env=AIzaSyD9...RXlqKvrw | source=env: GEMINI_API_KEY
OAuth/token status
- none
這份 models status 看起來就對了:現在 Default 已經是 google/gemini-2.0-flash,而且 Configured models 也已經包含它(所以不是「改了沒寫進 config」的問題了)。
接下來你可以這樣驗證/收尾:
-
直接回到 Web UI / Discord thread 再送一則訊息,應該就不會再噴
model_not_found。
如果「同一個舊對話」還是一直用那個不存在的*-preview,那代表那個 session 之前被覆寫過模型(session override 會黏著),在該 thread 裡跑一次:
/model google/gemini-2.0-flash
或乾脆開一個新對話最乾淨。 -
(可選)你現在 alias
Gemini還指到舊的gemini-3-pro-preview。如果你想讓Geminialias 也跟著變成 2.0 flash:
openclaw models aliases remove Gemini
openclaw models aliases add Gemini google/gemini-2.0-flash
如果你確認訊息能正常回覆了,也麻煩把解法那則訊息 Mark Solution 一下,方便後面的人搜到。
網頁裡面這樣
[Historical context: a different model called tool "exec" with arguments: {
"command": "ps aux | grep -E 'auto_trade_loop|trading_sim|weather_warfare' | grep -v grep"
}. Do not mimic this format - use proper function calling.]
那段「Historical context: a different model called tool "exec" …」不是你現在該去跑的指令,也不是你設定模型的錯誤本體——看起來是 Dashboard/Web UI 在顯示某次對話裡的「原始/除錯上下文」(或是之前某個模型曾經嘗試做 tool call,結果被當成純文字記錄下來)。
重點:
- 不要照那段文字去執行任何 command(那就是典型的 prompt injection/雜訊範例)。
- 如果你現在模型已經改成
google/gemini-2.0-flash,但同一個舊 session 還一直顯示這些「歷史上下文」:
開一個新對話/session 最乾淨(舊 session 可能黏著之前的 override/垃圾上下文)。 - 想確認 gateway 真的有沒有跑過那個指令:用
openclaw logs --follow搜一下那段ps aux | grep ...,只有在 logs 出現 tool 執行紀錄/結果時才代表真的有跑;單純出現在 UI 的 “Historical context” 不代表有執行。
如果你願意,貼一張那個 Web UI 畫面的截圖(把任何 token/key 馬賽克),我可以更精準判斷是「debug 視圖正常顯示」還是「訊息被寫進 session store 造成污染」;後者的話就值得開 GitHub issue 了。
所以現在是為什麼以及該怎麼做呢
原因其實分兩段:
1) 一開始為什麼會掛?
因為你把模型設成了 不存在的 ID:
google/gemini-2.0-flash-preview(以及2-0那個拼法)
Google 端點不認這些名字,就回:
model_not_found
所以 OpenClaw 兩個候選模型都失敗 → Web UI 才會顯示 “Agent failed before reply: All models failed”。
你現在已經把預設改成清單裡真的存在的:
google/gemini-2.0-flash
這部分已經修好了(你models status也證明 Default 是對的)。
2) 那 Web UI 裡的「Historical context / exec …」是什麼?為什麼還會看到?
那通常是 舊對話(session)裡殘留的「原始上下文 / 除錯訊息」或之前 session 覆寫的模型設定。它看起來像工具呼叫,但不代表現在真的有執行那條指令;多半只是被顯示出來的歷史文字。
你現在該怎麼做(照順序)
-
開一個全新的對話/session(最重要)
舊 session 可能還黏著「不存在的 preview 模型」或垃圾上下文,所以就算全域 Default 改好了,舊 session 還是會繼續壞。 -
在新對話裡確認模型是對的
- Discord thread:
/model status(或直接/model google/gemini-2.0-flash再保險一次)
-
再送一則最簡單的訊息(例如 “test”)看會不會正常回覆。
-
如果新對話還是失敗:貼「最新一次」失敗當下的 logs(不要貼 key)
openclaw logs --follow
照你現在的狀態,我預期 開新 session 後就會正常。如果你回我「新 session 仍然看到同樣的 Historical context」或仍然不回覆,我就會請你貼那段 logs,因為那就比較像是 Dashboard 的顯示/Session store 汙染 bug,值得開 GitHub issue。
56 info gateway/channels/telegram {"subsystem":"gateway/channels/telegram"} [default] starting provider (@KaiZen_Control_bot)
13:29:04 debug agent/embedded {"subsystem":"agent/embedded"} embedded run agent end: runId=ddedd8bf-09cc-4e7d-87f9-6575560ce417 isError=false
13:29:04 debug agent/embedded {"subsystem":"agent/embedded"} embedded run prompt end: runId=ddedd8bf-09cc-4e7d-87f9-6575560ce417 sessionId=763884ae-6cdf-4aa9-bd69-71d51a5238ea durationMs=9360
13:29:04 debug diagnostic {"subsystem":"diagnostic"} session state: sessionId=763884ae-6cdf-4aa9-bd69-71d51a5238ea sessionKey=agent:main:main prev=processing new=idle reason="run_completed" queueDepth=0
13:29:04 debug diagnostic {"subsystem":"diagnostic"} run cleared: sessionId=763884ae-6cdf-4aa9-bd69-71d51a5238ea totalActive=0
13:29:04 debug agent/embedded {"subsystem":"agent/embedded"} embedded run done: runId=ddedd8bf-09cc-4e7d-87f9-6575560ce417 sessionId=763884ae-6cdf-4aa9-bd69-71d51a5238ea durationMs=9538 aborted=false
13:29:04 debug diagnostic {"subsystem":"diagnostic"} lane task done: lane=main durationMs=9541 active=0 queued=0
13:29:04 debug diagnostic {"subsystem":"diagnostic"} lane task done: lane=session:agent:main:main durationMs=9544 active=0 queued=0
13:39:33 info telegram/network {"subsystem":"telegram/network"} autoSelectFamily=false (config)
13:39:33 warn telegram/network {"subsystem":"telegram/network"} fetch fallback: forcing autoSelectFamily=false + dnsResultOrder=ipv4first
13:42:29 warn telegram/network {"subsystem":"telegram/network"} fetch fallback: forcing autoSelectFamily=false + dnsResultOrder=ipv4first
Log tail truncated (increase --max-bytes).
13:47:40 info gateway/ws {"subsystem":"gateway/ws"} ⇄ res ✓ chat.history 52ms conn=bc37bb1c…9353 id=c460f7ea…90b2
你貼的這段 logs 其實沒有再出現 model_not_found / All models failed,而且還明確顯示那次 agent run 是成功的:
embedded run agent end ... isError=false- session 也從
processing → idle,原因是run_completed
所以「模型名稱打錯導致直接死掉」那個問題,看起來已經解了(跟你把 Default 改成 google/gemini-2.0-flash 一致)。
你現在這段 logs 唯一比較醒目的,是 Telegram 網路層的 warning:
telegram/network fetch fallback ... dnsResultOrder=ipv4first
這通常代表 Telegram 連線/DNS/IPv6 路徑不太穩(不一定會讓整個系統壞,但可能造成 Telegram 收發延遲或偶發失敗)。
但你現在「到底卡在哪裡」我需要你確認一件事
你現在是:
- Web UI 發訊息沒回覆?
還是 - Telegram 發訊息沒回覆?
還是 - 其實都能回,只是 Web UI 還在顯示「之前那則 All models failed 的歷史訊息」?
因為你貼的 logs 片段裡只有 chat.history ✓(代表 UI 拉歷史成功),沒有看到你「送出一則新訊息」之後的錯誤。
下一步怎麼做(請照這個抓到關鍵 log)
- 開兩個終端機分頁:
- A:跑 logs(加大截斷上限)
openclaw logs --follow --max-bytes 200000 - B:去你正在用的地方(Web UI 或 Telegram)送一則新的 test 訊息
- 把 A 分頁裡「從你送出 test 前 5 秒到後 10 秒」那段貼上來(尤其是含
error/llm/send/telegram的行)。
如果你回覆我:「現在 Web UI/Telegram 送 test 完全沒反應」,我就能用那段同步的 logs 判斷到底是:
- 回覆其實生成了但送不出去(常見:Telegram 網路/權限/allowFrom),還是
- 回覆根本沒跑到模型(會有另一種錯誤訊號),還是
- 只是 UI 顯示舊的歷史錯誤,但新訊息其實正常。
13:49:11 debug agent/embedded {"subsystem":"agent/embedded"} embedded run prompt start: runId=7e755ec3-3150-4afb-b92e-9a67ae1f698e sessionId=763884ae-6cdf-4aa9-bd69-71d51a5238ea
13:49:11 debug agent/embedded {"subsystem":"agent/embedded"} [context-diag] pre-prompt: sessionKey=agent:main:main messages=455 roleCounts=assistant:221,toolResult:142,user:92 historyTextChars=1050351 maxMessageTextChars=80802 historyImageBlocks=0 systemPromptChars=28363 promptChars=143 promptImages=0 provider=google/gemini-3-pro-preview sessionFile=/Users/steve/.openclaw/agents/main/sessions/763884ae-6cdf-4aa9-bd69-71d51a5238ea.jsonl
13:49:11 debug agent/embedded {"subsystem":"agent/embedded"} embedded run agent start: runId=7e755ec3-3150-4afb-b92e-9a67ae1f698e
13:49:22 debug agent/embedded {"subsystem":"agent/embedded"} embedded run agent end: runId=7e755ec3-3150-4afb-b92e-9a67ae1f698e isError=false
13:49:22 debug agent/embedded {"subsystem":"agent/embedded"} embedded run prompt end: runId=7e755ec3-3150-4afb-b92e-9a67ae1f698e sessionId=763884ae-6cdf-4aa9-bd69-71d51a5238ea durationMs=11507
13:49:22 debug diagnostic {"subsystem":"diagnostic"} session state: sessionId=763884ae-6cdf-4aa9-bd69-71d51a5238ea sessionKey=agent:main:main prev=processing new=idle reason="run_completed" queueDepth=0
13:49:22 debug diagnostic {"subsystem":"diagnostic"} run cleared: sessionId=763884ae-6cdf-4aa9-bd69-71d51a5238ea totalActive=0
13:49:22 debug agent/embedded {"subsystem":"agent/embedded"} embedded run done: runId=7e755ec3-3150-4afb-b92e-9a67ae1f698e sessionId=763884ae-6cdf-4aa9-bd69-71d51a5238ea durationMs=11733 aborted=false
13:49:22 debug diagnostic {"subsystem":"diagnostic"} lane task done: lane=main durationMs=11738 active=0 queued=0
13:49:22 debug diagnostic {"subsystem":"diagnostic"} lane task done: lane=session:agent:main:main durationMs=11740 active=0 queued=0
這樣嗎
對,這段就是我想看的「送出訊息那一刻」的 log,而且它也直接暴露了你現在卡住的兩個重點:
1) 你這個 session 仍然在用 google/gemini-3-pro-preview
log 裡寫得很明白:
provider=google/gemini-3-pro-previewsessionId=763884ae...(同一個舊 session)
所以就算你全域 Default 已經改成 google/gemini-2.0-flash,舊對話/session 可能有「模型覆寫」(session override),會繼續用它自己記住的 model。
你要讓它用 2.0 flash:
- 在「同一個對話」裡用
/model google/gemini-2.0-flash覆蓋掉 - 或更簡單:開一個全新的對話/session(新 session 會吃你的 Default)
2) 你這個 session 的歷史超級大(很容易出怪問題)
同一行也顯示:
messages=455historyTextChars=1050351(歷史文字超過 100 萬字元)
這種等級的歷史,很容易造成:
- 模型上下文被大量截斷、行為怪
- Web UI 顯示/載入變慢
- 看起來「有跑但你覺得沒回」的錯覺
你現在該怎麼做(最有效)
- 開新 session,然後丟一句
test(新 session 應該就會用google/gemini-2.0-flash) - 如果你一定要救舊 session:在舊 session 先跑一次
/model google/gemini-2.0-flash
做完後如果你再貼一次同樣的 [context-diag] pre-prompt 那行,我可以幫你確認它是不是已經切到 gemini-2.0-flash。
怎麼開一個新的session?
在 OpenClaw 裡「開新 session」最簡單的方法就是用 slash command(獨立一則訊息送出):
在同一個 Discord thread / WebChat 直接送:
-
開全新 session(清空上下文、重新開始)
/new或
/reset -
想順便指定新 session 用的模型(可選):
/new google/gemini-2.0-flash
送出後它會回一則確認訊息,之後你再打 test 就會用全新的 session(不會再背著你那個 100 萬字元的歷史)。
文件在這: https://docs.openclaw.ai/tools/slash-commands (/reset / /new 那段)
如果你送 /new 它被當成普通文字(沒有回確認),跟我說一下你是在 Discord 還是 Web UI 送的,我再帶你檢查 command 是否有被允許/註冊。
不行他傳new/reset
LM error: { "error": { "code": 404, "message": "This model models/gemini-2.0-flash is no longer available to new users. Please update your code to use a newer model for the latest features and improvements.", "status": "NOT_F...
一樣這樣
懂了,這次不是 OpenClaw 的問題了,是 Google 那邊把 models/gemini-2.0-flash 對「新用戶 / 新專案」關掉了。
你看到的錯誤:
404 ... This model models/gemini-2.0-flash is no longer available to new users ...
代表就算 openclaw models list 還列得出這個 ID,你的 GEMINI_API_KEY 也沒有權限再用它(或 Google 已不再提供給新 key)。
你該怎麼做(直接換成你 key 可用的較新模型)
從你剛剛列出的清單裡,我會先試這種「不容易被下架、官方會滾動更新」的:
- 把預設模型改成
google/gemini-flash-latest:
openclaw models set google/gemini-flash-latest
openclaw gateway restart
openclaw models status
- 然後回到聊天(Web UI/Discord)再開新 session:
/new
建議:順手加 fallback,避免再 “All models failed”
例如加一個較新的 flash、再加一個舊一點的當保底(都在你清單裡):
openclaw models fallbacks add google/gemini-2.5-flash
openclaw models fallbacks add google/gemini-1.5-flash
openclaw gateway restart
如果你照做後還報「not available / 404」,把那次錯誤完整貼出來(含它說的是哪個 model id),我再跟你一起把「你這個 key 真的能用的 model」鎖定下來。
LLM error: { "error": { "code": 404, "message": "This model models/gemini-2.0-flash is no longer available to new users. Please update your code to use a newer model for the latest features and improvements.", "status": "NOT_F...
現在是上面出現
然後不會回話
你現在這個狀況「不會回話」的原因就是:每次要回覆時都去呼叫 models/gemini-2.0-flash,但 Google 回 404 拒絕,所以整個回覆流程在模型階段就中斷了。
重點是:你目前「正在用的 session / 預設」還是指到 google/gemini-2.0-flash(不管是 default 或 session override),所以才一直重複同一個 404。
先把它救回來(不用等你改好全域設定)
在你正在用的那個聊天介面(Web UI 或 Discord thread),直接送這個當成獨立一則訊息:
/new google/gemini-flash-latest
這會開一個新 session,並且強制用新模型,避開 gemini-2.0-flash,你就應該能重新拿到回覆了。
(如果你不想開新 session,也可以試 /model google/gemini-flash-latest,但你現在舊 session 歷史很肥,我會建議直接 /new ...。)
再把「永久預設」也改掉(不然下次又踩回 2.0)
在終端機跑完後,把輸出貼上來確認:
openclaw models set google/gemini-flash-latest
openclaw gateway restart
openclaw models status
你要看到 Default : google/gemini-flash-latest 才算真正改乾淨。
如果你送了 /new google/gemini-flash-latest 仍然沒有任何「已重置 / 新 session」的確認訊息,跟我說你是在 Web UI 還是 Discord 送的;那就代表 command 沒有被 gateway 當成指令處理(會去檢查 commands.text/授權)。
🦞 OpenClaw 2026.3.2 (85377a2) — I'm the middleware between your ambition and your attention span.
Restarted LaunchAgent: gui/501/ai.openclaw.gateway
🦞 OpenClaw 2026.3.2 (85377a2) — The only open-source project where the mascot could eat the competition.
Config : ~/.openclaw/openclaw.json
Agent dir : ~/.openclaw/agents/main/agent
Default : google/gemini-flash-latest
Fallbacks (2) : google/gemini-2.5-flash, google/gemini-1.5-flash
Image model : -
Image fallbacks (0): -
Aliases (1) : Gemini -> google/gemini-3-pro-preview
Configured models (5): google/gemini-3-pro-preview, google/gemini-2.0-flash, google/gemini-flash-latest, google/gemini-2.5-flash, google/gemini-1.5-flash
Auth overview
Auth store : ~/.openclaw/agents/main/agent/auth-profiles.json
Shell env : off
Providers w/ OAuth/tokens (0): -
- google effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=0, api_key=1) | google:default=AIzaSyD9...RXlqKvrw | env=AIzaSyD9...RXlqKvrw | source=env: GEMINI_API_KEY
OAuth/token status
- none
steve@renbaixuedeMacBook-Air ~ %
很好,這份 models status 現在是健康的:
- Default 已經是
google/gemini-flash-latest - Fallbacks 也有(
2.5-flash、1.5-flash) - 所以之後就算某個模型暫時抽風,也不會直接 “All models failed”。
接下來你只差最後一步:把正在卡住的舊 session 換掉(它可能還記得以前的 model override + 超肥歷史)。
在你正在用的那個聊天介面(Web UI / Discord thread)送:
/new
(保險一點也可以:/new google/gemini-flash-latest)
然後再送一句 test,應該就會正常回覆了。
(可選,但我建議)你現在 alias Gemini 還指到 google/gemini-3-pro-preview,如果你想讓輸入 Gemini 時走新的預設,也可以改掉:
openclaw models aliases remove Gemini
openclaw models aliases add Gemini google/gemini-flash-latest
你跑完 /new 後如果還是「不回話」,貼那次的 openclaw logs --follow(含錯誤那幾行),我再繼續往下抓。
剛剛用/new google/gemini-flash-latest
這個之後好了
但用完以後改那個建議penclaw models aliases remove Gemini
openclaw models aliases add Gemini google/gemini-flash-latest
又壞了
⚠️ Agent failed before reply: All models failed (3): google/gemini-flash-latest: No available auth profile for google (all in cooldown or unavailable). (rate_limit) | google/gemini-2.5-flash: No available auth profile for google (all in cooldown or unavailable). (rate_limit) | google/gemini-1.5-flash: No available auth profile for google (all in cooldown or unavailable). (rate_limit).
Logs: openclaw logs --follow
這次「又壞了」的原因不是 alias 指令本身,而是 Google 把你的 API key 打到 rate limit / quota 了,OpenClaw 看到 rate_limit 後會把該 auth profile 進入 cooldown。你現在只有 1 個 google auth profile,所以一旦它進 cooldown,就會變成:
No available auth profile for google (all in cooldown or unavailable). (rate_limit)
連 fallback model 也沒用(因為 fallback 還是同一把 key)
這是 OpenClaw 的保護機制:避免你一直重試把 provider 打爆。
你現在該怎麼做
-
先停手不要一直重試(一直重試只會把 cooldown 越打越長)
OpenClaw 的 cooldown 是指數退避:1 分鐘 → 5 分鐘 → 25 分鐘 → 最多 1 小時(你越狂按越久)。 -
等個 1–5 分鐘後,再用最短訊息測一次(建議新 session):
/new google/gemini-flash-latest
然後送 test
- 同時用
openclaw logs --follow往前找一下最早那個 429/RESOURCE_EXHAUSTED(通常會有更原始的「你被限流/配額不足」訊息)。
你貼的那段 “All models failed … rate_limit” 其實是「結果摘要」,不是根因細節。
如果這個 rate_limit 很常發生
那就不是設定問題了,是你這把 GEMINI_API_KEY 的 配額/速率上限太低(免費 tier 常見)。你需要:
- 到 Google 那邊提高 quota/開 billing,或
- 加一個別的 provider/key 當 fallback(不然 google 一限流就整個沒得用)。
文件(cooldown 機制解釋):https://docs.openclaw.ai/concepts/model-failover
你如果願意,再貼一次 logs 裡「第一次出現 rate limit 的那幾行」(通常會在摘要之前),我可以幫你判斷是單純 429、還是 credit/quota 直接沒了。
iloverError: No available auth profile for google (all in cooldown or unavailable)."
14:29:50 debug diagnostic {"subsystem":"diagnostic"} lane enqueue: lane=session:agent:main:main queueSize=1
14:29:50 debug diagnostic {"subsystem":"diagnostic"} lane dequeue: lane=session:agent:main:main waitMs=1 queueSize=0
14:29:50 debug diagnostic {"subsystem":"diagnostic"} lane enqueue: lane=main queueSize=1
14:29:50 debug diagnostic {"subsystem":"diagnostic"} lane dequeue: lane=main waitMs=0 queueSize=0
14:29:50 error diagnostic {"subsystem":"diagnostic"} lane task error: lane=main durationMs=73 error="FailoverError: No available auth profile for google (all in cooldown or unavailable)."
14:29:50 error diagnostic {"subsystem":"diagnostic"} lane task error: lane=session:agent:main:main durationMs=74 error="FailoverError: No available auth profile for google (all in cooldown or unavailable)."
14:29:50 error Embedded agent failed before reply: All models failed (3): google/gemini-flash-latest: No available auth profile for google (all in cooldown or unavailable). (rate_limit) | google/gemini-2.5-flash: No available auth profile for google (all in cooldown or unavailable). (rate_limit) | google/gemini-1.5-flash: No available auth profile for google (all in cooldown or unavailable). (rate_limit)
beedfe4e7dab tool=read toolCallId=read_1772807374951_19
14:29:35 debug agent/embedded {"subsystem":"agent/embedded"} embedded run tool start: runId=1f6bb71d-2a54-4328-9c03-beedfe4e7dab tool=read toolCallId=read_1772807374951_20
14:29:35 debug agent/embedded {"subsystem":"agent/embedded"} embedded run tool end: runId=1f6bb71d-2a54-4328-9c03-beedfe4e7dab tool=read toolCallId=read_1772807374951_20
14:29:37 info gateway/ws {"subsystem":"gateway/ws"} webchat disconnected code=1001 reason=n/a conn=6f62586c-025f-48b8-a735-5b1f01b0a55b
14:29:38 info gateway/ws {"subsystem":"gateway/ws"} webchat connected conn=73e500ed-947e-4662-b90b-a03675d22e7d remote=127.0.0.1
你這段 log 其實已經把答案講完了:不是模型壞、也不是 alias 壞,是 Google 的那個 auth profile 被 OpenClaw 判定 rate_limit,進入 cooldown 了。
所以現在就算你有 3 個 model fallback(flash-latest / 2.5-flash / 1.5-flash),它們都共用同一個 google API key → 只要這把 key 在 cooldown,就會全部一起死:
No available auth profile for google (all in cooldown or unavailable). (rate_limit)
而且「重啟 LaunchAgent / gateway」不會清掉 cooldown(cooldown 狀態寫在 auth-profiles.json 裡)。
你現在該怎麼做(最務實)
1) 先停手不要一直試
一直重試只會把 cooldown 退避越拉越長(1 分 → 5 分 → 25 分 → 最多 1 小時)。
2) 查一下 cooldown 到底要等多久(不用貼 key)
在你的 Mac 上跑這段,它只會印出 cooldown 資訊,不會印出 API key:
python3 - <<'PY'
import json, pathlib, datetime
p = pathlib.Path.home()/".openclaw/agents/main/agent/auth-profiles.json"
d = json.loads(p.read_text())
print(json.dumps(d.get("usageStats", {}), indent=2))
PY
你看裡面有沒有 cooldownUntil(毫秒時間戳)。把那段輸出貼上來也行(不要貼 profiles 裡的 key),我可以幫你換算「還要等幾分鐘」。
3) 等 cooldown 過了再測
等到時間到了,再用:
/new google/gemini-flash-latest
然後送 test。
如果你常常一用就 rate limit
那通常是 Google key 的免費額度/配額太緊,解法只有兩種:
- 去 Google 那邊提高 quota/開 billing
- 或加「另一個 provider 的 key」當 fallback(不然 google 一限流就整個沒得用)
你先把 usageStats 貼出來(或至少告訴我 cooldownUntil / errorCount),我就能跟你說這次大概要等多久、是不是已經升到 25 分或 1 小時的退避了。
Last login: Fri Mar 6 22:27:34 on ttys005
steve@renbaixuedeMacBook-Air ~ % python3 - <<'PY'
import json, pathlib, datetime
p = pathlib.Path.home()/".openclaw/agents/main/agent/auth-profiles.json"
d = json.loads(p.read_text())
print(json.dumps(d.get("usageStats", {}), indent=2))
PY
{
"google:default": {
"lastUsed": 1772807378508,
"errorCount": 0,
"lastFailureAt": 1772807368397
}
}
steve@renbaixuedeMacBook-Air ~ %
你這份 usageStats 很有價值:完全沒有 cooldownUntil,而且 errorCount: 0。這代表它其實不像「真的被 rate limit 冷卻中」,比較像是 OpenClaw 那句話裡的另一半:
all in cooldown or unavailable ← 你比較像是 unavailable
在 macOS 上這個最常見的原因是:你在終端機有 GEMINI_API_KEY,但 LaunchAgent(gateway 服務)沒有拿到這個環境變數。
所以你在 terminal 跑 openclaw models status 看起來有 key,但 gateway 實際跑模型時卻「沒有可用的 auth profile」。
最穩的修法(讓 LaunchAgent 一定拿得到 key)
把 key 放到全域 .env(OpenClaw 會讀 ~/.openclaw/.env):
- 建立/編輯檔案
~/.openclaw/.env,內容放一行(不要引號):
GEMINI_API_KEY=AIzaSy...
- 權限收緊(建議):
chmod 600 ~/.openclaw/.env
- 重啟 gateway:
openclaw gateway restart
# 或你原本的 LaunchAgent restart 方法也行
- 回到 Web UI / Discord 用:
/new google/gemini-flash-latest
另一個選項(不想寫 .env)
在 ~/.openclaw/openclaw.json 開啟 shell env import(讓 gateway 去跑你的 login shell 把缺的 env 撿回來):
{
env: { shellEnv: { enabled: true, timeoutMs: 15000 } }
}
(文件: https://docs.openclaw.ai/help/environment )
你現在貼的狀態我幾乎可以肯定是「LaunchAgent 沒吃到 GEMINI_API_KEY」。你把 ~/.openclaw/.env 設好、重啟後再試一次,應該就會立刻恢復回覆。
上面都做完
現在是好了
但是api 會跳出限制
LLM error: { "error": { "code": 404, "message": "This model models/gemini-2.0-flash is no longer available to new users. Please update your code to use a newer model for the latest features and improvements.", "status": "NOT_F...
可能需要等待
等等就好了
請問是什麼問題
你現在看到的這個:
404 ... This model models/gemini-2.0-flash is no longer available to new users ...
不是「限流要等一下就好」那種問題,而是 Google 明確告訴你:你的 API key/專案 不能再用 gemini-2.0-flash 這個模型 了(對新用戶關閉/淘汰)。
所以理論上 等再久也不會讓 2.0-flash 變可用。
你會覺得「等一等又好了」,通常是因為:
- 你後來的請求其實跑到另一個 session(已經用
gemini-flash-latest/2.5-flash),所以又能回;或 - 那次請求雖然先撞到
2.0-flash,但 OpenClaw 之後用 fallback model 成功了(你現在有 fallbacks),只是 UI 仍顯示了那個 404。
這代表什麼?該怎麼做?
你要確保「沒有任何 session/工作」還在用 google/gemini-2.0-flash
最簡單做法:
- 在你正在用的聊天介面固定用:
或在舊 session 直接:/new google/gemini-flash-latest/model google/gemini-flash-latest
想抓出到底是哪個 session 還在叫 2.0-flash
下次再跳出 404 時,去 openclaw logs --follow 找這種行(你之前貼過):
[context-diag] pre-prompt: ... provider=google/gemini-...
把那一行貼出來(含 provider=... 就好),我就能確認到底是哪個 session 還黏著 gemini-2.0-flash,再對症處理。
補充:真正的「需要等待」通常會是 429 / rate_limit / RESOURCE_EXHAUSTED 那類訊息;你這個是 404 模型不可用,性質不一樣。
API rate limit reached. Please try again later.
那這個是什麼?