Repository navigation
v6.4.1 — query_usage reads the Codex quota on 0.160
claude mcp add ai-cli -s user -- npx -y @tkflyc/ai-cli-mcpFixed: query_usage never read the Codex quota on codex-cli 0.160
6.4.0 stopped reporting ok without a number. That made the next problem visible: on codex-cli 0.160 the query still timed out after 60 seconds on every attempt in our tests — honestly reported as an error, but still without a number. Two assumptions about the TUI had stopped holding:
- It never looked ready. The old check waited for the model name in the header box to change from
loadingto a real model. In 0.160 the header stays onloadingand the model name moved to the bottom status line, so/statuswas never sent. Readiness now also means: the prompt line is visible, no MCP server is still booting, and output has been quiet for 1.5 seconds. The old check is kept for older versions. - Enter was swallowed. Typing
/opens a command menu, and when/statusand Enter arrived in a single write, the menu consumed the Enter — the screen ended with›/statussitting unexecuted in the input box. Text and Enter are now written separately, 500 ms apart; a retry only resends Enter when/statusis already in the box, so it never becomes/status/status.
Verified against the real CLI before release, through a freshly reconnected MCP server: status: "ok", type: "rate_limits", weekly 81% left, matching what the TUI shows.
Only the quota query changed. Dispatch (run) is untouched.
Full details: CHANGELOG.
繁體中文
修正:codex-cli 0.160 上 query_usage 一直讀不到 Codex 額度
6.4.0 不再把沒有數字的結果回報成 ok,下一個問題因此浮上來:在 codex-cli 0.160 上,我們測試的每一次查詢都在 60 秒後逾時。雖然誠實地回報成 error,但數字一樣出不來。原因是程式對 TUI 的兩個假設不再成立:
- 永遠等不到就緒。 舊的判斷要等標題框裡的模型名從
loading換成真正的模型才送/status。0.160 的標題框一直停在loading,模型名改到底部狀態列,所以/status從來沒送出。現在只要提示列出現、沒有 MCP server 正在啟動、輸出靜止 1.5 秒,就算就緒;舊版的判斷照樣保留。 - Enter 被吞掉。 一打
/就會跳出指令選單,/status和 Enter 在同一次寫入時,Enter 被選單吃掉,畫面最後只剩輸入框裡沒執行的›/status。現在文字和 Enter 分兩次送,中間隔 500 毫秒;重試時如果/status已經在輸入框裡,只補送 Enter,不會變成/status/status。
發版前透過重新連線的 MCP server 用真的 CLI 驗證:status: "ok"、type: "rate_limits"、weekly 81% left,跟 TUI 畫面上顯示的一致。
只改了額度查詢,派工(run)完全沒動。
完整內容:CHANGELOG。