mocode-ai 1.9.5 → 1.9.6

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/llm/index.js CHANGED
@@ -329,8 +329,11 @@ export function isContextLengthError(err) {
329
329
  const msg = typeof e.message === 'string' ? e.message.toLowerCase() : '';
330
330
  if (!msg)
331
331
  return false;
332
+ const requestPayloadLimit = /(?:request|payload|body|history|conversation|input|prompt).{0,48}(?:exceed(?:s|ed|ing)?|too (?:large|long)|(?:is )?(?:over|above)|(?:size|length) limit|limit exceeded|larger than|maximum|max(?:imum)?)/.test(msg) ||
333
+ /(?:exceed(?:s|ed|ing)?|too (?:large|long)|(?:is )?(?:over|above)|limit exceeded|maximum|max(?:imum)?).{0,48}(?:request|payload|body|history|conversation|input|prompt)/.test(msg);
332
334
  return (/context[_ ]length|context window|maximum context|too many tokens|string_above_max_length/.test(msg) ||
333
335
  /(input|prompt|context|request).{0,20}too (long|large)|exceeds? the (model|maximum|context)/.test(msg) ||
336
+ requestPayloadLimit ||
334
337
  /reduce the length|上下文(长度)?(超|过)|超出.*上下文|请求过长|长度超过|token 数?超过/.test(msg));
335
338
  }
336
339
  export function classifyChatError(msg) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mocode-ai",
3
- "version": "1.9.5",
3
+ "version": "1.9.6",
4
4
  "description": "终端编码 agent:LLM + tool-call 循环 + 流式输出(含思考)+ 27 个工具,接任意 OpenAI 兼容后端。",
5
5
  "type": "module",
6
6
  "bin": {