@pikecode/api-key-manager 2.1.3 → 2.1.5
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/utils/env-launcher.js +7 -13
package/package.json
CHANGED
|
@@ -59,21 +59,14 @@ async function executeWithEnv(config, launchArgs = []) {
|
|
|
59
59
|
|
|
60
60
|
return new Promise((resolve, reject) => {
|
|
61
61
|
const child = spawn('claude', args, {
|
|
62
|
-
stdio: ['inherit', '
|
|
62
|
+
stdio: ['inherit', 'inherit', 'pipe'],
|
|
63
63
|
env,
|
|
64
64
|
shell: false
|
|
65
65
|
});
|
|
66
66
|
|
|
67
67
|
let stderrOutput = '';
|
|
68
|
-
let stdoutOutput = '';
|
|
69
|
-
|
|
70
|
-
// 捕获 stdout 和 stderr 用于检查错误信息
|
|
71
|
-
child.stdout.on('data', (data) => {
|
|
72
|
-
const output = data.toString();
|
|
73
|
-
stdoutOutput += output;
|
|
74
|
-
process.stdout.write(data);
|
|
75
|
-
});
|
|
76
68
|
|
|
69
|
+
// 捕获 stderr 用于检查错误信息
|
|
77
70
|
child.stderr.on('data', (data) => {
|
|
78
71
|
const output = data.toString();
|
|
79
72
|
stderrOutput += output;
|
|
@@ -85,11 +78,12 @@ async function executeWithEnv(config, launchArgs = []) {
|
|
|
85
78
|
resolve();
|
|
86
79
|
} else {
|
|
87
80
|
// 检查是否是"没有可恢复会话"的错误
|
|
88
|
-
// 检查
|
|
89
|
-
const
|
|
81
|
+
// 检查 stderr 中是否包含各种格式的错误消息
|
|
82
|
+
const errorOutput = stderrOutput.toLowerCase();
|
|
90
83
|
const isNoConversationError =
|
|
91
|
-
|
|
92
|
-
|
|
84
|
+
errorOutput.includes('no conversation found') ||
|
|
85
|
+
errorOutput.includes('no recoverable session') ||
|
|
86
|
+
errorOutput.includes('no deferred tool marker');
|
|
93
87
|
|
|
94
88
|
if (isNoConversationError) {
|
|
95
89
|
const error = new Error('没有可恢复的会话\n提示: 请选择不带 --continue 参数重新开始');
|