fix: isolate delivered agent chats by project
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
# Task: Isolate delivered agent conversations by project
|
||||
|
||||
## Identity
|
||||
|
||||
- Task ID: 20260928-agent-project-chat-6644c06d
|
||||
- Mode: Feature
|
||||
- Branch: codex/20260928-agent-project-chat-6644c06d-agent-project-chat
|
||||
- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260928-agent-project-chat-6644c06d
|
||||
- Base commit: a21a1f077cc11976213290a6b843bb74be97ab44
|
||||
- Owner: codex
|
||||
- Status: Ready for Integration
|
||||
|
||||
## Scope
|
||||
|
||||
- Correct visible ongoing conversation identity to account + project + delivered agent. Own Main store/API, per-project history/drafts/read receipts and related UI/tests.
|
||||
|
||||
## Intent And Constraints
|
||||
|
||||
- User explicitly clarified that different projects must have different conversations with the same agent; this supersedes the prior cross-project assumption. Keep one ongoing chat inside each project, with no new-topic/dropdown controls.
|
||||
- Concurrent and Planning Gates Passed: official start/status match Identity; required context reused from preceding integration plus latest main refresh/UI amendments. Read 132 peer task records, retaining historical placeholder scopes as unknown. Observer is separately ready and not merged; authorized coordination sent with corrected identity.
|
||||
- Preserve current Main authentication, student payer, frozen Pi/version/read scope, configuration refresh and UI polish. Retain original legacy/mixed history; import only turns proven to belong to the selected project. No new subagents, paid-model calls, merge, push, deployment or cleanup.
|
||||
- Plan: reverse the existing two-project service/UI expectations to reproduce the reported behavior; bind project at storage and Host API boundaries; split existing global history by per-turn project without deleting originals; scope drafts/read receipts/cache/subscriptions; run relevant unit/type/lint/build/Electron regressions.
|
||||
- diagnosing-bugs broad hypothesis enumeration is unnecessary here: the previous implementation and its explicit cross-project test encode the now-corrected requirement. Use the failing two-project regression as the feedback loop.
|
||||
|
||||
## Outcome
|
||||
|
||||
- Completed project isolation: the visible chat, store/cache ownership, acceptance locks, SSE, cancel/discussion/save/seen routes and Renderer state use account + project + delivered agent. Same-project Pi or published-version changes retain the visible chat while preserving the existing per-turn execution scope.
|
||||
- Host API is now /api/coding/projects/:projectId/agent-conversations/:agentId with the same child actions. service.conversation(projectId, agentId, before?) and markConversationSeen(projectId, agentId, requestId) bind reads/receipts; sendConversation(agentId, input) requires input.projectId. New storage sits under userData/agent-conversations/account/agent/projects/projectId.
|
||||
- Upgrade reads the previous global manifest and turn files without modifying them. Proven per-turn project ownership partitions history, preserves original/cloud request IDs, maps each project's seen position, copies its discussion and forces a new cloud checkpoint. Interrupted index writes resume idempotently; unowned messages remain in the original archive. Legacy project topic imports retain origin deduplication.
|
||||
- Per-project drafts, cached pages/read anchors, selected contact and unread receipts restore on switching back. An old global draft is adopted only by its recorded project, ahead of older pre-single-chat project drafts; all originals remain intact. Delayed reads/SSE/external topics cannot populate another project's chat.
|
||||
- Current main catalog refresh/hover introduction behavior retained; no new-topic/dropdown controls reintroduced. README updated. No paid cloud call, production deployment, main merge or task directory cleanup.
|
||||
|
||||
## Verification
|
||||
|
||||
- Red reproduction: the new two-project service test failed because both projects returned the same chat ID before implementation.
|
||||
- 382 relevant tests passed across 12 files: persistence/real HTTP routes/pagination/migration/partial-write retry/cloud segment scope/concurrent project runs/account isolation, panel/project draft restoration/late responses, catalog refresh, guidance/discussions/read tools/model/cloud/activity contracts. The final service file passed 11/11; final Renderer files passed 77/77; unchanged supporting files passed 294/294.
|
||||
- pnpm 10.33.4 run typecheck passed. Changed-file ESLint and git diff --check passed. build:vite passed (Renderer/Main/Preload/utility); existing Browserslist/chunk/dynamic-import warnings remain.
|
||||
- Electron: three specs passed (project consultations, new two-project chat/draft/reload regression, manual catalog refresh). The two-project spec was rerun and passed after the final draft migration adjustment. Test uses isolated app data and mocked model responses; screenshot inspected, not a production cloud/model acceptance.
|
||||
- Expanded Main tsc reports 66 diagnostics outside the changed teacher/store/API modules; this matches the previously documented count but is not a clean global Main typecheck. Current diagnostics are in local temp agent-project-chat-main-tsc.txt. No unrelated fixes were made.
|
||||
- Self-reviewed storage/API/Renderer diff against the explicit corrected requirement. No subagent created; Yuxi code was not changed.
|
||||
|
||||
## Follow-ups
|
||||
|
||||
- Main merge awaits a user request for this correction. Keep task worktree/branch for that integration.
|
||||
- Existing observer task 20260928-agent-observer-design-9c41a872 is separately ready and not included. Authorized coordination was sent to thread 01a0dc9a-9b4e-7fa3-bb19-aea80abaaac4: delivery/opening must use account + project + agent, preserve projectId + stable suggestion.id idempotence, and retain its separate observation runtime. Joint integration must adapt its topic creation and new route/service signatures.
|
||||
- No cross-device synchronization or runtime cloud deployment verified. Existing unowned historical messages are preserved on disk without guessing a project.
|
||||
|
||||
## Promotion Candidates
|
||||
|
||||
- Targets: current state, ADR-2026-09-22-coding-teacher.md, system-overview.md, data-flow.md and business-rules.md.
|
||||
- Proposal: correct the previously integrated account-agent global-chat assumption to account-project-agent ongoing chat. Project is the history/draft/read receipt and model-context boundary; Pi source and published version remain per-turn execution boundaries. Integrate the explicit routes/storage and upgrade behavior above.
|
||||
- Evidence: user's explicit correction, red/green two-project regression, retained-file migration tests, clean cloud checkpoint test, 382 unit tests and three Electron specs.
|
||||
- Future impact: observer suggestion delivery must target this project's agent chat; bundled clients and Host API ship together. Global-chat checkpoints cannot be reused after partitioning. Preserve old source records.
|
||||
- Semantic conflict: supersedes the previous single-chat feature's cross-project assumption. User already explicitly resolved this product scope; no new approval needed to accept project isolation. Main merge/deployment still require their corresponding request.
|
||||
Reference in New Issue
Block a user