Skip to content

fix: catch hub org loading errors, fallback to local #6769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

RomneyDa
Copy link
Collaborator

@RomneyDa RomneyDa commented Jul 23, 2025

Description

Catches hub org loading errors


Summary by cubic

Handled errors when loading organizations from Continue Hub by falling back to local assistants if Hub loading fails.

  • Bug Fixes
    • Catches and reports errors during Hub org loading.
    • Ensures local assistants are loaded if Hub orgs cannot be fetched.

@RomneyDa RomneyDa requested a review from a team as a code owner July 23, 2025 18:27
@RomneyDa RomneyDa requested review from tingwai and removed request for a team July 23, 2025 18:27
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 23, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cubic analysis

2 issues found across 1 file • Review in cubic

React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.

configLoadInterrupted,
});

return { config, errors, configLoadInterrupted };
if (injectErrors) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Injected validation errors are added after listeners are notified, so listeners never receive them

Prompt for AI agents
Address the following comment on core/config/ConfigHandler.ts at line 500:

<comment>Injected validation errors are added after listeners are notified, so listeners never receive them</comment>

<file context>
@@ -454,22 +477,35 @@ export class ConfigHandler {
       }
     }
 
-    const { config, errors, configLoadInterrupted } =
-      await this.currentProfile.reloadConfig(this.additionalContextProviders);
+    const {
+      config,
+      errors = [],
+      configLoadInterrupted,
</file context>

...orgDescs.map((org) => this.getNonPersonalHubOrg(org)),
]);
// TODO make try/catch more granular here, to catch specific org errors
return { orgs };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously collected validation errors are silently dropped because the return statement omits the errors array

Prompt for AI agents
Address the following comment on core/config/ConfigHandler.ts at line 188:

<comment>Previously collected validation errors are silently dropped because the return statement omits the errors array</comment>

<file context>
@@ -161,28 +160,52 @@ export class ConfigHandler {
       this.currentOrg = selectedOrg;
       this.currentProfile = selectedOrg.currentProfile;
 
-      await this.reloadConfig(reason);
+      await this.reloadConfig(reason, errors);
     } catch (e) {
-      if (e instanceof Error &amp;&amp; e.message.includes(&quot;AbortError&quot;)) {
+      if (signal.aborted) {
         return;
</file context>
Suggested change
return { orgs };
return { orgs, errors };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files.
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant