Files
cc-web/.planning/runtime-image-send/progress.md
2026-07-18 10:14:38 +08:00

117 lines
5.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 进度记录:排队与运行中图片发送
## 2026-07-17
### 阶段 1核对附件生命周期与现有改动边界
- **状态:** complete
- 已完成:
- 读取 `planning-with-files``todo-list-csv` 与 Trellis 工作流。
- 运行 session catchup 并检查工作树,确认存在其他活跃任务及重叠文件改动。
- 使用 `codebase-memory-mcp` 定位队列、普通发送、steer 和 Codex App 输入构造函数。
- 使用本机 Codex 0.144.1 Schema 验证 `turn/steer` 协议接受 `localImage`
- 确认 `resolveMessageAttachments` 提供服务端元数据解析、文件存在性和过期校验,可直接复用于 steer。
- 确认会话持久化已有统一的 `attachments` 归一化入口。
- 核对目标函数所在 diff确认可做局部补丁且不会覆盖当前主题与回归改动。
- 确认 mock 已能把 `localImage` 反映到 steer 输出,测试可直接断言图片文件名。
- 已创建:
- `.planning/runtime-image-send/task_plan.md`
- `.planning/runtime-image-send/findings.md`
- `.planning/runtime-image-send/progress.md`
- `.trellis/tasks/07-17-runtime-image-send/` 下的 PRD、技术设计、研究和代理上下文
### 阶段 2补充失败回归测试
- **状态:** complete
- 已完成:
- 新增 `runtime-image-send` 定向回归目标。
- 覆盖前端队列附件契约、成功 steer 图片、stale fallback 图片与历史持久化。
- 审阅并修正 mock 图片 marker协议断言使用服务端附件 ID历史断言保留原始文件名。
### 阶段 3运行目标回归确认失败
- **状态:** complete
- 已执行:
- `timeout 60s node scripts/regression.js --target runtime-image-send`
- 结果3.8 秒退出,状态码 1active steer、stale replacement、前端队列契约均按预期失败。
### 阶段 4实现前端附件传递
- **状态:** complete
- 已实现:
- 队列附件快照、纯图片校验、摘要、删除清理与出队发送。
- 运行中插入附件气泡、WebSocket 发送和 composer 清空。
- 卡片编辑保留附件,正常出队不误删上传记录。
- 阶段验证:
- `node --check public/app.js` 通过。
- 定向回归中的前端静态契约已通过,剩余失败均为后端。
### 阶段 5实现后端 steer 附件链路
- **状态:** complete
- 已实现:
- `handleMessage` 向 steer 传递已解析附件和去 path 的持久化附件。
- active steer、纯图片、历史保存和 stale replacement 复用附件。
- 最多等待 2 秒获取 ready turn并在持久化前重载最新 session修复两个竞态。
- 阶段验证:
- `node --check server.js` 通过。
- 代理运行定向回归已通过。
### 阶段 6运行目标回归和静态检查
- **状态:** complete
- 已通过:
- `node --check public/app.js`
- `node --check server.js`
- `node --check scripts/regression.js`
- `timeout 60s node scripts/regression.js --target runtime-image-send`4.9 秒)
- `timeout 60s node scripts/regression.js --target codexapp-stale-running`2.9 秒)
- 已通过:
- `timeout 60s node scripts/regression.js`(完整回归)。
### 阶段 7审查差异并修正问题
- **状态:** complete
- 已完成审查:
- 修复 active steer 失效附件只返回普通 error、用户气泡停在 pending 的问题。
- error/status 现在带 sessionId/clientMessageId失败输入不持久化。
- 恢复普通消息“校验通过后才取消容量重试”的原有顺序,避免无关语义变化。
- 主代理复验:
- 三个修改文件的 `node --check` 通过。
- `runtime-image-send` 定向回归通过。
- 完整回归通过。
### 阶段 8检查会话状态并安全重启服务
- **状态:** in_progress
- 待执行:
- 查询当前会话列表并排除本对话。
- 无其他 running 会话时重启并健康检查;否则暂缓。
## 测试结果
| 测试 | 预期 | 实际 | 状态 |
|------|------|------|------|
| 尚未执行 | - | - | 待执行 |
| 定向回归红灯 | `--target runtime-image-send` | 三类缺口失败 | 三类缺口失败3.8 秒 | ✓ |
| 定向回归绿灯 | `--target runtime-image-send` | 通过 | 通过4.9 秒 | ✓ |
| stale-running 回归 | `--target codexapp-stale-running` | 通过 | 通过2.9 秒 | ✓ |
| JavaScript 语法 | 三个修改文件 `node --check` | 通过 | 全部通过 | ✓ |
| 完整回归 | `timeout 60s node scripts/regression.js` | 通过 | Regression checks passed | ✓ |
## 错误日志
| 时间 | 错误 | 次数 | 处理 |
|------|------|------|------|
| 2026-07-17 | Trellis 自定义代理 TOML 路径不存在 | 1 | 改用标准协作代理并显式传递任务文件与规范路径 |
## 5 问恢复检查
| 问题 | 回答 |
|------|------|
| 当前在哪? | 阶段 8检查会话并安全重启 |
| 接下来去哪? | 先补失败回归,再做前后端最小实现 |
| 目标是什么? | 排队与运行中插入均支持图片附件 |
| 已掌握什么? | 见 `findings.md` |
| 已完成什么? | 见上方进度记录 |