zames_pro 2.29.5 → 2.29.7
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/dist/browser.js +44 -18
- package/dist/config.js +7 -0
- package/dist/i18n.js +6 -2
- package/dist/index.js +15 -5
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -1740,6 +1740,17 @@ export class DeepSeekBrowser {
|
|
|
1740
1740
|
// code and the agent hung on "Stopped" until the timeout.
|
|
1741
1741
|
if (this._netCaptureAt >= this._lastSentAt &&
|
|
1742
1742
|
isGenerationIncompleteText(this._netBody)) {
|
|
1743
|
+
// PREFER the Continue button: it RESUMES the same truncated turn (a
|
|
1744
|
+
// `chat/continue` request). Resending the prompt creates a NEW turn and
|
|
1745
|
+
// duplicates the work. Only resend when there is no button to click.
|
|
1746
|
+
if (this.autoContinue && (await this._clickContinueIfVisible())) {
|
|
1747
|
+
this._askDebug('CLICKED Continue (incomplete, start-loop)');
|
|
1748
|
+
this._netBody = '';
|
|
1749
|
+
this._netCaptureAt = 0;
|
|
1750
|
+
this._netNoAnswer = false;
|
|
1751
|
+
await this.page.waitForTimeout(500);
|
|
1752
|
+
continue;
|
|
1753
|
+
}
|
|
1743
1754
|
throw new GenerationIncompleteError(this._netBody.slice(-300));
|
|
1744
1755
|
}
|
|
1745
1756
|
// A FINISHED turn with NO answer (only reasoning): the UI shows a
|
|
@@ -1837,7 +1848,20 @@ export class DeepSeekBrowser {
|
|
|
1837
1848
|
// treating this as "send failed" and hammering Enter.
|
|
1838
1849
|
if (this._netCaptureAt >= this._lastSentAt &&
|
|
1839
1850
|
(isGenerationIncompleteText(this._netBody) || this._netNoAnswer)) {
|
|
1840
|
-
|
|
1851
|
+
// Prefer Continue (resumes the same turn); resend only if unavailable.
|
|
1852
|
+
if (this.autoContinue && (await this._clickContinueIfVisible())) {
|
|
1853
|
+
this._askDebug('CLICKED Continue (incomplete, pre-loop)');
|
|
1854
|
+
this._netBody = '';
|
|
1855
|
+
this._netCaptureAt = 0;
|
|
1856
|
+
this._netNoAnswer = false;
|
|
1857
|
+
await this.page.waitForTimeout(500);
|
|
1858
|
+
started = true;
|
|
1859
|
+
// fall through to the finish loop by NOT returning here
|
|
1860
|
+
lastStartCur = cur;
|
|
1861
|
+
}
|
|
1862
|
+
else {
|
|
1863
|
+
throw new GenerationIncompleteError(this._netBody.slice(-300));
|
|
1864
|
+
}
|
|
1841
1865
|
}
|
|
1842
1866
|
if (cur &&
|
|
1843
1867
|
cur.trim() &&
|
|
@@ -1905,30 +1929,32 @@ export class DeepSeekBrowser {
|
|
|
1905
1929
|
throw new ServerBusyError(pageText.slice(0, 300));
|
|
1906
1930
|
}
|
|
1907
1931
|
}
|
|
1908
|
-
// The server truncated the turn (generation_err / INCOMPLETE)
|
|
1909
|
-
//
|
|
1910
|
-
//
|
|
1911
|
-
//
|
|
1912
|
-
// Runs on the RAW `_netBody` (a truncated body has no RESPONSE,
|
|
1913
|
-
// `_netCapture` is empty and the old guard was dead code).
|
|
1914
|
-
|
|
1915
|
-
isGenerationIncompleteText(this._netBody)
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
// A FINISHED turn with NO answer (only reasoning): the UI shows a
|
|
1919
|
-
// Continue button. Click it and keep waiting — otherwise the loop spins
|
|
1920
|
-
// to the deadline on an empty answer and the operator sees "Stopped".
|
|
1921
|
-
if (this._netNoAnswer &&
|
|
1922
|
-
this._netCaptureAt >= this._lastSentAt &&
|
|
1923
|
-
this.autoContinue) {
|
|
1932
|
+
// The server truncated the turn (generation_err / INCOMPLETE) or ended
|
|
1933
|
+
// it with only reasoning. PREFER the Continue button: it RESUMES the
|
|
1934
|
+
// same turn (`chat/continue`). Resending the prompt creates a NEW turn
|
|
1935
|
+
// and duplicates the work — only do that when there is no button to
|
|
1936
|
+
// click. Runs on the RAW `_netBody` (a truncated body has no RESPONSE,
|
|
1937
|
+
// so `_netCapture` is empty and the old guard was dead code).
|
|
1938
|
+
const truncated = this._netCaptureAt >= this._lastSentAt &&
|
|
1939
|
+
isGenerationIncompleteText(this._netBody);
|
|
1940
|
+
const noAnswer = this._netNoAnswer && this._netCaptureAt >= this._lastSentAt;
|
|
1941
|
+
if ((truncated || noAnswer) && this.autoContinue) {
|
|
1924
1942
|
if (await this._clickContinueIfVisible()) {
|
|
1925
|
-
this._askDebug('CLICKED Continue (
|
|
1943
|
+
this._askDebug('CLICKED Continue (finish-loop, truncated=' +
|
|
1944
|
+
truncated +
|
|
1945
|
+
' noAnswer=' +
|
|
1946
|
+
noAnswer +
|
|
1947
|
+
')');
|
|
1948
|
+
this._netBody = '';
|
|
1926
1949
|
this._netNoAnswer = false;
|
|
1927
1950
|
this._netCaptureAt = 0;
|
|
1928
1951
|
await this.page.waitForTimeout(500);
|
|
1929
1952
|
continue;
|
|
1930
1953
|
}
|
|
1931
1954
|
}
|
|
1955
|
+
if (truncated) {
|
|
1956
|
+
throw new GenerationIncompleteError(this._netBody.slice(-300));
|
|
1957
|
+
}
|
|
1932
1958
|
// Reasoning-mode pause: DeepSeek caps the THINK phase and shows a
|
|
1933
1959
|
// Continue button; the model does not resume by itself. Click it so the
|
|
1934
1960
|
// answer keeps flowing instead of waiting for the operator.
|
package/dist/config.js
CHANGED
|
@@ -46,6 +46,7 @@ export const DEFAULTS = {
|
|
|
46
46
|
maxIncompleteRetries: 4,
|
|
47
47
|
incompleteWaitMs: 2000,
|
|
48
48
|
autoContinue: true,
|
|
49
|
+
resendPromptOnResume: false,
|
|
49
50
|
deepThinking: false,
|
|
50
51
|
webSearch: true,
|
|
51
52
|
auth: {
|
|
@@ -255,6 +256,12 @@ export const CONFIG_SCHEMA = [
|
|
|
255
256
|
labelKey: 'cfg.f.browser_autoContinue',
|
|
256
257
|
groupKey: 'cfg.group.browser',
|
|
257
258
|
},
|
|
259
|
+
{
|
|
260
|
+
path: 'browser.resendPromptOnResume',
|
|
261
|
+
type: 'boolean',
|
|
262
|
+
labelKey: 'cfg.f.browser_resendPromptOnResume',
|
|
263
|
+
groupKey: 'cfg.group.browser',
|
|
264
|
+
},
|
|
258
265
|
{
|
|
259
266
|
path: 'browser.deepThinking',
|
|
260
267
|
type: 'boolean',
|
package/dist/i18n.js
CHANGED
|
@@ -534,8 +534,8 @@ const CATALOG = {
|
|
|
534
534
|
en: '⚠ No answer yet ({attempt}/{max}): {error} — retrying...',
|
|
535
535
|
},
|
|
536
536
|
'ds.incomplete_retry': {
|
|
537
|
-
ru: '⏳ DeepSeek оборвал ответ
|
|
538
|
-
en: '⏳ DeepSeek truncated the answer
|
|
537
|
+
ru: '⏳ DeepSeek оборвал ответ — жму «Continue», чтобы продолжить (повтор {attempt}/{max})...',
|
|
538
|
+
en: '⏳ DeepSeek truncated the answer — clicking Continue to resume (retry {attempt}/{max})...',
|
|
539
539
|
},
|
|
540
540
|
'ds.incomplete_give_up': {
|
|
541
541
|
ru: '✖ DeepSeek {attempt} раз подряд оборвал ответ, не дойдя до конца. Возможно, включён режим размышления — попробуй выключить его (browser.deepThinking) или повтори позже.',
|
|
@@ -878,6 +878,10 @@ const CATALOG = {
|
|
|
878
878
|
ru: 'Автонажатие кнопки Continue (режим размышления)',
|
|
879
879
|
en: 'Auto-click Continue (reasoning mode)',
|
|
880
880
|
},
|
|
881
|
+
'cfg.f.browser_resendPromptOnResume': {
|
|
882
|
+
ru: 'Пересылать системный промпт при возобновлении чата',
|
|
883
|
+
en: 'Resend the system prompt on chat resume',
|
|
884
|
+
},
|
|
881
885
|
'cfg.f.browser_deepThinking': {
|
|
882
886
|
ru: 'Глубокое мышление (долго; размышления не выводятся)',
|
|
883
887
|
en: 'Deep thinking (slow; reasoning is hidden)',
|
package/dist/index.js
CHANGED
|
@@ -1114,7 +1114,8 @@ async function main() {
|
|
|
1114
1114
|
console.log(theme.system(t('msg.opening_chat', { id: resumeId })));
|
|
1115
1115
|
await browser.openChat(resumeId);
|
|
1116
1116
|
freshChat = false;
|
|
1117
|
-
sendSystemPrompt =
|
|
1117
|
+
sendSystemPrompt =
|
|
1118
|
+
resendPrompt || config.browser.resendPromptOnResume === true;
|
|
1118
1119
|
saveLastChat(resumeId, currentWorkdir);
|
|
1119
1120
|
}
|
|
1120
1121
|
catch (e) {
|
|
@@ -1142,6 +1143,11 @@ async function main() {
|
|
|
1142
1143
|
console.log(theme.system(t('msg.queue_hint')));
|
|
1143
1144
|
let freshChatNext = true;
|
|
1144
1145
|
let sendSystemPromptNext = true;
|
|
1146
|
+
// Resuming an existing chat already has the system-prompt at its start, so
|
|
1147
|
+
// resending it is wasteful and pollutes the context. Default: do NOT resend.
|
|
1148
|
+
// `--resend-prompt` or `browser.resendPromptOnResume` forces it (e.g. when
|
|
1149
|
+
// the prompt/tools changed).
|
|
1150
|
+
const promptOnResume = () => resendPrompt || config.browser.resendPromptOnResume === true;
|
|
1145
1151
|
let lastChats = [];
|
|
1146
1152
|
let currentChatId = null;
|
|
1147
1153
|
let running = true;
|
|
@@ -1187,7 +1193,7 @@ async function main() {
|
|
|
1187
1193
|
await browser.openChat(resumeId);
|
|
1188
1194
|
currentChatId = resumeId;
|
|
1189
1195
|
freshChatNext = false;
|
|
1190
|
-
sendSystemPromptNext =
|
|
1196
|
+
sendSystemPromptNext = promptOnResume();
|
|
1191
1197
|
saveLastChat(resumeId, currentWorkdir);
|
|
1192
1198
|
console.log(theme.system(t('msg.chat_opened') + ' ' + resumeId + String.fromCharCode(10)));
|
|
1193
1199
|
await printRestoredHistory(browser, null, resumeId);
|
|
@@ -1892,11 +1898,15 @@ async function main() {
|
|
|
1892
1898
|
await browser.openChat(pick.id);
|
|
1893
1899
|
currentChatId = pick.id;
|
|
1894
1900
|
freshChatNext = false;
|
|
1895
|
-
sendSystemPromptNext =
|
|
1901
|
+
sendSystemPromptNext = promptOnResume();
|
|
1896
1902
|
saveLastChat(pick.id, currentWorkdir, pick.title);
|
|
1897
1903
|
transcript.log('resume_chat', { id: pick.id, title: pick.title });
|
|
1898
1904
|
console.log(theme.assistant(t('msg.chat_opened')) +
|
|
1899
|
-
theme.system(
|
|
1905
|
+
theme.system(sendSystemPromptNext
|
|
1906
|
+
? String.fromCharCode(10) +
|
|
1907
|
+
' Системный промпт будет переслан на следующей задаче.\n'
|
|
1908
|
+
: String.fromCharCode(10) +
|
|
1909
|
+
' Системный промпт НЕ пересылается (он уже в начале чата). Включить: /config set browser.resendPromptOnResume true.\n'));
|
|
1900
1910
|
await printRestoredHistory(browser, editor, pick.id);
|
|
1901
1911
|
}
|
|
1902
1912
|
catch (e) {
|
|
@@ -1950,7 +1960,7 @@ async function main() {
|
|
|
1950
1960
|
await browser.openChat(id);
|
|
1951
1961
|
currentChatId = id;
|
|
1952
1962
|
freshChatNext = false;
|
|
1953
|
-
sendSystemPromptNext =
|
|
1963
|
+
sendSystemPromptNext = promptOnResume();
|
|
1954
1964
|
saveLastChat(id, currentWorkdir);
|
|
1955
1965
|
transcript.log('resume_chat', { id });
|
|
1956
1966
|
console.log(theme.assistant('Чат открыт.') +
|