feat: 对话区域文件上传(粘贴/拖拽) + XLSX支持 + 会话切换无限循环修复
- 对话区域: st.file_uploader + 全局 paste/drop 事件监听 + sessionStorage 桥接 - 文件预览芯片: 上传后显示在对话区域,可逐文件移除 - OCR 双层解析全面接入: file_parser(文字) + ocr_extractor(字段提取) - XLSX 解析: openpyxl 逐工作表/逐行读取 - 修复: create_session 强制写入 agent_state.session_id - 修复: load_session_node 不再从磁盘覆盖 session_id - 修复: 切换会话 _last_switched_to 哨兵防止无限 rerun Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+3
-1
@@ -38,12 +38,14 @@ def create_session(name: str = "", agent_state: Optional[dict] = None) -> dict:
|
||||
_ensure_dir()
|
||||
sid = generate_session_id()
|
||||
now = _now_iso()
|
||||
agent_state = agent_state or {}
|
||||
agent_state["session_id"] = sid
|
||||
data = {
|
||||
"session_id": sid,
|
||||
"session_name": name or f"新建报表 {now[:10]}",
|
||||
"created_at": now,
|
||||
"updated_at": now,
|
||||
"agent_state": agent_state or {},
|
||||
"agent_state": agent_state,
|
||||
}
|
||||
with open(_session_path(sid), "w", encoding="utf-8") as f:
|
||||
json.dump(data, f, ensure_ascii=False, indent=2)
|
||||
|
||||
Reference in New Issue
Block a user