@pikecode/api-key-manager 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/switch.js +25 -1
package/package.json
CHANGED
package/src/commands/switch.js
CHANGED
|
@@ -192,7 +192,31 @@ class EnvSwitcher extends BaseCommand {
|
|
|
192
192
|
|
|
193
193
|
} catch (error) {
|
|
194
194
|
UIHelper.clearLoadingAnimation(loadingInterval);
|
|
195
|
-
|
|
195
|
+
|
|
196
|
+
// 如果是 Claude Code 的"没有可恢复的会话"错误,自动移除 --continue 参数并重试
|
|
197
|
+
if (!isCodex &&
|
|
198
|
+
error.message.includes('没有可恢复的会话') &&
|
|
199
|
+
selectedLaunchArgs.includes('--continue')) {
|
|
200
|
+
Logger.info('会话不可用,自动移除 --continue 参数重新启动...');
|
|
201
|
+
console.log();
|
|
202
|
+
|
|
203
|
+
const retryArgs = selectedLaunchArgs.filter(arg => arg !== '--continue');
|
|
204
|
+
const retryLoadingInterval = UIHelper.createLoadingAnimation('正在重新启动(无历史恢复)...');
|
|
205
|
+
|
|
206
|
+
try {
|
|
207
|
+
await markProviderAsCurrent(this.configManager, provider, retryArgs);
|
|
208
|
+
UIHelper.clearLoadingAnimation(retryLoadingInterval);
|
|
209
|
+
|
|
210
|
+
console.log(UIHelper.createCard('准备就绪', `环境配置完成,正在启动 🚀 ${ideDisplayName}(新会话)...`, UIHelper.icons.success));
|
|
211
|
+
console.log();
|
|
212
|
+
await launchProviderProcess(provider, retryArgs);
|
|
213
|
+
} catch (retryError) {
|
|
214
|
+
UIHelper.clearLoadingAnimation(retryLoadingInterval);
|
|
215
|
+
throw retryError;
|
|
216
|
+
}
|
|
217
|
+
} else {
|
|
218
|
+
throw error;
|
|
219
|
+
}
|
|
196
220
|
}
|
|
197
221
|
|
|
198
222
|
} catch (error) {
|