refactor(agent-runtime, shipping-notice, frontend): 重构上下文体系,修复重试RPA无响应问题
- 替换原有的hxops_context模块为全新的代理运行时上下文平台协议,统一跨业务上下文注入逻辑 - 新增多语言操作繁忙提示文案(覆盖中、繁、英、泰四语),前端绑定页面繁忙状态实现操作阻断 - 调整RPA库存导出重试策略:移除可配置的最大自动重试次数,改为固定单次自动重试,手动重试需用户显式触发 - 优化任务用户态状态展示逻辑,优先展示具体的pending原因而非通用状态文案 - 重构任务焦点切换逻辑,统一事件日志与处理流程,复用switch_batch_focus工具函数 - 修复clearAllHistory函数残留UI问题,确保清空会话后完全复位发货通知相关视图 - 更新OpenAPI文档与静态快照,补充工具使用约束说明 - 新增调试打点日志与问题排查文档,完善全套单元测试与快照校验用例 - 更新RPA脚本的README文档,调整登录方式说明与浏览器 profile 路径配置 - 删除废弃的hxops_context模块,迁移所有相关调用到新的上下文体系
This commit is contained in:
1 parent
60dd0c0f58
commit
8846ce159f
102 files changed
+18289
-9072
No files matched your search
@@ -5,6 +5,7 @@
|
||||
* 逻辑:上游由 useChatShipping 与 shipping/* handler 调用本文件;本文件统一请求工作台后端 `/api/workspace/*` 路由并抛出标准错误。
|
||||
*/
|
||||
import { BusinessError, requestJson } from '@/shared/api/client';
|
||||
import { reportShippingDebugEvent } from '../shipping/shippingDebugReporter';
|
||||
import type {
|
||||
ShippingBatchSummary,
|
||||
ShippingBatchUiState,
|
||||
@@ -54,6 +55,11 @@ function assertShippingOk<T extends ShippingApiStatusPayload>(body: T): T {
|
||||
return body;
|
||||
}
|
||||
|
||||
// #region debug-point E:workspace-api
|
||||
const reportRetryRpaDebug = (hypothesisId: string, msg: string, data: Record<string, unknown>) =>
|
||||
reportShippingDebugEvent('shipping.api.ts', hypothesisId, msg, data);
|
||||
// #endregion
|
||||
|
||||
export const listWorkspaceShippingTasks = (params?: { process_status?: string; limit?: number }) => {
|
||||
/** 拉取当前用户可见的发货任务列表。 */
|
||||
const sp = new URLSearchParams();
|
||||
@@ -274,10 +280,26 @@ export async function retryWorkspaceShippingBatchPending(batchNo: string) {
|
||||
* @returns 决策执行结果
|
||||
*/
|
||||
export async function submitWorkspaceShippingDecision(taskNo: string, decision: string, comment?: string) {
|
||||
// #region debug-point E:submit-decision-entry
|
||||
void reportRetryRpaDebug('E', 'submitWorkspaceShippingDecision entry', {
|
||||
taskNo,
|
||||
decision,
|
||||
hasComment: Boolean(comment),
|
||||
});
|
||||
// #endregion
|
||||
const body = await requestJson<ShippingDecisionResponse & ShippingApiStatusPayload>(
|
||||
`/api/workspace/shipping-tasks/${encodeURIComponent(taskNo)}/submit-decision`,
|
||||
jsonPost({ decision, ...(comment ? { comment } : {}) }),
|
||||
);
|
||||
// #region debug-point E:submit-decision-response
|
||||
void reportRetryRpaDebug('E', 'submitWorkspaceShippingDecision response', {
|
||||
taskNo,
|
||||
decision,
|
||||
status: String(body?.status || ''),
|
||||
message: String(body?.message || ''),
|
||||
code: String(body?.code || ''),
|
||||
});
|
||||
// #endregion
|
||||
return assertShippingOk(body);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user