Suggest reading pulled drive skills inline

This commit is contained in:
Yanli 盐粒 2026-06-25 22:57:27 +08:00
parent 8207039d4c
commit 7218f421b8
2 changed files with 3 additions and 4 deletions

View File

@ -157,8 +157,8 @@ class DifyDriveLayer(PlainLayer[DifyDriveDeps, DifyDriveLayerConfig, EmptyRuntim
sections.append(
"Other available skills:\n"
+ "\n".join(other_skills)
+ "\n\nIf you want to use one, pull it with `dify-agent drive pull <SKILL_PATH>/`, "
"then read the pulled skill content before using it."
+ "\n\nTo use one, pull it and read its SKILL.md in one command: "
'`cat "$(dify-agent drive pull <SKILL_PATH> --to /tmp/drive)/SKILL.md"`.'
)
sections.append(_AGENT_STUB_CLI_USAGE_PROMPT)
return "\n\n".join(sections)

View File

@ -102,8 +102,7 @@ def test_drive_layer_exposes_agent_stub_cli_usage_suffix_prompt(tmp_path: Path)
assert "Other available skills" in prompt
assert "other-skill: Other Skill — Fallback catalog entry." in prompt
assert "`dify-agent drive pull other-skill/`" not in prompt
assert "pull it with `dify-agent drive pull <SKILL_PATH>/`" in prompt
assert "read the pulled skill content before using it" in prompt
assert '`cat "$(dify-agent drive pull <SKILL_PATH> --to /tmp/drive)/SKILL.md"`' in prompt
assert "dify-agent drive list [REMOTE_PREFIX]" in prompt
assert "dify-agent drive pull [REMOTE ...] [--to LOCAL_DIR]" in prompt
assert "--to ." in prompt