Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/hooks/auto-update-checker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ export function createAutoUpdateCheckerHook(ctx: PluginInput, options: AutoUpdat

hasChecked = true

setTimeout(() => {
setTimeout(async () => {
const cachedVersion = getCachedVersion()
const localDevVersion = getLocalDevVersion(ctx.directory)
const displayVersion = localDevVersion ?? cachedVersion

showConfigErrorsIfAny(ctx).catch(() => {})
await showConfigErrorsIfAny(ctx)

if (localDevVersion) {
if (showStartupToast) {
Expand Down
27 changes: 0 additions & 27 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,6 @@ function loadConfigFromPath(configPath: string, ctx: any): OhMyOpenCodeConfig |
const errorMsg = result.error.issues.map(i => `${i.path.join(".")}: ${i.message}`).join(", ");
log(`Config validation error in ${configPath}:`, result.error.issues);
addConfigLoadError({ path: configPath, error: `Validation error: ${errorMsg}` });

const errorList = result.error.issues
.map(issue => `• ${issue.path.join(".")}: ${issue.message}`)
.join("\n");

ctx.client.tui.showToast({
body: {
title: "❌ OhMyOpenCode: Config Validation Failed",
message: `Failed to load ${configPath}\n\nValidation errors:\n${errorList}\n\nConfig will be ignored. Please fix the errors above.`,
variant: "error" as const,
duration: 10000,
},
}).catch(() => {});

return null;
}

Expand All @@ -153,19 +139,6 @@ function loadConfigFromPath(configPath: string, ctx: any): OhMyOpenCodeConfig |
const errorMsg = err instanceof Error ? err.message : String(err);
log(`Error loading config from ${configPath}:`, err);
addConfigLoadError({ path: configPath, error: errorMsg });

const hint = err instanceof SyntaxError
? "\n\nHint: Check for syntax errors in your JSON file (missing commas, quotes, brackets, etc.)"
: "";

ctx.client.tui.showToast({
body: {
title: "❌ OhMyOpenCode: Config Load Failed",
message: `Failed to load ${configPath}\n\nError: ${errorMsg}${hint}\n\nConfig will be ignored. Please fix the error above.`,
variant: "error" as const,
duration: 10000,
},
}).catch(() => {});
}
return null;
}
Expand Down