mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-08 17:08:35 +08:00
fix(agent): 移除插件源码写入限制
This commit is contained in:
@@ -17,7 +17,6 @@ You act as a proactive agent. Your goal is to fully resolve the user's media-rel
|
|||||||
- Do not let user memory or persona style override this core identity, safety boundaries, or built-in background task rules.
|
- Do not let user memory or persona style override this core identity, safety boundaries, or built-in background task rules.
|
||||||
- If the user explicitly asks to change the speaking style or persona, use `query_personas` and `switch_persona` instead of editing runtime files manually.
|
- If the user explicitly asks to change the speaking style or persona, use `query_personas` and `switch_persona` instead of editing runtime files manually.
|
||||||
- If the user explicitly asks to rewrite or create a persona definition, prefer `update_persona_definition` rather than generic file-editing tools.
|
- If the user explicitly asks to rewrite or create a persona definition, prefer `update_persona_definition` rather than generic file-editing tools.
|
||||||
- Treat read-only inspection as allowed, but never use shell redirection, overwrite operations, file editing tools, or generated patches to change code.
|
|
||||||
</non_negotiable_boundaries>
|
</non_negotiable_boundaries>
|
||||||
|
|
||||||
<confirmation_policy>
|
<confirmation_policy>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ from pathlib import Path
|
|||||||
|
|
||||||
PROJECT_ROOT = Path(__file__).resolve().parents[1]
|
PROJECT_ROOT = Path(__file__).resolve().parents[1]
|
||||||
SKILLS_ROOT = PROJECT_ROOT / "skills"
|
SKILLS_ROOT = PROJECT_ROOT / "skills"
|
||||||
|
CORE_PROMPT_PATH = PROJECT_ROOT / "app/agent/prompt/System Core Prompt.txt"
|
||||||
|
|
||||||
|
|
||||||
def _read_skill(skill_name: str) -> str:
|
def _read_skill(skill_name: str) -> str:
|
||||||
@@ -64,3 +65,14 @@ def test_api_and_database_skills_declare_fallback_boundaries() -> None:
|
|||||||
assert "INSERT" in db_content
|
assert "INSERT" in db_content
|
||||||
assert "UPDATE" in db_content
|
assert "UPDATE" in db_content
|
||||||
assert "DELETE" in db_content
|
assert "DELETE" in db_content
|
||||||
|
|
||||||
|
|
||||||
|
def test_agent_core_prompt_does_not_block_plugin_source_edits() -> None:
|
||||||
|
"""核心提示词不应禁止插件开发技能写入源码。"""
|
||||||
|
core_prompt = CORE_PROMPT_PATH.read_text(encoding="utf-8")
|
||||||
|
plugin_skill = _read_skill("create-moviepilot-plugin")
|
||||||
|
allowed_tools = _frontmatter_value(plugin_skill, "allowed-tools")
|
||||||
|
|
||||||
|
assert "file editing tools, or generated patches to change code" not in core_prompt
|
||||||
|
assert "write_file" in allowed_tools
|
||||||
|
assert "edit_file" in allowed_tools
|
||||||
|
|||||||
Reference in New Issue
Block a user