Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review: round 3 - cache empty bodies, clear slow timer, defensive split

Adam Eivy48f40544302a
diff --git a/client/src/hooks/useAIStatusNotifications.js b/client/src/hooks/useAIStatusNotifications.js
index fa0fa8612c..18573e7d75 100644
--- a/client/src/hooks/useAIStatusNotifications.js
+++ b/client/src/hooks/useAIStatusNotifications.js
@@ -40,6 +40,13 @@ export function useAIStatusNotifications() {
const showLoading = (event) => {
const state = opsRef.current.get(event.id) || { silent: false };
+ // Once a toast is opened, the deferred slow-call timer is no longer needed —
+ // letting it fire later would re-show a stale start message and clobber
+ // the model:loading/model:loaded toast we just opened.
+ if (state.slowTimer) {
+ clearTimeout(state.slowTimer);
+ state.slowTimer = undefined;
+ }
state.opened = true;
opsRef.current.set(event.id, state);
toast.loading(event.message, { id: event.id, icon: phaseIcon[event.phase] || '🤖' });
diff --git a/server/services/taskSchedule.js b/server/services/taskSchedule.js
index 32078dc3de..a5242f6185 100644
--- a/server/services/taskSchedule.js
+++ b/server/services/taskSchedule.js
@@ -2083,7 +2083,9 @@ export function getDefaultPrompt(taskType) {
// Cache slashdo command bodies loaded from the bundled submodule
const _slashdoCache = {};
async function loadSlashdoCommandBody(commandName) {
- if (_slashdoCache[commandName]) return _slashdoCache[commandName];
+ // hasOwn instead of truthy check so we don't re-fetch when the file is
+ // legitimately empty (cached '' would otherwise look the same as "not yet loaded").
+ if (Object.hasOwn(_slashdoCache, commandName)) return _slashdoCache[commandName];
_slashdoCache[commandName] = await loadSlashdoFile(commandName, { stripFrontmatter: true }) || '';
return _slashdoCache[commandName];
}
diff --git a/server/services/voice/bootstrap.js b/server/services/voice/bootstrap.js
index 23f243aae3..9db7c32590 100644
--- a/server/services/voice/bootstrap.js
+++ b/server/services/voice/bootstrap.js
@@ -18,7 +18,7 @@ export const WHISPER_APP = 'portos-whisper';
export const which = async (bin) => {
const res = await pexec(IS_WIN ? 'where' : 'which', [bin]).catch(() => null);
- return res?.stdout.split(/\r?\n/)[0].trim() || null;
+ return res?.stdout?.split(/\r?\n/)[0]?.trim() || null;
};
export const verifyBinaries = async (cfg) => {