Skip to content

Commit 90fd6c3

Browse files
committed
sentry.io sourced bug fixes
1 parent 7878d29 commit 90fd6c3

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

src/renderer/App.tsx

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,18 +1017,41 @@ function MaestroConsoleInner() {
10171017
}
10181018

10191019
// Sessions must have aiTabs - if missing, this is a data corruption issue
1020+
// Create a default tab to prevent crashes when code calls .find() on aiTabs
10201021
if (!session.aiTabs || session.aiTabs.length === 0) {
10211022
console.error(
1022-
'[restoreSession] Session has no aiTabs - data corruption, skipping:',
1023+
'[restoreSession] Session has no aiTabs - data corruption, creating default tab:',
10231024
session.id
10241025
);
1026+
const defaultTabId = generateId();
10251027
return {
10261028
...session,
10271029
aiPid: -1,
10281030
terminalPid: 0,
10291031
state: 'error' as SessionState,
10301032
isLive: false,
10311033
liveUrl: undefined,
1034+
aiTabs: [
1035+
{
1036+
id: defaultTabId,
1037+
agentSessionId: null,
1038+
name: null,
1039+
state: 'idle' as const,
1040+
logs: [
1041+
{
1042+
id: generateId(),
1043+
timestamp: Date.now(),
1044+
source: 'system' as const,
1045+
text: '⚠️ Session data was corrupted and has been recovered with a new tab.',
1046+
},
1047+
],
1048+
starred: false,
1049+
inputValue: '',
1050+
stagedImages: [],
1051+
createdAt: Date.now(),
1052+
},
1053+
],
1054+
activeTabId: defaultTabId,
10321055
};
10331056
}
10341057

src/renderer/components/MainPanel.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import { AgentSessionsBrowser } from './AgentSessionsBrowser';
3434
import { TabBar } from './TabBar';
3535
import { WizardConversationView, DocumentGenerationView } from './InlineWizard';
3636
import { gitService } from '../services/git';
37+
import { remoteUrlToBrowserUrl } from '../../shared/gitUtils';
3738
import { useGitBranch, useGitDetail, useGitFileStatus } from '../contexts/GitStatusContext';
3839
import { formatShortcutKeys } from '../utils/shortcutFormatter';
3940
import { calculateContextTokens } from '../utils/contextUsage';
@@ -939,10 +940,8 @@ export const MainPanel = React.memo(
939940
<button
940941
onClick={(e) => {
941942
e.stopPropagation();
942-
const url = gitInfo.remote.startsWith('http')
943-
? gitInfo.remote
944-
: `https://${gitInfo.remote}`;
945-
window.open(url.replace(/\.git$/, ''), '_blank');
943+
const url = remoteUrlToBrowserUrl(gitInfo.remote);
944+
if (url) window.open(url, '_blank');
946945
}}
947946
className="text-xs font-mono truncate hover:underline text-left"
948947
style={{ color: theme.colors.textMain }}

0 commit comments

Comments
 (0)