Repository navigation
Conversation
ana52070
force-pushed
the
feat/acp-system-prompts
branch
from
October 29, 2026 14:04
2b46032 to
0822b3e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
现有问题
Codeg 支持了多种 ACP 智能体(如 Claude Code、Gemini、Codex、OpenCode、Pi、Cline、CodeBuddy 等内置 Agent 及自定义 Agent)。不同 Agent 会各自在其全局配置目录中读取指令文件(如
CLAUDE.md、GEMINI.md或AGENTS.md)作为全局系统级提示词。目前在 Codeg 的 Agent 设置面板中:
config.json等),无法在界面中直观查看和配置各 Agent 的全局指令/系统提示词。CLAUDE.md、Gemini 使用GEMINI.md、OpenCode/Pi/CodeBuddy 等使用AGENTS.md),用户心智负担较大。改动
后端支持各 Agent 全局提示词文件读取与持久化:
AcpAgentInfo中增加system_instructions_file_path与system_instructions_content。~/.claude/CLAUDE.md~/.gemini/GEMINI.md<opencode_config_dir>/AGENTS.md(默认~/.config/opencode/AGENTS.md)~/.codex/AGENTS.md~/.codebuddy/AGENTS.mdAGENTS.md~/.<custom_id>/AGENTS.md前端设置界面(Agent Settings)集成:
界面与效果展示
1. 设置面板中查看与编辑系统提示词
在 Agent 设置中直接展示当前 Agent 的提示词文件路径与内容编辑器,并提供保存功能:
2. OpenCode 系统提示词生效实测
设置规则后,OpenCode 在会话对话中成功识别并遵循系统提示词指令:
3. Pi 系统提示词生效实测
设置规则后,Pi Agent 同样能够准确读取全局指令并生效:
4. CodeBuddy 系统提示词生效实测
设置规则后,CodeBuddy 成功读取
~/.codebuddy/AGENTS.md并遵从指令:测试
test_agent_system_instructions_paths单元测试,覆盖所有内置 Agent 与自定义 Agent 的路径规则断言,cargo test运行通过。cargo check --no-default-features --features server-bin --bin codeg-server与桌面端cargo check均无编译报错。acp-agent-settings.system-instructions.test.tsx单元测试,覆盖路径展示、内容加载与保存交互。pnpm vitest run src/components/settings/acp-agent-settings,20 个测试套件、244 个用例全部通过。pnpm tsc --noEmit类型检查通过。