Merge single ongoing agent conversations into main

This commit is contained in:
2026-09-28 14:35:49 +08:00
32 changed files with 1442 additions and 149 deletions

View File

@@ -4,6 +4,8 @@ This file is the integrated default-branch snapshot. Feature tasks record progre
## Integrated Through
- 2026-09-28:无冲突合入单会话源 `7aa81da616449dead25557476cf4f1433edf84b5`(含方案 `e54f3d2`)。每个账号与下发智能体使用唯一持续聊天,移除新话题入口,跨项目分页历史、独立草稿与持久已读;项目/Pi/发布版本下沉到每轮冻结,变化时只轮转内部Yuxi线程。旧记录按可证明的账号/配置身份导入,原文件保留。已按用户批准更新咨询ADR、架构和领域规则,取代下方历史条目的项目/版本可见话题规则。产品/测试与已验证源一致,沿用365项相关单测、Renderer typecheck、scoped lint、Vite构建及1项Electron交互;扩展Main仍为66项基线诊断。三份外来文档原样保留;未推送、打包、部署或调用真实收费模型。主动观察仍在独立任务,建议投递必须在其后续合并时衔接唯一聊天。见[源记录](tasks/20260928-agent-single-chat-27da516b.md)和[集成记录](tasks/20260928-merge-agent-single-chat-9911c6df.md)。
- 2026-09-28:无冲突快进合入诊断记录 `3779f33`,客户端产品及测试无变化。确认现有咨询按账号/项目保存,每个问题绑定当前 Pi 来源;配套 Yuxi 修复 `e96d8cf` 将话题准入与每问题上下文分开,允许同项目切换编程会话后继续原话题,旧历史无需删除。Yuxi 2260 项 unit(1 skipped)、10 项真实 HTTP/PostgreSQL/worker 集成及独立审查通过;本仓不为诊断文档重跑客户端构建。三份外来文档原样保留;未推送、打包、安装或部署,线上需更新 Yuxi API。见[源记录](tasks/20260928-consultation-scope-83fa19c2.md)和[集成](tasks/20260928-merge-consultation-scope-ml-7b56cbe4.md)。
- 2026-09-27:从 `0eed70fa637f70b22be5eda7af400a702ee4a7f2` 无冲突快进合入 Design 客户端源 `bbea6eba82a625f3d8b34ecb3d2747e7a19766e3`。未保存视频时长不再显示默认 6 秒,参数保存失败恢复已接受值;缺少内部分镜改为 AI 准备动作引导,保留其他阻断与确认边界。产品/测试与已验证源一致,沿用 71 项相关测试、3 项跨前后端离线流程、2 项 Electron 交互及 typecheck、lint、构建证据。三份外来文档原样保留;未推送、打包、安装或调用收费生成。本次无需数据库或环境变更,不包含独立服务端 Reasoner 修复。见[源任务](tasks/20260927-design-video-form-d2b96e41.md)和[集成记录](tasks/20260927-merge-design-video-form-9af51c63.md)。

View File

