feat: enhance Codex agent connection handling with automatic thread recovery and improved error logging

This commit is contained in:
HouYunFei
2026-07-05 23:40:54 +08:00
parent 6113986637
commit 3080d6da10
9 changed files with 154 additions and 37 deletions
+5 -2
View File
@@ -52,6 +52,7 @@ export type WebdavSyncConfig = {
directory: string;
lastSyncedAt: string;
};
export type ConfigTabKey = "channels" | "models" | "preferences" | "webdav" | "codex";
export const CONFIG_STORE_KEY = "infinite-canvas:ai_config_store";
export type ModelCapability = "image" | "video" | "text" | "audio";
@@ -111,11 +112,12 @@ type ConfigStore = {
config: AiConfig;
webdav: WebdavSyncConfig;
isConfigOpen: boolean;
configTab: ConfigTabKey;
shouldPromptContinue: boolean;
updateConfig: <K extends keyof AiConfig>(key: K, value: AiConfig[K]) => void;
updateWebdavConfig: <K extends keyof WebdavSyncConfig>(key: K, value: WebdavSyncConfig[K]) => void;
isAiConfigReady: (config: AiConfig, model: string) => boolean;
openConfigDialog: (shouldPromptContinue?: boolean) => void;
openConfigDialog: (shouldPromptContinue?: boolean, tab?: ConfigTabKey) => void;
setConfigDialogOpen: (isOpen: boolean) => void;
clearPromptContinue: () => void;
};
@@ -171,6 +173,7 @@ export const useConfigStore = create<ConfigStore>()(
config: defaultConfig,
webdav: defaultWebdavSyncConfig,
isConfigOpen: false,
configTab: "channels",
shouldPromptContinue: false,
updateConfig: (key, value) =>
set((state) => ({
@@ -187,7 +190,7 @@ export const useConfigStore = create<ConfigStore>()(
},
})),
isAiConfigReady: (config, model) => isAiConfigReady(config, model),
openConfigDialog: (shouldPromptContinue = false) => set({ isConfigOpen: true, shouldPromptContinue }),
openConfigDialog: (shouldPromptContinue = false, configTab = "channels") => set({ isConfigOpen: true, shouldPromptContinue, configTab }),
setConfigDialogOpen: (isConfigOpen) => set({ isConfigOpen }),
clearPromptContinue: () => set({ shouldPromptContinue: false }),
}),