notify even when peon muted

This commit is contained in:
2026-04-09 09:45:30 +01:00
parent 587c54060b
commit 6003f41a12
2 changed files with 18 additions and 17 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
{ {
"lastChangelogVersion": "0.65.2", "lastChangelogVersion": "0.66.1",
"defaultProvider": "openai-codex", "defaultProvider": "openai-codex",
"defaultModel": "gpt-5.3-codex", "defaultModel": "gpt-5.3-codex",
"defaultThinkingLevel": "high", "defaultThinkingLevel": "high",
+17 -16
View File
@@ -308,9 +308,24 @@ function pickSound(categoryConfig: CategoryConfig, category: Category): Sound |
// ============ SOUND PLAYBACK ============ // ============ SOUND PLAYBACK ============
function play(category: Category): void { function play(category: Category): void {
if (config.muted) return;
if (!config.enabledCategories[category]) return; if (!config.enabledCategories[category]) return;
const notificationMessages: Record<Category, { title: string; message: string } | null> = {
"session.start": null,
"task.acknowledge": null,
"task.complete": { title: "Pi", message: "Task complete" },
"task.error": { title: "Pi", message: "Task failed" },
"input.required": { title: "Pi", message: "Input required" },
"resource.limit": { title: "Pi", message: "Rate limited" },
};
const notification = notificationMessages[category];
if (notification) {
sendNotification(notification.title, notification.message);
}
if (config.muted) return;
const now = Date.now(); const now = Date.now();
if (now - lastPlayed < DEBOUNCE_MS) { if (now - lastPlayed < DEBOUNCE_MS) {
return; return;
@@ -345,20 +360,6 @@ function play(category: Category): void {
} }
playSound(soundPath, config.volume); playSound(soundPath, config.volume);
const notificationMessages: Record<Category, { title: string; message: string } | null> = {
"session.start": null,
"task.acknowledge": null,
"task.complete": { title: "Pi", message: "Task complete" },
"task.error": { title: "Pi", message: "Task failed" },
"input.required": { title: "Pi", message: "Input required" },
"resource.limit": { title: "Pi", message: "Rate limited" },
};
const notification = notificationMessages[category];
if (notification) {
sendNotification(notification.title, notification.message);
}
} }
// ============ COMMANDS ============ // ============ COMMANDS ============
@@ -814,7 +815,7 @@ async function showTestMenu(ctx: ExtensionCommandContext) {
const INTERACTIVE_TOOLS = new Set(["question", "questionnaire"]); const INTERACTIVE_TOOLS = new Set(["question", "questionnaire"]);
export default function (pi: ExtensionAPI) { export default function(pi: ExtensionAPI) {
registerCommands(pi); registerCommands(pi);
pi.on("session_start", async (_event, ctx) => { pi.on("session_start", async (_event, ctx) => {