zames_pro 2.9.2 → 2.9.3

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.
Files changed (2) hide show
  1. package/dist/agent-loop.js +18 -7
  2. package/package.json +1 -1
@@ -80,6 +80,8 @@ export async function runAgentLoop({ browser, tools, task, workdir, maxIteration
80
80
  // chatty model.
81
81
  let looksDoneRetries = 0;
82
82
  const MAX_LOOKSDONE_RETRIES = 3;
83
+ let plainTextRetries = 0;
84
+ const MAX_PLAINTEXT_RETRIES = 5;
83
85
  // Watchdog against the agent emitting a tool call and then going silent.
84
86
  // After a tool result the expected next answer is a fresh tool call; if we
85
87
  // instead get an EMPTY answer or the EXACT same answer as the previous turn
@@ -217,16 +219,25 @@ export async function runAgentLoop({ browser, tools, task, workdir, maxIteration
217
219
  'сообщением оператору.';
218
220
  continue;
219
221
  }
220
- // All re-ask attempts are exhausted, yet the answer still looks like a
221
- // tool call. Most likely this is a silent stall: we show the operator a
222
- // warning in the terminal (not only in the transcript) so they see the
223
- // problem immediately instead of wondering why the agent stalled.
222
+ // STRICT: only tool calls and respond reach the operator. Plain text is
223
+ // a protocol violation: re-ask for a tool call instead of printing it.
224
+ if (plainTextRetries < MAX_PLAINTEXT_RETRIES) {
225
+ plainTextRetries++;
226
+ transcript?.log('plaintext_retry', {
227
+ attempt: plainTextRetries,
228
+ response: rawResponse.slice(0, 500),
229
+ });
230
+ message =
231
+ 'Only call tools. Do not write plain text. ' +
232
+ 'If the task is done - call respond with the final message. ' +
233
+ 'Otherwise reply with EXACTLY one JSON tool-call object, no text around it.';
234
+ continue;
235
+ }
224
236
  if (responseLooksLikeToolCall(rawResponse)) {
225
237
  transcript?.log('suspicious_final', { response: rawResponse });
226
- onWarning(translate(locale)('msg.suspicious_stop'));
227
238
  }
228
- onAssistantMessage(rawResponse);
229
- transcript?.log('assistant_final', { message: rawResponse });
239
+ transcript?.log('plaintext_final', { message: rawResponse });
240
+ onWarning(translate(locale)('msg.suspicious_stop'));
230
241
  return rawResponse;
231
242
  }
232
243
  const calls = Array.isArray(parsed) ? parsed : [parsed];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zames_pro",
3
- "version": "2.9.2",
3
+ "version": "2.9.3",
4
4
  "description": "Terminal coding agent over chat.deepseek.com via Playwright",
5
5
  "type": "module",
6
6
  "bin": {