@gonzih/cc-discord 0.2.45 → 0.2.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -155,6 +155,8 @@ function wireStdoutToRedis(proc, ns, wire) {
155
155
  const rawRedis = wire._redis;
156
156
  const streamCh = metaStreamChannel(ns);
157
157
  const logKey = metaLogKey(ns);
158
+ // Deduplicate rate_limit_event: Claude emits multiple per turn; only notify once per session.
159
+ let rateLimitNotified = false;
158
160
  const forwardEventToRedis = (eventJson) => {
159
161
  rawRedis.publish(streamCh, eventJson).catch((err) => {
160
162
  console.warn(`[meta-agent-manager] stream publish failed (ns=${ns}):`, err.message);
@@ -246,9 +248,9 @@ function wireStdoutToRedis(proc, ns, wire) {
246
248
  const rl = parsed.rate_limit_info;
247
249
  structuredEvent = parsed;
248
250
  // Throttled: five-hour window exhausted and no overage credits.
249
- // Claude will hang on API calls until the window resets notify Discord immediately
250
- // and signal done so the live message finalizes, rather than silently timing out.
251
- if (rl?.overageStatus === "rejected") {
251
+ // Claude emits multiple rate_limit_events per turn only act on the first.
252
+ if (rl?.overageStatus === "rejected" && !rateLimitNotified) {
253
+ rateLimitNotified = true;
252
254
  const resetsAt = rl.resetsAt ? new Date(rl.resetsAt * 1000).toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit", timeZoneName: "short" }) : "soon";
253
255
  const alertMsg = {
254
256
  id: crypto.randomUUID(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gonzih/cc-discord",
3
- "version": "0.2.45",
3
+ "version": "0.2.46",
4
4
  "description": "Claude Code Discord bot — chat with Claude Code via Discord",
5
5
  "type": "module",
6
6
  "bin": {