fix: stabilize API routing and simplify delivery reports

This commit is contained in:
zeroerr.th51
2026-10-16 11:02:03 +08:00
parent bc3dda55ff
commit d5eef9de57
9 changed files with 215 additions and 14 deletions

View File

@@ -60,7 +60,13 @@ continuation wording is flexible: `还有吗`, `有没有别的`, `再推荐几
bridge still requires both continuation intent and valid context, so unrelated
phrases such as `more interesting` or `继续查询英语例句` do not trigger the old query.
The bridge invokes only the existing controlled delivery-prediction script. It
The bridge invokes only the existing controlled delivery-prediction script.
That script defaults to direct HTTPS for `api.zeroerr-agent.com` without
inheriting desktop proxy settings, while keeping certificate verification on.
`ZEROERR_AGENT_PROXY_MODE=system` explicitly restores the configured proxy route
for approved networks that require it. This setting affects only the API script,
not the Feishu connection. See the capability runbook for route diagnostics.
It
generates the full Cartesian
set of candidates allowed by the packaged Skill: brake upgrades, encoder
upgrades, sensor upgrades, low-temperature grease upgrades, and DZ/LF reducer

View File

@@ -837,7 +837,6 @@ def candidate_report_lines(candidate: dict[str, Any], quantity: int) -> list[str
return [
f"{candidate['index']}. {candidate['model']}({candidate['type']})",
f"- 需求数量:{quantity}台",
f"- API查询数量:{details['api_quantity']}台",
f"- {details['prediction']}",
f"- 可用库存/覆盖情况:{details['inventory']}",
f"- 主导因素:{details['main_factor']}",
@@ -1114,8 +1113,6 @@ def build_report(request: RequestInput, candidate_offset: int = 0) -> str:
),
"",
f"输入需求:{request.model},{request.quantity}台",
"数量传递规则:原始需求原样传入API,库存及交期测算由API处理",
"库存覆盖口径:按原始需求数量展示API返回的库存覆盖情况",
f"数据时间戳:{data_timestamp}",
"状态:试运行版输出 / 内部候选",
"判断等级:AM516算法预测参考,需人工复核",
@@ -1157,6 +1154,19 @@ def message_text(data: lark.im.v1.P2ImMessageReceiveV1) -> str | None:
def post_paragraph(line: str) -> list[dict[str, Any]]:
lead_time = re.fullmatch(
r"(- (?:最快候选交期|AM516预测交期):)(\d+个工作日)"
r"(,最终交货日期:)(\d{4}-\d{2}-\d{2})",
line,
)
if lead_time:
label, workdays, date_label, delivery_date = lead_time.groups()
return [
{"tag": "text", "text": label},
{"tag": "text", "text": workdays, "style": ["bold"]},
{"tag": "text", "text": date_label},
{"tag": "text", "text": delivery_date, "style": ["bold"]},
]
element: dict[str, Any] = {"tag": "text", "text": line or " "}
if (
line in {"总体判断:", "本批次判断:", "不可用候选:"}