feat(consultation): unify server-distributed agents without fixed roles

This commit is contained in:
2026-09-24 11:56:42 +08:00
parent 248776d855
commit 8a157be4f6
35 changed files with 625 additions and 668 deletions

View File

@@ -0,0 +1,46 @@
# Task: Unify coding consultation around distributed agents
## Identity
- Task ID: 20260924-cloud-consultation-agents-82a6cd19
- Mode: Feature
- Branch: codex/20260924-cloud-consultation-agents-82a6cd19-cloud-consultation-agents
- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260924-cloud-consultation-agents-82a6cd19
- Base commit: 248776d8550d67de7ce30802a9f827d432c42a99
- Owner: codex
- Status: Ready for Integration
## Scope
- Unify Code consultations around the distributed agent catalog. Remove built-in teacher/friend persona creation, fixed avatars and identity-based tool restrictions. Preserve server versions, student billing, read-only project context and useful discussion presentation. Keep historical synthetic-friend conversations readable without silently rebinding their identity.
## Intent And Constraints
- Concurrent and Planning Gates Passed in the isolated worktree above. Base includes the completed context-budget fix (248776d). Read current task, startup/context/teacher ADR and relevant architecture, domain and evidence; assessed previous 108 peer scopes with unchanged registry timestamps, plus completed budget follow-up. Historical placeholder scopes remain unknown/read-only with no concrete dependency. User explicitly supersedes the fixed-role product behavior.
- Main owns access/context; Yuxi/Works Square own published agent definitions. No subagents without further consent. Do not mutate main, other tasks, user data or cloud configurations. Backend route identifiers and historical storage names may remain for supported compatibility; no new role taxonomy or automatic rebinding.
- Implement client catalog selection, generic identity/prompt/tool handling and old-history behavior; validate focused service/Renderer tests, typecheck, lint, production build and existing Electron interaction seam. Promote architectural facts only at Integration Gate.
## Outcome
- Unified Code consultations around the existing published catalog. The header has one agent entry; a new topic uses the chosen published agent or Operations default. Name, avatar, description, greeting and suggested questions come from the server. Existing topics remain pinned to their original definition/version.
- Removed locally generated friend identity, local teaching persona and name/role-based read-tool restrictions. All distributed agents use their published prompt/skills and the same account/project/source-scoped read-only tools. Generic structured discussion instructions and the existing student billing, cloud resume and proactive follow-up protocol remain.
- Added the local `/agent-topics` route with existing protocol aliases retained. Historical synthetic-friend conversations remain in their original store, appear as read-only history and cannot receive new turns or background check-ins. Original project drafts retain their storage key; old friend drafts have a read-only viewer and are never rebound or submitted automatically.
- Updated README and focused unit/Electron/layout coverage. No backend/Yuxi change was needed because the existing catalog already distributes arbitrary published agents. No canonical memory, live cloud settings, installed application or other task worktree was changed.
## Verification
- Covered 323 relevant unit cases across service, Renderer, cloud/local execution, read tools, guidance and discussion state. The 10-file suite passed at 322 tests; after adding draft-preservation coverage the final affected UI subset passed all 75 tests (one new case). Covers server-defined personas/skills, real service/HTTP boundaries, arbitrary agent names including `朋友`, published versions, historical read-only behavior, preserved drafts, disabled-agent Enter handling and selected-agent greetings.
- Final `pnpm run typecheck`, scoped ESLint, production Renderer/Main/Preload/utility build and `git diff --check` passed. Expanded Main TypeScript comparison reported 66 baseline and 66 current diagnostics, with no added diagnostics; this is not a claim that expanded Main typechecking is clean.
- Final rebuilt Electron interaction tests passed 2/2: switching consultation/work preserves student drafts and does not submit advice; catalog-selected agent `朋友` appears in the header and receives proactive messages. Fixtures exercise built Electron without a paid model provider.
- Browser layout/interaction coverage passed 13/13 with Edge: five discussion modes at 319/508 px and preview layouts at 1440x900, 1180x720 and 1000x640. Inspected the server-selected agent screenshot. The final draft-only addition is covered by the final UI/Electron runs.
- Test/build output is in local temporary logs (`unified-agents-verified-tests.log`, `unified-agents-final-ui.log`, `unified-agents-layout.log`, `unified-agents-release-build.log`, `unified-agents-release-e2e.log`, `unified-agents-main-types.log`), not versioned product files. Task-aware document drift passed before commit/completion.
## Follow-ups
- Integrate this branch and its already included context-budget fix only when merge is requested. Packaging/installation, real-provider billing and live deployed-server validation were not performed. No cloud change or data migration is required by this feature.
- Retain this worktree/branch for review and integration; no cleanup is authorized or needed now.
## Promotion Candidates
- Targets: `10-decisions/ADR-2026-09-22-coding-teacher.md`, `20-architecture/module-map.md`, `20-architecture/data-flow.md`, `40-domain/business-rules.md`, `40-domain/glossary.md` and `30-worklog/current-state.md`. Proposal: current consultations are published server agents without a built-in teacher/friend taxonomy or local persona overlay; all receive the same scoped project tools. Operations selects/defaults/distributes Yuxi agents, and topics pin published versions. Evidence: this task's explicit user direction, implementation and regression results. Future impact: future personas need no client role branch; generic UI protocols do not define personality. Semantic conflict: supersedes any integrated fixed teacher/friend behavior. Human confirmation: already supplied by the user's explicit request; promotion remains Integration Gate work.
- Same targets where relevant: retain legacy synthetic-friend history and drafts for read-only access without rebinding identity; retain existing cloud contract/storage identifiers as implementation compatibility. Evidence: service/UI tests and Electron validation. Future impact: upgrades preserve user text/history without maintaining a second live role. No unresolved semantic conflict or additional human decision.