beast-agent 2.2.0 → 2.2.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/agent/llm.js +1 -0
- package/src/main.js +48 -0
package/package.json
CHANGED
package/src/agent/llm.js
CHANGED
package/src/main.js
CHANGED
|
@@ -6907,6 +6907,35 @@ async function testZenModels(key, models) {
|
|
|
6907
6907
|
return results;
|
|
6908
6908
|
}
|
|
6909
6909
|
|
|
6910
|
+
/* REASONING PROBU: model düşünüyor mu? reasoning_effort:'low' ile minik istek —
|
|
6911
|
+
200 → destekliyor (bir şey yapma), 400 → desteklemiyor (model-caps'e yazılır,
|
|
6912
|
+
kullanıcı düşünmeyi açsa bile o modelde parametre hiç gönderilmez).
|
|
6913
|
+
Diğer statuslar (429/5xx) kararsızdır — hüküm verilmez. */
|
|
6914
|
+
async function testZenReasoning(key, model) {
|
|
6915
|
+
try {
|
|
6916
|
+
const res = await fetch(ZEN_BASE + '/chat/completions', {
|
|
6917
|
+
method: 'POST',
|
|
6918
|
+
headers: { 'Content-Type': 'application/json', Authorization: 'Bearer ' + key },
|
|
6919
|
+
body: JSON.stringify({
|
|
6920
|
+
model,
|
|
6921
|
+
messages: [{ role: 'user', content: 'ping' }],
|
|
6922
|
+
max_tokens: 8,
|
|
6923
|
+
stream: false,
|
|
6924
|
+
reasoning_effort: 'low',
|
|
6925
|
+
}),
|
|
6926
|
+
signal: AbortSignal.timeout(25000),
|
|
6927
|
+
});
|
|
6928
|
+
if (res.ok) return true;
|
|
6929
|
+
if (res.status === 400) {
|
|
6930
|
+
try { await res.text(); } catch {}
|
|
6931
|
+
return false;
|
|
6932
|
+
}
|
|
6933
|
+
return null;
|
|
6934
|
+
} catch {
|
|
6935
|
+
return null;
|
|
6936
|
+
}
|
|
6937
|
+
}
|
|
6938
|
+
|
|
6910
6939
|
ipcMain.handle('zen:oneClick', async () => {
|
|
6911
6940
|
try {
|
|
6912
6941
|
/* 1) token zaten var mı? (env / auth.json) */
|
|
@@ -6947,6 +6976,25 @@ ipcMain.handle('zen:oneClick', async () => {
|
|
|
6947
6976
|
};
|
|
6948
6977
|
}
|
|
6949
6978
|
const entry = applyZenProvider(key, models);
|
|
6979
|
+
/* reasoning probu: desteklemeyen free modelleri ÖNCEDEN model-caps.json'a
|
|
6980
|
+
yaz — kullanıcının düşünme seviyesi açıkken bile bu modellerde
|
|
6981
|
+
reasoning_effort hiç gönderilmez, ilk istekte 400 turu yaşanmaz */
|
|
6982
|
+
try {
|
|
6983
|
+
const llmMod = require('./agent/llm');
|
|
6984
|
+
llmMod.setCapsFile(path.join(beastDir(), 'model-caps.json'));
|
|
6985
|
+
const noReason = [];
|
|
6986
|
+
const RBATCH = 4;
|
|
6987
|
+
for (let i = 0; i < models.length; i += RBATCH) {
|
|
6988
|
+
const rs = await Promise.all(models.slice(i, i + RBATCH).map((m) => testZenReasoning(key, m)));
|
|
6989
|
+
rs.forEach((r, j) => { if (r === false) noReason.push(models[i + j]); });
|
|
6990
|
+
}
|
|
6991
|
+
for (const m of noReason) {
|
|
6992
|
+
llmMod.learnCaps({ providerId: 'custom:' + ZEN_PRESET_ID, model: m }, { noReasoning: true });
|
|
6993
|
+
}
|
|
6994
|
+
if (noReason.length) {
|
|
6995
|
+
log.info('main', 'zen: reasoning desteklemeyenler (caps yazıldı) → ' + noReason.join(', '));
|
|
6996
|
+
}
|
|
6997
|
+
} catch {}
|
|
6950
6998
|
/* hiç model seçili değilse ilk ÇALIŞAN modeli varsayılan yap */
|
|
6951
6999
|
try {
|
|
6952
7000
|
if (!engine.publicState().activeModel) {
|