Skip to content

Commit f696430

Browse files
authored
refactor(tts): split complex command handlers (#105005)
1 parent 36da65d commit f696430

2 files changed

Lines changed: 229 additions & 248 deletions

File tree

src/auto-reply/reply/commands-tts.test.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,22 @@ describe("handleTtsCommands status fallback reporting", () => {
249249
expect(reply.text).toContain("TTS status");
250250
});
251251

252+
it("keeps base status fields in display order", async () => {
253+
const reply = expectReply(await handleTtsCommands(buildTtsParams("/tts status"), true));
254+
255+
expect(reply.text).toBe(
256+
[
257+
"📊 TTS status",
258+
"State: ✅ enabled",
259+
"Chat override: default",
260+
`Provider: ${PRIMARY_TTS_PROVIDER} (✅ configured)`,
261+
"Persona: none",
262+
"Text limit: 1500 chars",
263+
"Auto-summary: on",
264+
].join("\n"),
265+
);
266+
});
267+
252268
it("resolves status config for the active agent", async () => {
253269
const cfg = {
254270
agents: { list: [{ id: "reader", tts: { provider: "elevenlabs" } }] },
@@ -364,7 +380,7 @@ describe("handleTtsCommands status fallback reporting", () => {
364380

365381
const beforeTtsRead = Date.now();
366382
const result = await handleTtsCommands(
367-
buildTtsParams("/tts latest", {}, undefined, { sessionEntry, sessionStore }),
383+
buildTtsParams("/tts read latest", {}, undefined, { sessionEntry, sessionStore }),
368384
true,
369385
);
370386

0 commit comments

Comments
 (0)