Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/commands/projects/session-settings/commands.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import { runProjectsSessionSettingsList } from "./list.js";
import { runProjectsSessionSettingsSet } from "./set.js";
import { SESSION_SETTING_KEYS } from "./defs.js";

const listProjectSessionSettings = vi.fn();
const setProjectSessionSetting = vi.fn();
Expand All @@ -23,6 +24,10 @@ vi.mock("../../../lib/project-config.js", () => ({
}));

describe("projects session-settings commands", () => {
it("SESSION_SETTING_KEYS includes stt_enabled", () => {
expect(SESSION_SETTING_KEYS).toContain("stt_enabled");
});

beforeEach(() => {
listProjectSessionSettings.mockReset();
setProjectSessionSetting.mockReset();
Expand All @@ -46,6 +51,7 @@ describe("projects session-settings commands", () => {
idle_timeout_enabled: true,
idle_timeout_seconds: 30,
conversation_history_enabled: true,
stt_enabled: true,
},
});

Expand All @@ -57,6 +63,7 @@ describe("projects session-settings commands", () => {
expect(console.log).toHaveBeenCalledWith(
"conversation_history_enabled=true",
);
expect(console.log).toHaveBeenCalledWith("stt_enabled=true");
});

it("uses explicit project id over linked config", async () => {
Expand Down Expand Up @@ -115,6 +122,24 @@ describe("projects session-settings commands", () => {
);
});

it("sets stt_enabled", async () => {
setProjectSessionSetting.mockResolvedValue({
project_id: "proj-1",
settings: { stt_enabled: false },
});

await runProjectsSessionSettingsSet({
name: "stt_enabled",
value: "false",
});

expect(setProjectSessionSetting).toHaveBeenCalledWith(
"proj-1",
"stt_enabled",
false,
);
});

it("sets conversation_history_enabled", async () => {
setProjectSessionSetting.mockResolvedValue({
project_id: "proj-1",
Expand Down
10 changes: 9 additions & 1 deletion src/commands/projects/session-settings/defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const SESSION_SETTING_KEYS = [
"data_only_idle_timeout_seconds",
"idle_timeout_voice_activity",
"idle_timeout_dc_inbound",
"stt_enabled",
"conversation_history_enabled",
"conversation_recording_enabled",
"conversation_recording_metered_overage_enabled",
Expand Down Expand Up @@ -71,11 +72,17 @@ export const SESSION_SETTING_DEFS: Record<
description:
"When on, client→server data-channel messages reset the idle countdown. When off, data-channel traffic does not extend the session.",
},
stt_enabled: {
type: "boolean",
default: true,
description:
"When on (default), inbound user audio is transcribed on Voice and Voice+Data sessions. false disables project-default STT (sessions/clients can still enable STT at runtime).",
},
conversation_history_enabled: {
type: "boolean",
default: true,
description:
"When on (default), store final user speech and agent TTS text for the dashboard Conversation tab. false stops recording new transcripts (existing history kept until retention).",
"When on (default), store final user speech and agent TTS text for Voice and Voice+Data sessions in the dashboard Conversation tab. false stops recording new transcripts (existing history kept until retention).",
},
conversation_recording_enabled: {
type: "boolean",
Expand Down Expand Up @@ -140,6 +147,7 @@ export function formatSessionSettingsGroupHelp(): string {
lines.push(
" $ voicethere projects session-settings set conversation_history_enabled false",
);
lines.push(" $ voicethere projects session-settings set stt_enabled false");
lines.push(
" $ voicethere projects session-settings set conversation_recording_enabled true",
);
Expand Down
1 change: 1 addition & 0 deletions src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ export interface ProjectSessionSettingsResponse {
conversation_history_enabled?: boolean;
conversation_recording_enabled?: boolean;
conversation_recording_metered_overage_enabled?: boolean;
stt_enabled?: boolean;
};
}

Expand Down
Loading