@@ -0,0 +1,74 @@
# Task: Design one ongoing conversation per user and cloud agent
## Identity
- Task ID: 20260928-agent-single-chat-27da516b
- Mode: Feature
- Branch: codex/20260928-agent-single-chat-27da516b-agent-single-chat
- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260928-agent-single-chat-27da516b
- Base commit: b26e25c9ed26bf30f4d0bc03869c223f0fe34386
- Owner: codex
- Status: Ready for Integration
## Scope
- User approved the proposed account + delivered-agent single ongoing chat and implementation.
- Client store, per-turn scope/version, Host API, paged UI, legacy history, drafts, read receipts and focused regressions.
- Coordination with the existing proactive-observer task was explicitly authorized. This task does not own its uncommitted implementation or its Reviewer.
- No main merge, push, deployment, real paid model call, new subagent or worktree cleanup.
## Intent And Constraints
- Concurrent Task Gate and Planning Gate Passed on initial design and implementation resume; official start/status confirmed this task's feature ownership.
- Refreshed 128 peer records, read only their task records; consultation-scope client task is read-only diagnosis. Observer code remains in a separately owned worktree.
- Stable delivered config ID, account isolation, student payer and three readonly tools remain. Pi/project files stay project-owned.
- Every accepted question freezes project, Pi source and released version. Switching UI never changes an accepted read scope.
- Existing main foreign documents and unrelated worktrees remained untouched. Only this task record/proposal are changed in project memory; canonical promotion remains integration work.
## Outcome
- Main stores one account-agent chat under userData/agent-conversations/<account>/<agent>. A small message index and separate atomic turn files avoid rewriting every historical answer.
- First question ensures the chat; repeated request IDs are idempotent, including older pages. One active manual question per account-agent. Snapshot progress/completion updates by request ID.
- Latest 50 turns initially; older history pages remain available. SSE sends the current turn and metadata. Renderer merges delayed pages without overwriting newer streamed replies, preserves reading position while switching agents, and keeps account-agent text drafts.
- Removed student new-topic plus and normal topic dropdown for delivered agents. Current project/source are shown. Cross-project/Pi references block sending until removed or the source is reopened; old reply actions cannot target another Pi session.
- Contacts retain distinct unread state; read position is persisted in Main. Last selected disabled agent can reopen readonly history. Loaded-page/scroll cache is window-local; durable messages and read receipts survive restart.
- Next question uses the current released definition. Same project/Pi/version reuses its internal thread; changing any starts an internal segment carrying bounded public history. Old imported cloud questions retain original cloudRequestId for cancellation.
- Readonly conversation tool can retrieve older completed chat messages by ID through the frozen index without loading all bodies each question; prior-project message text does not grant prior-project file access.
- Legacy topics are imported only on proven account/config identity, deduplicated by project/topic/request origin, and original files are retained. Body-before-index interruption recovers without duplicate import, including retry in the same process. Missing project directories can be retried later. Historical project and source topics, including unassigned/friend records, remain readonly via the old-records endpoint.
- Discussion state is per project inside the chat; imported old cards retain their turn snapshots and newest project card. Legacy originals remain separately viewable.
- README updated for the implemented client behavior. Accepted teacher ADR/domain/architecture changes are proposed, not promoted.
## Verification
- Relevant unit suite: 12 files, 365 tests passed. Includes Store/Service/actual HTTP + SSE/paging/legacy source archive/account isolation/concurrent duplicate acceptance/versions/Pi switching/frozen file roots/older message tool reads/import failure recovery/read receipts/UI delayed pages/old-record readonly/disabled history/independent agent drafts.
- pnpm run typecheck: passed.
- Focused ESLint over every changed TS/TSX file and new files: passed.
- pnpm run build:vite: passed; existing chunk-size/dynamic-import/Browserslist warnings retained.
- Real Electron test with deterministic Host fixtures: project consultations preserve student drafts and switch between work and chat without submitting advice, 1/1 passed. Screenshot manually inspected: topbar agents, one chat, no new-topic plus/select, project label, separate drafts, work tab preserved. Not a live cloud/model acceptance claim.
- Expanded Main tsc: 66 diagnostics. Temporarily replayed original committed source inside this owned worktree under try/finally restoration; baseline also has the same 66 diagnostics (line positions normalized). No new diagnostics, but global Main typecheck is not clean.
- Reproduced existing coding-teacher.test tool activity ID failure on original base: test expected parent run ID, existing implementation uses stable context/request ID. Corrected that assertion to the existing contract; the full related suite then passed.
- No dependency lock/package change. Build output, local reports, runtimes and temporary checks are ignored and not committed.
## Coordination And Integration Dependency
- Authorized messages sent to existing thread 01a0dc9a-9b4e-7fa3-bb19-aea80abaaac4, task 20260928-agent-observer-design-9c41a872.
- That task confirmed its Main suggestion contract in its own record: stable suggestion ID survives replacements; state.json is durably saved before advice delivery. Use projectId + suggestion.id for idempotent delivery; do not call sendConversation to invent a student message.
- Actual manual APIs: GET /api/coding/agent-conversations/:agentId?before=...; POST /messages; /seen; /discussion; /save; /requests/:id/cancel; GET /events. service.conversation(agentId,before?) and service.sendConversation(agentId,input) own the unique chat.
- Observer review was still in progress at this handoff; no observer code is in this branch. The combined integration MUST replace its discussObservation project-topic creation with inserting/opening this chat, plus delivery replay/read receipts. Its independent observation thread and Main project scheduler remain separate. Do not claim automatic advice has already been wired or combine branches without this adaptation and joint tests.
- Observer coordinator source inspection confirmed Yuxi scope binds both project and Pi source, and native YuxiSummarizationMiddleware exists. This justified Pi-aware segment rotation; neither cloud deployment nor compression quality was independently exercised here.
## Follow-ups
- User-requested main merge is not yet authorized for this implementation.
- During integration reconcile observer suggestions as above, and promote the approved account-agent/per-turn semantics; retain unrelated docs.
- Validate configured Yuxi deployment against current client; no real cloud/paid-model run occurred. Cross-device history synchronization is outside this increment.
- Retained worktree belongs to this completed feature; no cleanup requested.
## Promotion Candidates
- Targets: ADR-2026-09-22-coding-teacher.md, system-overview.md, data-flow.md, business-rules.md and current state.
- Proposal: replace visible project/version topic identity with account-agent chat; bind project/Pi/version to individual execution turns; account-agent drafts/read receipts, paged files/index, retained source archives.
- Evidence: approved user request, implementation, 365 related tests, Electron UI and cloud request contract tests.
- Future impact: history lifecycle, cloud scope rotation/summary, old-context actions, observation delivery.
- Semantic conflicts: accepted project-topic/version policy is intentionally revised by user approval; observer project-topic creation must be adapted at joint integration.
- Human confirmation: single-chat direction and implementation approved. Main merge/deployment require their own corresponding user request.

