ylib-syim 0.0.39 → 0.0.40

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/bridges/main.ts +17 -24
  2. package/package.json +1 -1
package/bridges/main.ts CHANGED
@@ -4053,9 +4053,9 @@ function formatRecentErrorContextLogHint(
4053
4053
  "recent_error_context_present=1",
4054
4054
  `context_lookup_hint=search_previous_lines_in_this_log platform=${platform}`,
4055
4055
  `account=${accountId}`,
4056
- "keywords=error|失败|异常|status_code",
4056
+ "match=error_level_same_platform_same_account",
4057
4057
  "exclude=derived_error|status_error|recent_error_context",
4058
- `中文提示=存在额外排障上下文,请在当前日志文件中向前查找同平台(${platform})、同账号(${accountId})、包含error/失败/异常/status_code的日志行,并排除derived_error/status_error/recent_error_context/context_lookup_hint行`,
4058
+ `中文提示=存在额外排障上下文,请在当前日志文件中向前查找同平台(${platform})、同账号(${accountId})error级别的日志行,并排除derived_error/status_error/recent_error_context/context_lookup_hint行`,
4059
4059
  ].join(" ");
4060
4060
  }
4061
4061
 
@@ -4086,13 +4086,20 @@ function readRecentBridgeErrorFromLog(
4086
4086
 
4087
4087
  for (const line of lines) {
4088
4088
  const lower = line.toLowerCase();
4089
+ const trimmed = line.trim();
4090
+ if (!trimmed) continue;
4091
+ if (!/^\[[^\]]+\] \[error\] /.test(trimmed)) continue;
4092
+ const content = trimmed.replace(/^\[[^\]]+\] \[[^\]]+\] /, "");
4093
+ const contentLower = content.toLowerCase();
4089
4094
  if (
4090
- lower.includes("recent_error_context=") ||
4091
- lower.includes("context_lookup_hint=") ||
4092
- lower.includes(" probeaccount derived_error ") ||
4093
- lower.includes(" probe derived_error ") ||
4094
- lower.includes(" probeaccount status_error ") ||
4095
- lower.includes(" probe status_error ")
4095
+ contentLower.includes("recent_error_context=") ||
4096
+ contentLower.includes("context_lookup_hint=") ||
4097
+ contentLower.includes(" probeaccount derived_error ") ||
4098
+ contentLower.includes(" probe derived_error ") ||
4099
+ contentLower.includes(" probeaccount status_error ") ||
4100
+ contentLower.includes(" probe status_error ") ||
4101
+ contentLower.includes(" probeaccount merged_error ") ||
4102
+ contentLower.includes(" probe merged_error ")
4096
4103
  ) {
4097
4104
  continue;
4098
4105
  }
@@ -4104,25 +4111,11 @@ function readRecentBridgeErrorFromLog(
4104
4111
  lower.includes(String(accountId || "").toLowerCase()) ||
4105
4112
  accountId === "__default__";
4106
4113
  if (!hasAccount) continue;
4107
- if (
4108
- !(
4109
- lower.includes("error") ||
4110
- lower.includes("失败") ||
4111
- lower.includes("异常") ||
4112
- lower.includes("status code")
4113
- )
4114
- ) {
4115
- continue;
4116
- }
4117
- const trimmed = line.trim();
4118
- if (!trimmed) continue;
4119
- matched.push(
4120
- trimmed.replace(/^\[[^\]]+\] \[[^\]]+\] /, "").replace(/\r?\n/g, "\\n"),
4121
- );
4114
+ matched.push(content.replace(/\r?\n/g, "\\n"));
4122
4115
  if (matched.length >= runtimeErrorLogFallbackLines) break;
4123
4116
  }
4124
4117
  if (matched.length > 0) {
4125
- return matched.join(" | ").slice(0, 1600);
4118
+ return matched.join("\n").slice(0, 1600);
4126
4119
  }
4127
4120
  } catch {}
4128
4121
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ylib-syim",
3
- "version": "0.0.39",
3
+ "version": "0.0.40",
4
4
  "description": "多 IM / 多 Agent 的会话路由与上下文管理(支持 /new)",
5
5
  "type": "module",
6
6
  "exports": {