feat: statusbar 在送出第一個提示詞前就顯示額度、ctx 與系統資源 #25

Merged
jiantw83 merged 1 commits from feat/statusbar-prefetch into main 2026-10-13 14:19:06 +00:00
Contributor

問題

引擎要等第一次 API 回應才提供 5h / 7d 額度與 ctx,CPU 也要取樣兩次才算得出來,所以送出第一個提示詞前這些欄位都是破折號或缺漏。

改動(jsc-statusbar 0.0.3 → 0.0.4)

  • 5h / 7d 額度每次更新時存進 $.store,新對話開始先顯示上次的數值;已過重置時間的視窗不沿用
  • 尚無 API 回應時 ctx 先顯示 0%
  • 開場 0.5 秒後多取樣一次,CPU 不必等 3 秒

限制

  • 全新機器第一次開對話沒有存過的額度,5h / 7d 仍是破折號
  • 開場的額度是舊值,第一次回應後會更正

測試

claude plugin validate 通過。claude plugin test 的 band > draws one line above the prompt... 在改動前就失敗($.ui.mount: no implementation for ui.render),與本次無關。

🤖 Generated with Claude Code

## 問題 引擎要等第一次 API 回應才提供 5h / 7d 額度與 ctx,CPU 也要取樣兩次才算得出來,所以送出第一個提示詞前這些欄位都是破折號或缺漏。 ## 改動(jsc-statusbar 0.0.3 → 0.0.4) - 5h / 7d 額度每次更新時存進 `$.store`,新對話開始先顯示上次的數值;已過重置時間的視窗不沿用 - 尚無 API 回應時 ctx 先顯示 `0%` - 開場 0.5 秒後多取樣一次,CPU 不必等 3 秒 ## 限制 - 全新機器第一次開對話沒有存過的額度,5h / 7d 仍是破折號 - 開場的額度是舊值,第一次回應後會更正 ## 測試 `claude plugin validate` 通過。`claude plugin test` 的 `band > draws one line above the prompt...` 在改動前就失敗(`$.ui.mount: no implementation for ui.render`),與本次無關。 🤖 Generated with [Claude Code](https://claude.com/claude-code)
admin added 1 commit 2026-10-13 14:16:56 +00:00
- 5h/7d 額度存進 $.store,新對話先顯示上次的數值(已過重置時間的視窗不沿用)
- 尚無 API 回應時 ctx 先顯示 0%
- 開場 0.5 秒後補一次系統取樣,CPU 不必等 3 秒

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
jiantw83 merged commit 77fb91cd1b into main 2026-10-13 14:19:06 +00:00
jiantw83 deleted branch feat/statusbar-prefetch 2026-10-13 14:19:06 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jiantw83/jsc-marketplace#25