fix: 如实显示型号不存在提示并简化飞书异常回复

This commit is contained in:
ar51
2026-10-22 17:10:10 +08:00
parent d5eef9de57
commit a017c4b48c
4 changed files with 164 additions and 69 deletions

View File

@@ -60,11 +60,28 @@ Rules and expected results:
- a valid API date in another calendar year remains usable without a local holiday calendar;
- accept zero workdays; reject negative, fractional, boolean, or non-numeric workday values and invalid dates;
- if either new field is missing or invalid, report the lead-time result as unavailable instead of falling back to old fields or estimating;
- a stopped original-model reply includes `原因:` identifying each missing, empty, or invalid field and a suggestion to check the API data; no record is appended;
- a stopped original-model reply includes `原因:` identifying each missing, empty, or invalid item in everyday Chinese and a suggestion to check the query result; no record is appended;
- each unavailable candidate is listed with its own reason; HTTP 404 or missing fields must not be summarized as a confirmed nonexistent model;
- controlled-query failures show their safe category (configuration, authentication/permissions, HTTP, TLS, DNS/network, timeout, or JSON format), without displaying raw response bodies or secret-bearing error strings;
- controlled-query failures explain their safe known cause in everyday Chinese, without HTTP codes, TLS, DNS, JSON, API Key, field-type requirements, arbitrary response bodies, or secret-bearing error strings;
- choose the fastest candidate using the API workday count, even when the natural-day totals would rank candidates differently.
## Sample 1C | Product Model Not Found Notice
Local mocked response, matching AR51's screenshot:
```json
{"success": true, "data": "产品型号不存在,请检查产品型号是否正确"}
```
Expected:
- for `eRob70H50I-FS-18CNC[V5]`, quantity 5, show `查询系统提示:产品型号不存在,请检查产品型号是否正确。`;
- if this is the original model, stop before candidate queries and record append, with the reason and a plain-language suggestion to check the input;
- if this is a candidate, retain its batch position and show its own system notice under `不可用候选`, for both initial and continuation batches;
- do not show `data 格式错误` or assume a delivery date from `success=true`;
- unknown text and missing/unreadable query results must not be labeled as confirmed nonexistent models or echoed verbatim; explain the known issue in everyday Chinese;
- the fixed disclaimer appears once at the end, and no new dependency or configuration is required.
## Sample 1A | Continue With Other Candidates
Preconditions:

View File

@@ -129,10 +129,11 @@ Do not use temporary curl, WebFetch, or any API method outside the controlled sc
## Unavailable Result Reasons
- When the original model has no usable result, stop before recording and include a separate `原因:` line. Identify missing or empty `data` / `交期汇总` objects, or each missing, empty, or invalid required workday/date field. If old lead-time fields were returned, explain that they cannot substitute for the required fields.
- When the original model has no usable result, stop before recording and include a separate `原因:` line. Explain missing/empty query results, missing/empty delivery summaries, or missing/empty/invalid workday counts and delivery dates in everyday Chinese. If other lead-time information was returned, explain that it cannot replace the required workday count and final delivery date.
- If `data` is the known business notice `产品型号不存在,请检查产品型号是否正确`, show `查询系统提示:产品型号不存在,请检查产品型号是否正确。` in both original-model errors and unavailable candidates, including continuation batches. This is a business result even when `success=true`; do not mislabel it as a response-format error. This notice does not provide a delivery prediction.
- Mention missing BOM only when the response explicitly marks it as absent. Field omissions alone do not establish that a model does not exist or that materials are short.
- Preserve a separate reason for every unavailable candidate in initial and continuation replies; do not merge them into `不存在或接口未返回交期汇总`.
- For controlled-query failures, explain the known category: missing API Key, HTTP status and its meaning, TLS validation, DNS/connection failure, timeout, or response-format failure. Do not copy raw error messages, response bodies, secrets, or ERP details into replies.
- For controlled-query failures, explain the known cause in everyday Chinese, such as incomplete setup, failed identity verification, missing permission, frequent queries, unavailable service, connection failure, timeout, or unreadable results. Do not show `data`, JSON, HTTP codes, TLS, DNS, API Key, field-type requirements, or other implementation details in Feishu replies. Do not copy arbitrary error messages, response bodies, secrets, or ERP details; only the explicitly recognized business notice above may be displayed as a system notice.
- If no deeper service-side cause can be confirmed, explicitly say it was not provided and needs runtime/service-log verification. Do not invent a business cause. Keep the fixed disclaimer once at the end.
## Shortage Material Names Rule