Skip to content

feat: Claude Code / Codex 聊天记录导入、异步迁移队列与新手引导 Agent 迁移环节 - #159

Merged
21335464876 merged 2 commits into
mainfrom
feat/local-agent-history-migration
Sep 1, 2026
Merged

feat: Claude Code / Codex 聊天记录导入、异步迁移队列与新手引导 Agent 迁移环节#159
21335464876 merged 2 commits into
mainfrom
feat/local-agent-history-migration

Conversation

@lzp-plus

@lzp-plus lzp-plus commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Claude Code / Codex 聊天记录导入:来源页「连接来源」菜单新增入口,自动发现 ~/.claude / ~/.codex(未发现时可选目录),复用 OpenClaw 的迁移记录表展示、重试与重导入
  • 官方品牌图标:新增 claude/codex SVG,替换来源菜单、迁移记录表、设置页与 @ 外部会话选择器中的通用图标
  • 移除导入数量限制:取消 100 文件 / 每会话 200 条 / 单条 20k 字符 / 20MB 上限,保留安全过滤与 mtime 排序
  • 修复请求错误:DELETE/POST 无 body 时不再因固定 Content-Type: application/json 报 "Body cannot be empty";threads 路由提升 bodyLimit,桌面端按内容大小自适应分批
  • 异步迁移流水线:新增 migration_jobs 持久化任务队列——appendThreads 只落库+入队、finish 立即返回、单并发 worker 带 yield 逐个建 memory 索引并自动重试;删除改为软隐藏 + 后台 source_gc 渐进清理;启动 recover() 恢复中断的 run 与 GC,任意时刻重启可续传
  • 流式解析:桌面端逐文件解析、攒批发送,峰值内存从全量历史降为单批
  • 新手引导 Agent 迁移环节:memory 与 room 之间新增 agents 阶段,扫描本机可迁移 Agent,勾选迁移(openclaw 走独立适配器,单项失败不阻塞),无数据可跳过
  • 附带云通知桥与 dev 脚本改进

Test plan

  • pnpm --filter @nxcore/desktop typecheck
  • pnpm --filter @nxcore/gateway exec vitest run tests/data-migrations.test.ts(含软删除 GC、崩溃恢复新用例)
  • desktop 相关测试:local-agent-migration / history / openclaw-adapter / AgentComposer
  • 手动验证:来源页导入 Codex/Claude → 迁移记录展示 → 删除秒级隐藏 → 重启后中断恢复
  • 手动验证:新手引导走完 folder → microphone → memory → agents → room → ready

…ob queue and onboarding stage

- Add Claude Code and Codex entries to the connect-source menu with auto-discovery of ~/.claude and ~/.codex
- Brand icons for claude/codex across sources, settings, and the @ external conversation picker
- Remove import caps (file count, per-session messages, message chars, file size) from local agent history parsing
- Fix DELETE/POST without body failing on Content-Type mismatch in the migrations gateway bridge
- Raise gateway threads body limit and batch thread uploads by content size
- Introduce persistent migration_jobs queue: appendThreads only persists and enqueues memory_index jobs, finish returns immediately, a single-concurrency worker drains with event-loop yields, retries failed jobs, and completes runs
- clear() now soft-hides threads and FTS instantly, then a source_gc job removes memory sessions, catalog entries, and rows in the background; begin() rejects deleting sources
- recover() on startup re-drives stalled runs and resumes GC after crashes
- Stream local agent history parsing file-by-file with adaptive batches to cap peak memory
- Add an agent-migration onboarding stage between memory and room that scans local agents, lets users pick which histories to migrate, and routes openclaw through its own adapter
- Include notification bridge and dev script improvements
@21335464876
21335464876 merged commit 72107fc into main Sep 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants