Skip to content

Commit ec2003e

Browse files
author
Baudbot
committed
fix: address PR #163 review comments on dashboard extension
- Drop grep pipe from detectBridgeType, just use ps + JS includes - Log refresh errors instead of silently swallowing them - Guard ctx.ui.notify with ctx.hasUI check for headless environments
1 parent aa3df59 commit ec2003e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pi/skills/debug-agent/debug-dashboard.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ async function getPiLatestVersion(): Promise<string | null> {
131131

132132
function detectBridgeType(): string | null {
133133
try {
134-
const out = execSync("ps -eo args 2>/dev/null | grep -E 'broker-bridge|bridge\\.mjs' | grep -v grep", {
134+
const out = execSync("ps -eo args", {
135135
encoding: "utf-8", timeout: 3000,
136136
}).trim();
137137
if (out.includes("broker-bridge")) return "broker";
@@ -718,7 +718,7 @@ export default function dashboardExtension(pi: ExtensionAPI): void {
718718
description: "Refresh the baudbot status dashboard",
719719
handler: async (_args, ctx) => {
720720
await refresh();
721-
ctx.ui.notify("Dashboard refreshed", "info");
721+
if (ctx.hasUI) ctx.ui.notify("Dashboard refreshed", "info");
722722
},
723723
});
724724

@@ -730,7 +730,7 @@ export default function dashboardExtension(pi: ExtensionAPI): void {
730730

731731
timer = setInterval(async () => {
732732
try { await refresh(); }
733-
catch {}
733+
catch (err) { console.error("Dashboard refresh failed:", err); }
734734
}, REFRESH_INTERVAL_MS);
735735
});
736736

0 commit comments

Comments
 (0)