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:
hugo committed 2026-07-03 17:01:42 +08:00
1 parent 60dd0c0f58
commit 8846ce159f
102 files changed
+18289 -9072

No files matched your search

@@ -391,14 +391,16 @@ def serialize_batch_summary(batch: ShippingBatch) -> dict[str, Any]:
}
def serialize_conversation_batch_workspace(batch: ShippingBatch, user_id: int) -> dict[str, Any]:
"""序列化会话工作台中的单个批次,包含批次摘要、任务列表与焦点任务。"""
focus_task = get_focus_task_for_batch(batch.batch_no, user_id)
return {
**serialize_batch_summary(batch),
"tasks": list_batch_task_summaries(batch),
"focus_task": serialize_task_summary(focus_task) if focus_task else None,
}
def serialize_conversation_batch_workspace(batch: ShippingBatch) -> dict[str, Any]:
"""
序列化会话工作台中的单个批次。
核心逻辑:直接复用批次级 UI State 构建器,确保会话级工作台与批次详情页的
`tasks[].ui_state / focus_task_ui_state / action_buttons` 完全同源,避免按钮来源漂移。
"""
from app.services.shipping_notice.ui_state import build_batch_ui_state
return build_batch_ui_state(batch)
def get_conversation_batch_workspace(conversation_id: str, user_id: int) -> dict[str, Any]:
@@ -417,7 +419,7 @@ def get_conversation_batch_workspace(conversation_id: str, user_id: int) -> dict
"conversation_id": value,
"summary": compute_conversation_workspace_summary(ordered_batches),
"batches": [
serialize_conversation_batch_workspace(batch, user_id)
serialize_conversation_batch_workspace(batch)
for batch in ordered_batches
],
}