This commit is contained in:
Timothy Jaeryang Baek
2026-07-27 03:09:25 -04:00
parent bb928b0dfe
commit 9707d3a5c2
5 changed files with 12 additions and 11 deletions
+4 -5
View File
@@ -729,6 +729,10 @@
);
};
$: if ($terminalServers !== null && $selectedTerminalId && !isTerminalAvailable($selectedTerminalId)) {
selectedTerminalId.set(null);
}
let settingDefaults = false;
const setDefaults = async () => {
if (settingDefaults) return;
@@ -1286,11 +1290,6 @@
});
}
// Clear stale selectedTerminalId if the referenced terminal no longer exists
if ($selectedTerminalId && !isTerminalAvailable($selectedTerminalId)) {
selectedTerminalId.set(null);
}
const pageSubscribe = page.subscribe(async (p) => {
if (p.url.pathname === '/' || p.url.pathname.startsWith('/folders/')) {
await tick();
@@ -110,6 +110,7 @@
// Clear selected direct terminal if user lost permission
$: if (
$selectedTerminalId &&
$terminalServers !== null &&
!($terminalServers ?? []).some((t) => t.id && t.id === $selectedTerminalId) &&
!($user?.role === 'admin' || ($user?.permissions?.features?.direct_tool_servers ?? true))
) {
+1 -1
View File
@@ -696,7 +696,7 @@
}
// Clear selected terminal when model doesn't support terminal
$: if ($selectedTerminalId && terminalCapableModels.length === 0) {
$: if ($selectedTerminalId && selectedModelIds.length > 0 && terminalCapableModels.length === 0) {
selectedTerminalId.set(null);
}