View File

@@ -0,0 +1,46 @@
# Task: Integrate one ongoing conversation per delivered agent
## Identity
- Task ID: 20260928-merge-agent-single-chat-9911c6df
- Mode: Integration
- Branch: main
- Worktree: D:\Datas\OthersProjects\makelore
- Base commit: a1d52c60d841dc451545805af5fe91b0ca8839d3
- Owner: codex
- Status: Ready for Integration
## Scope
- Merge source e54f3d2 and 7aa81da into local main; promote the approved account-agent ongoing conversation contract.
## Intent And Constraints
- Concurrent and Planning Gates Passed. Official start/status match Identity and exclusive integration ownership. Loaded required entry, own/source tasks, relevant accepted ADR, architecture/domain/evidence/reflection/commitments and peer task scopes. Historical placeholder scopes remain unknown but have no concrete dependency on this merge.
- User authorized main merge and explicitly approved releasing completed 20260928-merge-consultation-scope-ml-7b56cbe4 and adopting three known foreign task documents. Preserve them unchanged and exclude them from commits. Source task/proposal remain read-only.
- Registered the exact unchanged source task/proposal imported by the authorized merge before committing, following the documented source-record adoption procedure. Same-task official resume/status and refreshed Planning Gate passed with unchanged base and scope.
- Approved account-agent chat replaces visible project/version topics; each accepted execution still freezes project/Pi/version, student payer and readonly tool scope. No changes to Pi project ownership.
- Observer task 20260928-agent-observer-design-9c41a872 remains uncommitted and separate; authorized coordination sent. Its later merge must adapt durable suggestion delivery/discussObservation to this chat and jointly test idempotency, unread state, scope and focus. Do not import its unfinished code here.
- Plan: merge exact source without rewriting product files, reconcile accepted canonical rules, verify source product/history preservation and documentation boundaries, then commit/complete. Reuse source verification if product/test tree is identical; rerun only checks justified by integration changes.
- No new subagents, push, deployment, packaging, paid model calls or cleanup.
## Outcome
- Source 7aa81da (including design e54f3d2) merged conflict-free into local main. Product, tests, README and source records are byte-identical to the verified source; main's separate consultation-scope diagnosis remains preserved.
- Promoted approved account-agent conversation identity, per-turn project/Pi/version scope, paged persistence, read receipts, drafts and retained legacy archives into the teacher ADR, architecture, domain rules, decision/evidence indexes and Integrated Through.
- Explicitly recorded that legacy Renderer check-ins stop for delivered-agent chats and the independent observation implementation is not part of this merge. Its later integration must adapt durable advice delivery rather than creating project topics.
- Three adopted foreign documents remain unchanged and excluded. No push, packaging, installation, deployment or cleanup.
## Verification
- Source verification reused because integration changes only canonical/task documentation beyond the exact source: 365 related tests, Renderer typecheck, changed-file ESLint, Vite build and one real Electron interaction with deterministic Host fixture passed. Expanded Main has the same 66 pre-existing diagnostics; no live paid-model claim.
- Conflict-free merge, exact product/test/source-record preservation, git diff --check and task-aware documentation drift checks passed. The official gate also verifies the three adopted external records retain their original bytes/index state. Main's earlier diagnosis commits are retained as the first-parent history.
## Follow-ups
- Observer task 20260928-agent-observer-design-9c41a872 must consume this main and complete same-chat suggestion delivery/read receipts/idempotency/scope/focus tests before its own merge. Existing thread coordination is user-authorized.
- Production/installed-client acceptance and optional task worktree cleanup are separate. No cross-device history synchronization is implemented.
## Promotion Candidates
- Accepted and promoted the source account-agent/per-turn contract under the user's implementation and merge approval; no unresolved product-direction choice. Source task/proposal remain unchanged historical records.