Back to skills
SKILL.md
Tickets
ASecurity優先度:P2 範圍:`termade-daemon`、`termade` CLI、`docs/` 相依:T20, T37 Status: done
- 3 stars
- 0 votes
- 0 copies
- 0 views
- Added November 23, 2026
Works with
Security analysis
100/100Pro scans all 21 files and shows the line behind each finding
npx -y skills add single9/ertangle --skill tickets --agent claude-codeAre you the author of Tickets?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/single9-tickets)# T38 — 額度感知的 spawn、即時額度警告與可安裝的 termade-ade skill
優先度:P2 範圍:`termade-daemon`、`termade` CLI、`docs/` 相依:T20, T37
Status: done
## 問題
agent 自行 spawn 子 session 會快速消耗 token,也可能在額度用盡時讓工作被中斷。
## 做法
1. **額度感知 spawn**:agent 自行建立 session 時檢查該 agent 的額度。達到 `[handoff] warn_percent` (預設 90%) 或已滿時,改用 `[handoff] fallback` 中可用的 agent;沒有可用者就以英文錯誤拒絕 (含重置時間)。成功的回覆一律附上簡短額度摘要,例如 `quota claude 72% (5h window)`。
2. **同時子 session 上限**:新增 `[agent_spawn] max_live_children` (預設 3),沿用既有 `max_children` 檢查;`[limits] max_children` 有設時以它為準。
3. **即時警告**:額度越線時除了 SessionNote,也透過匯流排送 `QUOTA_WARN <agent> <used>%: ...` 給執行中的 coordinator 與該 agent 的 session,可喚醒 `termade_wait`。`termade_whoami` 另外回傳 `quotas`。
4. **省 token 指引**:coordinator 協作說明與 `termade_spawn` 工具描述加入精簡原則。
5. **termade-ade skill**:內嵌 SKILL.md,提供 `termade skill install|uninstall|show`;`[collab] inject_skill = true` 時把內文附加到協作說明 (預設關閉)。
## 驗收
- `check_spawn_quota` 的放行、改用 fallback、拒絕三種情形有單元測試。
- skill 安裝與移除路徑 (claude/agents/codex) 以暫存目錄測試。
## Comments
- 2026-11-17:實機發現 Claude 在 7 天視窗超過 75% 時,`rate_limit_event` 回報 `"status":"allowed_warning"` (附 `surpassedThreshold: 0.75`)。原本 `parse_rate_limit_event` 把所有非 `allowed` 的狀態都當成 `reached`,導致 76% 就顯示「額度已滿」、送出 `QUOTA_WARN`,額度感知 spawn 也會誤拒。改為只有非 `allowed*` 的狀態 (如 `rejected`) 才算用完。
Files in this skill
- README.md
- T01-daemon-restart-state.md
- T02-merge-safety.md
- T03-gc-unmerged-work.md
- T04-policy-engine-effective.md
- T05-remote-mode-security.md
- T06-ci-and-integration-tests.md
- T07-daemon-concurrency.md
- T08-event-log-rotation.md
- T09-split-large-modules.md
- T10-docs-and-makefile.md
- T11-agent-config-and-model.md
- T12-permission-settings.md
- T13-tui-layout-modes.md
- T14-session-resume.md
- T15-notifications.md
- T16-transcript-search.md
- T17-budget-limits.md
- T18-task-board.md
- T19-daemon-prompt-queue.md
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.