tts-error-reporting

A convention for sending text-to-speech worker errors from separate processes back to the main application. Text-to-speech, or TTS, turns written text into spoken audio.

In plain words
What is it for?
Updating or debugging TTS workers so errors reach the main process and appear as frontend notifications.
Why use it?
It prevents connection failures, quota limits, and API errors from disappearing in background workers without informing the user interface.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/project-n-e-k-o/n.e.k.o/tts-error-reporting
Any agent
npx skills add Project-N-E-K-O/N.E.K.O --skill tts-error-reporting
Clone the repo
git clone --depth 1 https://github.com/Project-N-E-K-O/N.E.K.O

Made for: Claude Code, Codex.

Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 653 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00060 $0.00653
Opus 5 $0.00030 $0.00327
Sonnet 5 $0.00012 $0.00131
Haiku 4.5 $0.00006 $0.00065

Measured yesterday against content hash 0173d2fca255, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tts-error-reporting scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agent/skills/tts-error-reporting/SKILL.md · 56 lines

How it starts

The opening of the file, as written. The whole thing — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.

TTS Error Reporting Protocol

To ensure users are properly notified when a TTS service encounters an error (such as quota exhaustion, API issues, or connection failures), TTS workers running in separate processes must propagate errors back to the main process (core.py).

Core Rule: Use response_queue.put(("__error__", error_msg))

When a TTS worker (e.g. step_realtime_tts_worker, qwen_realtime_tts_worker, etc.) catches an error, it MUST NOT only log the error using logger.error(). It MUST ALSO send the error message back to the main process through its response_queue using the explicit tuple format ("__error__", error_msg).

This ensures that core.py's tts_response_handler can intercept the error and translate it into a frontend WebSocket message (type: 'status'), triggering a user-friendly Toast notification (e.g., "💥 免费TTS限额已耗尽").

Example Implementation

# Bad Pattern (Fails silently for user)
except Exception as e:
    logger.error(f"TTS Worker Error: {e}")
    # Worker dies or hangs, user stuck on "Preparing..."

# Good Pattern (Structured JSON error for i18n frontend toasts)
import json
except Exception as e:
    logger.error(f"TTS Worker Error: {e}")
    # Map to specific error codes known to i18n
    error_payload = json.dumps({"code": "API_QUOTA_TIME", "details": str(e)})
    response_queue.put(("__error__", error_payload))

# Acceptable Fallback (Fallback 1008 error if code unknown)
except Exception as e:
    logger.error(f"TTS Worker Error: {e}")
    error_payload = json.dumps({"code": "API_1008_FALLBACK", "msg": str(e)})
    response_queue.put(("__error__", error_payload))

WebSocket Stream Callbacks Example

import json
def on_error(self, message: str): 
    logger.error(f"TTS Error: {message}")
    error_payload = json.dumps({"code": "API_1008_FALLBACK", "msg": message})
    self.response_queue.put(("__error__", error_payload))

Checklist for Adding a New TTS Worker

Whenever you add a new TTS API worker in tts_client.py:

  1. Ensure the worker signature accepts a response_queue.
  2. Locate all network initialization blocks, try/except loops, and on_error WebSocket callbacks.
  3. In every local exception block where the worker might fail or drop the connection, add response_queue.put(("__error__", error_message_string)).
  4. Ensure string encoding handles JSON cleanly if propagating raw API errors.

Read the full file on GitHub · 56 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 56 lines · 60 tokens per session scan A 0173d2fca255

Subscribe to this mod's changes

tts-error-reporting is a skill published in the GitHub repository Project-N-E-K-O/N.E.K.O (2,708 stars, last pushed yesterday), licensed Apache-2.0. It adds 60 tokens to every session and 653 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.