fix: stabilize API routing and simplify delivery reports
This commit is contained in:
@@ -17,6 +17,8 @@ Expected:
|
||||
- original demand 10 remains visible and each model is queried exactly once with quantity 10; stock accounting is handled by the API, with no local inventory deduction, yield adjustment or batch rounding;
|
||||
- the bot immediately adds the Feishu `OnIt` (typing) reaction to the original message after the valid trigger is accepted and before the API query starts;
|
||||
- the controlled script uses the macOS system trust store and keeps TLS verification enabled;
|
||||
- the controlled script defaults to a direct HTTPS connection to `api.zeroerr-agent.com`, ignoring system/environment proxies for this API only; it does not change Feishu or other applications' proxy settings;
|
||||
- an explicit `ZEROERR_AGENT_PROXY_MODE=system` uses the configured proxies; an invalid mode or a non-approved direct target stops before the request, and a failed request does not trigger an automatic proxy fallback or retry;
|
||||
- no temporary TLS-bypass parameter is required for the normal happy path;
|
||||
- API script runs;
|
||||
- output does not expose API key;
|
||||
@@ -25,6 +27,7 @@ Expected:
|
||||
- output omits the `候选明细` heading and does not repeat a human-review line under each candidate;
|
||||
- model differences use the compact `字段 原值→新值` format and join multiple changes with `;`;
|
||||
- Feishu output uses rich-text `post`; the report title, overall-judgment heading, numbered candidate headings, and unavailable-candidate heading are bold;
|
||||
- in initial and continuation replies, the `X个工作日` and final delivery date values are bold in both `最快候选交期` and each model's `AM516预测交期`, using native Feishu rich-text styles without displaying Markdown asterisks;
|
||||
- the judgment level and fixed disclaimer provide the global human-review boundary;
|
||||
- inventory output is limited to summary-level available quantity and coverage; non-reducer shortage output never exposes material codes or raw ERP details;
|
||||
- each usable model includes `缺料物料明细` listing only shortage names, preserving order and deduplicating names; use the API's `物料名称` / `缺料物料名称` first, then resolve `缺料物料` through `data/material_names.json`; the same behavior applies to continuation replies;
|
||||
@@ -244,7 +247,7 @@ python3 capabilities/am516-delivery-prediction/scripts/delivery_prediction_query
|
||||
Expected:
|
||||
|
||||
- the script creates an unverified SSL context only because the flag is explicitly present;
|
||||
- the context is passed to the single controlled `urlopen` call;
|
||||
- the context is passed to the request-local HTTPS handler used by the single controlled `opener.open` call;
|
||||
- the result does not expose the API Key;
|
||||
- a successful response remains an internal candidate and requires human review;
|
||||
- the temporary result does not remove the long-term certificate-repair requirement.
|
||||
@@ -275,5 +278,5 @@ Expected:
|
||||
- D=8/S=5: send 8; D=24/S=6: send 24; D=24/S=0: send 24; D=24/S>=24: still send 24 once and preserve the API response.
|
||||
- Different candidates display their own stock, but all use unchanged original demand. Initial and continuation batches query each current-batch model once.
|
||||
- Missing/invalid stock is unknown, never zero; valid API workdays/date remain usable with an explicit inventory-review item. Missing/invalid workdays/date or failed requests retain existing error handling.
|
||||
- New report and record metadata contain actual API quantities, with no local net-demand or production-quantity fields. Historical records and existing candidate-table columns remain unchanged.
|
||||
- Initial and continuation Feishu reports show demand quantity, lead time and inventory coverage, but omit `数量传递规则`, `库存覆盖口径` and per-model `API查询数量`. Internal record metadata still contains actual API quantities and quantity rules. No local net-demand or production-quantity fields are shown. Historical records and existing candidate-table columns remain unchanged.
|
||||
- These checks use mocked responses locally. Runtime acceptance must verify actual API arguments and compare the displayed workdays/date with the same returned response; mocked dates do not constitute delivery predictions.
|
||||
|
||||
Reference in New Issue
Block a user