qwen-alpha 1.0.17 → 1.0.19
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/README.md +1 -1
- package/package.json +1 -1
- package/src/services/qwenService.js +9 -5
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -93,9 +93,10 @@ class QwenService {
|
|
|
93
93
|
fs.writeFileSync(tempFile, fullPrompt, 'utf-8');
|
|
94
94
|
|
|
95
95
|
// Команда для Qwen — без системного промпта если есть контекст
|
|
96
|
+
// Перенаправляем stderr в /dev/null чтобы избежать интерактивных подсказок
|
|
96
97
|
const command = contextMessages.length > 0
|
|
97
|
-
? `cat '${tempFile}' | qwen -o json`
|
|
98
|
-
: `cat '${tempFile}' | qwen -p "Проанализируй код и дай рекомендации" -o json`;
|
|
98
|
+
? `cat '${tempFile}' | qwen -o json 2>/dev/null`
|
|
99
|
+
: `cat '${tempFile}' | qwen -p "Проанализируй код и дай рекомендации" -o json 2>/dev/null`;
|
|
99
100
|
|
|
100
101
|
logger.debug({ codeLength: code.length, contextLength: contextMessages.length, tempFile }, 'Running Qwen analysis');
|
|
101
102
|
|
|
@@ -169,11 +170,14 @@ class QwenService {
|
|
|
169
170
|
|
|
170
171
|
for (const msg of messages) {
|
|
171
172
|
// Сначала проверяем result сообщение (оно содержит финальный ответ)
|
|
172
|
-
if (msg.type === 'result'
|
|
173
|
-
|
|
174
|
-
|
|
173
|
+
if (msg.type === 'result') {
|
|
174
|
+
logger.debug({ resultType: typeof msg.result, resultLength: msg.result?.length, result: msg.result?.substring?.(0, 100) }, 'Checking result message');
|
|
175
|
+
|
|
176
|
+
// result должен быть строкой
|
|
177
|
+
if (typeof msg.result === 'string') {
|
|
175
178
|
textContents.push(msg.result);
|
|
176
179
|
hasResult = true;
|
|
180
|
+
logger.info({ resultLength: msg.result.length }, 'Found result text');
|
|
177
181
|
break;
|
|
178
182
|
}
|
|
179
183
|
}
|