@pikecode/api-key-manager 2.1.1 → 2.1.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikecode/api-key-manager",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "A CLI tool for managing and switching multiple API provider configurations",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -195,7 +195,7 @@ class EnvSwitcher extends BaseCommand {
195
195
 
196
196
  // 如果是 Claude Code 的"没有可恢复的会话"错误,自动移除 --continue 参数并重试
197
197
  if (!isCodex &&
198
- error.message.includes('没有可恢复的会话') &&
198
+ error.code === 'NO_CONVERSATION_FOUND' &&
199
199
  selectedLaunchArgs.includes('--continue')) {
200
200
  Logger.info('会话不可用,自动移除 --continue 参数重新启动...');
201
201
  console.log();
@@ -80,7 +80,9 @@ async function executeWithEnv(config, launchArgs = []) {
80
80
  } else {
81
81
  // 检查是否是"没有可恢复会话"的错误
82
82
  if (stderrOutput.includes('No conversation found to continue')) {
83
- reject(new Error('没有可恢复的会话\n提示: 请选择不带 --continue 参数重新开始'));
83
+ const error = new Error('没有可恢复的会话\n提示: 请选择不带 --continue 参数重新开始');
84
+ error.code = 'NO_CONVERSATION_FOUND';
85
+ reject(error);
84
86
  } else {
85
87
  reject(new Error(`Claude Code 异常退出,退出代码: ${code}\n提示: 请检查 API 配置是否正确`));
86
88
  }