Introduction¶
When running agents in DSH (DeepSeek Harness), today’s usage is visible in the sidebar, but the numbers often require switching panels to notice. If you have the @linxin666/dsh-pet desktop pet enabled, after the upstream split usage announcements out of the built-in pipeline on 2026-09-17, the ctx.pet.announce contract remains, but there is temporarily no default publisher—meaning the bubble stack is likely left with only session-driven content until third-party plugins are integrated.
The following introduces the community plugin dsh-pet-quota (Maintainer: Daizhdd, Category: Fun/Cosmetic): It does not modify the pet source code; instead, it uses public interfaces to attach a “Today’s Quota” bubble to the pet’s head. It utilizes three tiers (Light/Medium/Heavy) and a colored dot to express the level, deliberately avoiding progress bars and percentages.
What is This¶
dsh-pet-quota is a token quota bubble plugin for the DSH desktop pet. It aggregates usage from the day’s session/events (consistent with the sidebar usage panel) and publishes bubbles via the documented ctx.pet.announce() interface of dsh-pet.
It depends on @linxin666/dsh-pet and operates through its cross-plugin interface, requiring no modification to the pet plugin code. The repository contains no art assets and does not patch third-party code. License: MIT. Current package version: 0.1.0.
Directory Page: https://www.skillhub.cn/plugins/Daizhdd/dsh-pet-quota
Source Code: https://github.com/Daizhdd/dsh-pet-quota
Core Features¶
Tiers and Display¶
By default, it is divided into three tiers based on total tokens used today. The bubble uses only a single colored dot to represent the tier:
| Tier | Threshold (Default) | Dot | Message |
|---|---|---|---|
| Light | < 50M |
🟢 | Usage is light today, take your time~ |
| Medium | 50M – 100M |
🟡 | Burning a bit hot today… |
| Heavy | > 100M |
🔴 | Behemoth Mode, I’m feeling a bit hot… |
Example form of the persistent bubble (README illustration):
Persistent ┌──────────────────────────┐
│ Today's Quota │
│ 43.521M tok │
│ 🟢 Light · Usage is light today, take your time~ │
└──────────────────────────┘
In addition to the persistent quota, the plugin sends event-based bubbles at moments such as tier changes, task completion, and exceptions (e.g., “Entered Medium / Entered Heavy · Behemoth Mode”, “Task Complete · +12.345M this round · 🟡 Medium”, etc.). Thresholds can be modified in the settings page; changes take effect immediately without restarting DSH.
Where the Numbers Come From¶
- Aggregates
assistant/message.usagefromsession/event, consistent with the sidebar:Input + Cache Read + Cache Write + Output(Reasoning tokens are included in Output and not counted twice). - Reads
$DSH_HOME/dsh-usage/usage-ledger.jsononce at startup for backfill, ensuring the day’s figures remain complete even if the plugin is installed mid-session; subsequently, it reconciles via heartbeats to cover events missed while the plugin was disabled. - Resets and recalculates based on local date rolls over.
- Sub-agent turns only count tokens, no announcements, to avoid screen-flooding from dozens of sub-turns in workflows.
Relationship with Pet’s Native Bubbles¶
This plugin only sends its own announcement bubbles and does not disable the pet’s built-in status stack (e.g., “Thinking”, “Using xxx”). If you wish to keep only the quota bubble, you can manually turn off the status bubbles in dsh-pet 0.4.6+: Settings → Pet → Status Bubbles → Off (Equivalent config: statusBubbles: off). off only hides the pet’s conversation bubble stack; this plugin’s announcement bubbles and interactive feedback bubbles will still render.
Upstream “Single Announcement Slot” Limitation¶
The announcement contract of dsh-pet currently has only one announcement slot. If you have other announcement-type plugins installed, their bubbles will overwrite each other—this is a known upgrade item in the upstream design notes (expected to change to a map or multiple slots in the future) and is not a problem specific to this plugin.
Installation and Activation¶
Prerequisites: The current profile has @linxin666/dsh-pet enabled (included in the @linxin666/dsh-web-all bundle). If the pet plugin is missing, this plugin will not error; it will still track numbers as usual, but there will be no place to display bubbles.
Installation Commands (from the repo README):
# link install (re-enabling after code changes takes effect)
dsh plugin --profile <your_profile> add link:/path/to/dsh-pet-quota
# or after publishing to npm
dsh plugin --profile <your_profile> add dsh-pet-quota
After installation, refresh the page once (the browser side loading the plugin). This plugin does not contain pet assets and does not require rescanning the pet directory; the original pet appearance remains unchanged.
Node Engine Requirement: ^22.19.0 || >=24.0.0 (see package.json).
Configuration and HTTP API¶
Settings Entry: Settings → Pet Quota. You can view today’s usage and tier ladder, adjust the two thresholds, and toggle three switches: Show Quota Bubble, Bubble on Task Completion, and Bubble during Long-Running Tasks. Configuration is written to $DSH_HOME/pet-quota/config.json, takes effect immediately, and persists across restarts.
Command Line or Script Example:
curl -X POST http://127.0.0.1:<port>/api/pet-quota/config \
-H 'content-type: application/json' \
-d '{"lowMax":30000000,"midMax":80000000}'
| Route | Purpose |
|---|---|
GET /api/pet-quota/today |
Current day usage, tier, thresholds, switches, distribution by model |
POST /api/pet-quota/config |
Modify thresholds and switches (Out-of-bounds or Heavy threshold ≤ Medium threshold will be rejected) |
GET /api/pet-quota/boot |
Diagnostics: whether frontend has entered boot image, event shape sampling |
Typical Usage¶
Calibrate Thresholds with Historical Ledger¶
If you are unsure whether the default 50M / 100M is appropriate, you can run in the root directory of the cloned or local repository:
python tools/tier_backtest.py
The script reads $DSH_HOME/dsh-usage/usage-ledger.json, categorizes by both including cache and excluding cache metrics, and prints peaks. The README notes: The metric must include cache; otherwise, the three tiers become effectively useless.
Self-Test (Does not touch real DSH_HOME)¶
node tools/smoke_host.mjs # Host: Backfill, folding, tiering, dot bubbles, three event bubble types, sub-agent silence, config
node tools/smoke_client.mjs # Frontend: Stub env assembly + render settings page + assert no overlay registration
Both scripts use a temporary directory as DSH_HOME. The repository CI also adopts the same set of tests.
Use Cases and Notes¶
Who it is for: Users already using the DSH Desktop Pet who want to hang “How many tokens used today, what tier” near their pet, but do not want the bubble filled with progress bars and percentages. In terms of categorization, it is a practical accessory within the “Fun/Cosmetic” ecosystem.
Permissions and Security: The plugin runs with the current DSH process permissions. It reads the usage ledger and session events, writes to $DSH_HOME/pet-quota/config.json, and exposes a configuration interface via local HTTP. It is recommended to read the GitHub Repository source code and MIT License before installation. The community directory skillhub.cn has no official affiliation with DeepSeek / Hianfo and belongs to the DSH “Everything is a Plugin” community ecosystem.
Compatibility Note: If an older version of dsh-pet lacks the statusBubbles switch, the native status bubbles can only be disabled by modifying build artifacts; this plugin does not provide that capability. When coexisting with other announce publishers, be aware of the single-slot overwrite behavior.
Conclusion¶
dsh-pet-quota fills the gap left by the upstream for usage-type announcements: the same sidebar metrics, a three-tier single-dot display, and optional event bubbling. It is ready to use after installation and refresh. To adjust thresholds or switches, use the settings page or /api/pet-quota/*; to verify if the default ladder fits your usage, simply run tier_backtest.py against the ledger for a backtest.
- Directory Page: https://www.skillhub.cn/plugins/Daizhdd/dsh-pet-quota
- GitHub: https://github.com/Daizhdd/dsh-pet-quota