From 140f6be8db10be34472aba15d80721c33969010a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=A8=E9=B1=BC=E8=BE=A3=E6=A4=92?= Date: Wed, 14 Oct 2026 10:44:54 +0800 Subject: [PATCH] feat: remove Code project prompt and Skills controls --- ...14-remove-project-agent-fields-6c2e8b14.md | 67 ++++++++ README.md | 2 +- src/pages/ProjectConfiguration/index.tsx | 36 +---- tests/e2e/pi-coding-first-chat.spec.ts | 22 ++- .../e2e/project-configuration-skills.spec.ts | 2 + .../project-configuration-controls.test.tsx | 148 ++++++++++++++++++ 6 files changed, 240 insertions(+), 37 deletions(-) create mode 100644 .project-docs/30-worklog/tasks/20261014-remove-project-agent-fields-6c2e8b14.md create mode 100644 tests/unit/project-configuration-controls.test.tsx diff --git a/.project-docs/30-worklog/tasks/20261014-remove-project-agent-fields-6c2e8b14.md b/.project-docs/30-worklog/tasks/20261014-remove-project-agent-fields-6c2e8b14.md new file mode 100644 index 00000000..c19b015d --- /dev/null +++ b/.project-docs/30-worklog/tasks/20261014-remove-project-agent-fields-6c2e8b14.md @@ -0,0 +1,67 @@ +# Task: Remove project prompt and Skills editing controls + +## Identity + +- Task ID: 20261014-remove-project-agent-fields-6c2e8b14 +- Mode: Feature +- Branch: codex/20261014-remove-project-agent-fields-6c2e8b14-remove-project-agent-fields +- Worktree: /Users/chillishark/Makelore 麦洛/.codex-worktrees/makelore/20261014-remove-project-agent-fields-6c2e8b14 +- Base commit: 350f7d740b0559a43c7b3f8ab6cd32401cc6f677 +- Owner: codex +- Status: Ready for Integration + +## Scope + +- Remove Code project prompt and project Skills controls from the configuration page and the unused Skill-list request; clarify default-model copy. + +## Intent And Constraints + +- User explicitly requested deleting both visible edit sections and asks how historical conversations can be affected. Explain past messages/results are immutable; later turns may use refreshed resources. No advanced replacement entry. Existing backend schema/Agent resources remain compatible; saving model settings must not silently reset hidden metadata. No live-app update, merge, push or worktree retirement requested. + +## Project Context Loaded + +Task context: +- Official task identity, feature mode, branch, absolute worktree and base350f7d7 verified against registry and Git. +- All59 peer records/177 Scope, Intent and Promotion sections read; no conflict. Child-language placeholder scope remains unknown without concrete dependency. New preview/gallery scopes do not own this configuration form. + +Read: +- Own record, AGENTS, entry/read-before-planning/memory-index/planning-gate. Positioning/current-state/decision-index/overview, community boundary, domain/success and evidence/reflection/commitment context retained from just-completed assessment on identical base; canonical diff is empty. +- Current ProjectConfiguration and affected unit/Electron tests, README and prior runtime assessment. + +Relevant understanding: +- Project-owned local Agent metadata is authoritative; runtime prompt/Skill contracts are separate from visible edit controls and teacher cloud configuration. +- User has now approved UI deletion, superseding the assessment suggestion of an advanced entry. No runtime resource migration or historical-message rewrite is requested. +- Files: ProjectConfiguration/index.tsx, README and focused configuration tests. Model save should preserve existing prompt/skillIds in the cloned draft. +- Unknown: live temporary-app revision; no update attempted. + +Gate result: Passed. + +## Plan + +1. Delete prompt/Skills controls and unused Skill-fetch state; narrow the explanation to model defaults. +2. Verify model-only saving preserves configuration data, and desktop settings contain no prompt/Skills edit controls. +3. Run focused checks/build, document and commit the result. + +## Outcome + +- Deleted the project prompt textarea and project Skills assignment section entirely, with no advanced replacement. Deleted the now-unused SkillInfo type, list state, fetch callback and reload requests. +- Default programming settings now expose only the model selector. Copy explicitly states new conversations use the default model while existing conversation models/messages remain unchanged; the no-project state no longer advertises prompt editing. +- README and existing desktop assertions updated. Historical messages and executed results are not rewritten by configuration refresh; the earlier assessment's 'affected history' phrasing meant future turns in that conversation, not past messages. + +## Verification + +- Product typecheck, build:vite, product/legacy-spec scoped ESLint and whitespace checks passed. +- Existing coding-feature-ui and project-config-store suites: 15 tests passed. +- Focused project-configuration-controls suite: 2 tests passed, covering default and historical Agent routes. Model saves preserve exact hidden prompt/skillIds and untouched Agent metadata without mutating the loaded config; no Skill-list request occurs. +- Isolated Electron project-menu/configuration scenario passed1/1 against fresh build: correct inactive target project/model-b, enabled model/save controls, new copy, no prompt/Skills inputs. Reviewed settings screenshot. Initial run hit an existing modal-close/pointer-leave race in the test; synchronized that transition with menu closure/archive readiness before rerunning, without product changes. +- Evidence: `/tmp/remove-project-agent-fields-electron-6c2e8b14-rerun/run.log` and `results/pi-coding-first-chat-proje-cfb75-gned-at-every-sidebar-width/project-settings-model-only.png`. Generated main entry restored byte-for-byte; isolated processes exited. No real account, project or running application modified. +- Updated existing legacy project-configuration-skills assertions without running that broader historical scenario. No full-suite claim; targeted scope verified. +- Independent read-only product review passed. Final changed-file ESLint/typecheck and task-aware document drift check passed. + +## Follow-ups + +- Running application update, integration, push and cleanup remain separate actions. + +## Promotion Candidates + +- Target: current-state / Code configuration summary. Proposal: Code default programming configuration only exposes model selection; prompt and project Skills fields are not user-editable in that page. Evidence: user directive, removed controls/request and focused verification. Future impact: do not reintroduce these controls or imply historical messages are rewritten. No conflict; user explicitly confirmed this behavior. Canonical promotion only during future integration. diff --git a/README.md b/README.md index 40feb998..369818a6 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ Pi 正式包必须继续运行 `pnpm run verify:artifact:pi`、`pnpm run smoke:p - 新项目自动建立一个内部默认编程智能体,`defaultAgentId` 固定其身份;创建项目不再要求创建或选择智能体。有可用的全局默认模型时复制精确账号与模型,没有时保留待选择状态。旧项目优先保留原默认或置顶/首个可用智能体,保留所有历史绑定;全部停用时新增默认配置,不复活旧配置。 - Makelore 为每个项目智能体附加平台管理的中文语言规则:自然语言默认使用简体中文,包括可见的思考过程、进度说明、工具调用说明和最终回复;代码、命令、路径、日志、错误原文与必要引用保留原始语言。用户或项目智能体系统指令明确要求其他语言时按该要求执行;模型仍不遵循时视为 Provider 模型行为。 - 有效项目直接进入会话工作区。打开项目不创建空会话;首次发送或点击项目下的新建入口才创建本地元数据。首条消息无需等待运行时 Snapshot 返回。 -- 项目设置直接编辑默认编程配置的模型、系统指令和需要分配的 Skill;会话菜单可进入该历史会话绑定的编程配置。默认模型只影响新对话,现有对话独立切换模型与思考选项,原有配置编辑不会改写其他对话。 +- 项目设置仅提供默认编程配置的模型选择,不展示项目提示词或项目 Skills 编辑入口;知识文件与插件仍在各自入口管理。会话菜单可进入该历史会话绑定的编程配置。默认模型只影响新对话,现有对话独立切换模型与思考选项,已有消息记录不会被改写;保存模型配置保留原有 Agent 元数据。 - 项目智能体只保存自身的精确默认模型;未完成模型选择的智能体保持待配置状态,不从项目级 `defaultModel` 或运行时私有配置回退。 - 一个智能体可以拥有多条互相独立的 Pi Session;智能体和对话元数据分别由 `.makelore/project.json` 与 `.makelore/conversations.json` 保存,稳定的智能体与对话 id 保持本地历史连续。 - 会话列表直接挂在左侧项目下,不展示中间智能体列;同一项目内不同历史智能体的会话统一列出,保留归档、改名、未读与运行状态。快速切换项目和会话时,迟到的请求与回复保持原归属。 diff --git a/src/pages/ProjectConfiguration/index.tsx b/src/pages/ProjectConfiguration/index.tsx index 4629abf1..8e5d07b6 100644 --- a/src/pages/ProjectConfiguration/index.tsx +++ b/src/pages/ProjectConfiguration/index.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { useEffect, useMemo, useRef, useState } from 'react'; import { useLocation, useNavigate } from 'react-router-dom'; import { ArrowLeft, Check, Cpu, Files, Puzzle, Trash2, Upload, X } from 'lucide-react'; import { toast } from 'sonner'; @@ -10,7 +10,6 @@ import { ProjectPublishAction } from '@/components/works/ProjectPublishAction'; import { Plugins } from '@/pages/Plugins'; import { PROJECT_SETTINGS_PLUGINS_PATH } from '@/pages/Plugins/legacy-plugin-redirect'; import { buildCodingModelOptions, parseCodingModelKey, type CodingModelOption } from '@/lib/coding-model-options'; -import { getCodingSkills } from '@/lib/coding-product-tools'; import { useCodingWorkspaceStore } from '@/stores/coding-workspace'; import { useProjectConfigStore } from '@/stores/project-config'; import { useProviderStore } from '@/stores/providers'; @@ -18,13 +17,6 @@ import type { CodingProjectAgent, CodingProjectConfig } from '@/types/coding-pro const EMPTY_FILES: string[] = []; type DrawerMode = 'models' | 'knowledge' | null; -type SkillInfo = { - id: string; - name: string; - description: string; - available: boolean; - effective: boolean; -}; const THINKING_LEVEL_LABELS = { off: '关闭', @@ -122,24 +114,11 @@ export function ProjectConfiguration() { const [draft, setDraft] = useState(null); const [drawerMode, setDrawerMode] = useState(null); const [activeAgentId, setActiveAgentId] = useState(null); - const [skills, setSkills] = useState([]); const [saving, setSaving] = useState(false); const [deleteDialogOpen, setDeleteDialogOpen] = useState(false); const knowledgeInputRef = useRef(null); const navigate = useNavigate(); const location = useLocation(); - const loadSkills = useCallback(() => { - void getCodingSkills() - .then((result) => setSkills(result.skills.map((skill) => ({ - id: skill.id, - name: skill.name, - description: skill.description, - available: skill.available, - effective: skill.effective, - })))) - .catch(() => setSkills([])); - }, []); - useEffect(() => { if (activeProject) void load(activeProject.id); }, [activeProject, load]); useEffect(() => { if (stored) setDraft(structuredClone(stored)); }, [stored]); useEffect(() => { @@ -147,7 +126,6 @@ export function ProjectConfiguration() { if (!requestedAgentId || !draft?.agents.some((agent) => agent.id === requestedAgentId)) return; setActiveAgentId(requestedAgentId); }, [draft, location.search]); - useEffect(() => { loadSkills(); }, [loadSkills]); useEffect(() => { void refreshProviderSnapshot(); }, [refreshProviderSnapshot]); const modelOptions = useMemo( () => buildCodingModelOptions(providerAccounts, providerVendors), @@ -162,11 +140,10 @@ export function ProjectConfiguration() { search: '?scope=all&source=all&state=available', }); const closePluginWorkspace = () => { - loadSkills(); navigate('/project-config', { replace: true }); }; - if (!activeProject) return <>

