Skip to content

Commit 39e16a6

Browse files
committed
Added server down
1 parent 6924b6b commit 39e16a6

2 files changed

Lines changed: 23 additions & 8 deletions

File tree

src/core/webview/ClineProvider.ts

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -462,12 +462,19 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
462462
}
463463

464464
public async getPearAIAgentModels() {
465-
const response = await fetch(`${PEARAI_URL}/getPearAIAgentModels`)
466-
if (!response.ok) {
467-
throw new Error(`Failed to fetch models: ${response.statusText}`)
465+
try {
466+
const response = await fetch(`${PEARAI_URL}/getPearAIAgentModels`)
467+
if (!response.ok) {
468+
throw new Error(`Failed to fetch models: ${response.statusText}`)
469+
}
470+
const data = (await response.json()) as PearAIAgentModelsConfig
471+
return data
472+
} catch (error) {
473+
vscode.window.showErrorMessage(
474+
"Failed to fetch PearAI Agent Models. PearAI services may be down, please contact PearAI Support.",
475+
)
476+
return undefined
468477
}
469-
const data = (await response.json()) as PearAIAgentModelsConfig
470-
return data
471478
}
472479

473480
public async initClineWithSubTask(parent: Cline, task?: string, images?: string[]) {
@@ -493,7 +500,15 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
493500
const modePrompt = customModePrompts?.[mode] as PromptComponent
494501
const effectiveInstructions = [globalInstructions, modePrompt?.customInstructions].filter(Boolean).join("\n\n")
495502

496-
const pearaiAgentModels = await this.getPearAIAgentModels()
503+
let pearaiAgentModels
504+
505+
try {
506+
pearaiAgentModels = await this.getPearAIAgentModels()
507+
} catch (error) {
508+
vscode.window.showErrorMessage(
509+
"Failed to fetch PearAI Agent Models. PearAI services may be down, please contact PearAI Support.",
510+
)
511+
}
497512

498513
const cline = new Cline({
499514
provider: this,
@@ -655,7 +670,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
655670
<script nonce="${nonce}">
656671
window.IMAGES_BASE_URI = "${imagesUri}"
657672
</script>
658-
<title>Roo Code</title>
673+
<title>Agent</title>
659674
</head>
660675
<body>
661676
<div id="root"></div>

src/integrations/editor/DiffViewProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ export class DiffViewProvider {
299299
query: Buffer.from(this.originalContent ?? "").toString("base64"),
300300
}),
301301
uri,
302-
`${fileName}: ${fileExists ? "Original ↔ Roo's Changes" : "New File"} (Editable)`,
302+
`${fileName}: ${fileExists ? "Original ↔ Agent's Changes" : "New File"} (Editable)`,
303303
)
304304
// This may happen on very slow machines ie project idx
305305
setTimeout(() => {

0 commit comments

Comments
 (0)