Session 重写 - messages 落 PG `messages` 表(append-only, idx 严格递增, jsonb payload) - system prompt 不入库(每次 build_agent 重建到 messages[0],memory 演化即时生效) - Session.load(task_id, system_prompt=...) 从 DB 读历史 - Session.task_exists / n_user_msgs 工具 Storage utils - ensure_local_task_row: 首条消息前 INSERT ... ON CONFLICT DO NOTHING 打底 tasks 行(Step 3 后由 TaskState.save 接管字段更新) task_id 切 UUID - resolve_task_id(workspace, arg, resume): UUID + 前缀匹配,'last' 从 PG 按 updated_at 取最近 - 显示一律截前 8 位;完整 UUID 在 /id /status 保留 - 旧 workspace 老 task(时间戳格式)**不做兼容** CLI 适配 - _cleanup_if_empty 双检查:DB messages count + FS 产物 - _list_task_rows: PG tasks ORDER BY updated_at + state.json 兜底字段 - _task_has_messages: /export 检查改 DB - core/export_docx.py: messages 从 PG 读,state.json 留作 meta Step 5 (migrate-from-fs) 取消。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| config | ||
| core | ||
| db/migrations | ||
| prompts/system | ||
| skills | ||
| tools | ||
| .gitignore | ||
| CLAUDE.md | ||
| DESIGN.md | ||
| PROGRESS.md | ||
| alembic.ini | ||
| cli.py | ||
| main.py | ||
| requirements.txt | ||