项目配置

一念成光,万物可创。

新建或打开一个项目后即可配置模型、提示词、知识与项目能力;插件目录仍可在这里查看。

} title="插件" subtitle="查看可选与已安装能力" onClick={openPluginWorkspace} />
; + if (!activeProject) return <>

项目配置

一念成光,万物可创。

新建或打开一个项目后即可配置模型、知识与项目能力;插件目录仍可在这里查看。

} title="插件" subtitle="查看可选与已安装能力" onClick={openPluginWorkspace} />
; if (!draft) return
正在读取项目配置…
; const updateAgent = (next: CodingProjectAgent) => setDraft((current) => current ? { ...current, agents: current.agents.map((item) => item.id === next.id ? { ...next, updatedAt: new Date().toISOString() } : item) } : current); @@ -202,19 +179,12 @@ export function ProjectConfiguration() {
} title="可用模型" subtitle={`${modelOptions.length} 个可用模型`} onClick={() => setDrawerMode('models')} />} title="知识文件" subtitle={`${knowledge.length} 个知识文件`} onClick={() => setDrawerMode('knowledge')} />} title="插件" subtitle="管理云端与本机能力" onClick={openPluginWorkspace} />
{activeAgent &&

{activeAgent.id === draft.defaultAgentId ? '默认编程配置' : '历史会话编程配置'}

-

新会话使用项目默认配置;历史会话保留原来的配置与记录。

+

默认模型用于新对话;已有对话的模型和消息记录保持不变。

-