Skip to content

feat(copilot): 实战会话复盘接入长期画像 - #93

Merged
AnnaSuSu merged 7 commits into
AnnaSuSu:mainfrom
stanGSA:codex/copilot-session-review
Oct 27, 2026
Merged

AnnaSuSu merged 7 commits into
AnnaSuSu:mainfrom
stanGSA:codex/copilot-session-review

Conversation

@stanGSA

@stanGSA stanGSA commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

动机

Copilot 实时会话会持久化完整的双路对话(HR 与本人分开、带时间戳),但用户无法查看、单独删除或复盘这些记录,长期画像也拿不到任何真实面试数据。画像页早已为 Copilot 预留了统计卡,在新部署上却一直为空。本 PR 补上「实时会话 → 手动复盘 → 写回画像」这条路径。

行为变化

  • 准备详情页新增「实战记录」:查看带角色和时间的完整对话,按复盘状态生成、查看进度、查看或重新生成复盘,删除单场记录。
  • 结束面试时会等服务端确认保存后再显示记录和复盘入口;异常断开也会把会话保存为已结束。连接期间被删除的记录,不会被后续发言或关闭连接重新写回。
  • 复盘由用户手动触发,需要至少一段面试官提问和一段本人回答。对话按说话人合并后复用录音双人模式的结构化与逐题评估,走主 LLM 配置和持久任务队列;单场上限 40,000 字符,超出明确报错,不截断。
  • 每场面试只关联一份复盘:条件占位防止重复点击和并发请求生成多份;创建失败会回滚;进程崩溃后残留的占位可以恢复。
  • 列表直接给出服务端计算的 in_progress 和 review_status(pending/done/error/missing)。失败的复盘按原对话快照重新生成;原复盘在历史记录中被删除后,会明确提示「重新生成」。
  • 新增 copilot 会话模式:历史记录可按「Copilot 实战」筛选和重试,复盘结果写回弱点、强项、SM-2 复习、行为信号和 copilot_sessions / copilot_avg_score,不写入 topic_mastery。
  • 新增接口(均需登录,只能访问本人数据):
    • GET /api/copilot/prep/{prep_id}/sessions
    • GET /api/copilot/sessions/{session_id}
    • POST /api/copilot/sessions/{session_id}/review
    • DELETE /api/copilot/sessions/{session_id}

已知限制:结束面试时仍在识别的最后一句不会保存(实时 ASR 在停止后按现有设计丢弃转写)。界面和文档已提示用户等字幕定稿后再结束。

验证

bun install --frozen-lockfile
bun run gen:api && git diff --exit-code -- packages/contracts/openapi.json frontend/src/api/schema.d.ts
bun run check
bun run test:contracts
bun run smoke:desktop
  • bun run check:后端 583 项通过;前端 Node 测试 22 项、Bun 测试 44 项通过;类型、架构边界、构建与桌面打包通过;lint 0 错误,保留上游原有的 41 条警告。
  • 后端测试使用真实临时 SQLite 和真实本地 WebSocket,覆盖权限隔离、停止保存、删除后不被写回、幂等、失败回滚、崩溃恢复、复盘状态、重试、新旧归档导入和画像更新;模型输出使用测试替身。
  • 未验证真实麦克风/系统音频采集,以及线上模型的质量、费用和延迟。

截图(合成数据与模拟接口,无真实简历、录音、画像或凭证):

实战记录:进行中 / 复盘生成中 / 已复盘 / 复盘失败 / 复盘已删除 / 数据不足

实战记录的各复盘状态

完整对话弹窗

完整对话弹窗

Copilot 实战复盘页

Copilot 实战复盘页

兼容性影响

  • 只新增接口;InterviewModeSchema 增加 copilot,ReviewTaskTypeSchema 增加 copilot_review(只加不改)。
  • copilot_realtime_sessions 新增两个可空列 review_session_id、review_claimed_at,初始化时自动补齐,可重复执行;个人归档的建表语句已同步,旧归档可导入,新归档保留关联。
  • 统计口径变化:导入个人归档重建统计时,copilot_sessions 和 total_sessions 只计入已生成复盘的 Copilot 会话,不再按实时会话行数计数,避免同一场面试被算两次。
  • WebSocket 协议不变。

Stan and others added 6 commits October 19, 2026 20:38
The realtime connection persisted every turn with an upsert, so a record
deleted while the socket was still open (or just before it closed) was
recreated with its full conversation. Create the record on start only and
update it afterwards; skip the redundant write on close after an explicit
stop.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N4Qh8MvcZhaUic4Q8gpez9
The review endpoint always answered "pending", and the session list only
knew whether a review was linked. A deleted review therefore showed
"check status" while the click silently generated a new one, and the
client re-implemented the server's two-minute activity window.

Sessions now expose the server-computed in_progress flag and a
review_status (pending, done, error, or missing when the linked review was
deleted); the review endpoint returns the real status. The history card
links finished reviews, retries failed ones from their saved snapshot, and
labels regeneration of a deleted review explicitly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N4Qh8MvcZhaUic4Q8gpez9
- Track a reviewing Copilot session opened from history as copilot_review
  instead of falling back to drill_review.
- Show the session history below the preparation results so it no longer
  pushes the analysis down.
- Tell the user that a sentence still being recognized when the interview
  ends is not saved, since realtime ASR drops transcripts after stop.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N4Qh8MvcZhaUic4Q8gpez9
Rewrite the new section for users of the desktop app: what the session
history offers, when a review can be generated, what it changes in the
profile and what deletion keeps. Endpoint, status-code and column details
stay in the generated OpenAPI.

Drop the committed screenshots and verification log; they belong in the
pull request description.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N4Qh8MvcZhaUic4Q8gpez9
@stanGSA
stanGSA marked this pull request as ready for review October 19, 2026 15:06
Use reviewed Copilot sessions from the imported database instead of retaining legacy realtime counts. Preserve independent non-Copilot history from local and archived profiles, and merge the final profile in one update. Cover full archive imports, repeated imports, reviewed sessions, local legacy counts, and profile-only archives.
@AnnaSuSu
AnnaSuSu merged commit a309871 into AnnaSuSu:main Oct 27, 2026
3 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.

3 participants