feat(core): sync skills from SKILL.md into memFS blocks (#9718)
This commit is contained in:
committed by
Caren Thomas
parent
a11ba9710c
commit
a50482e6d3
@@ -54,7 +54,14 @@ class TestLogContextMiddleware:
|
||||
return {
|
||||
"system/human.md": "---\ndescription: human\n---\nname: sarah",
|
||||
"system/persona.md": "---\ndescription: persona\n---\nbe helpful",
|
||||
"skills/research-helper/SKILL.md": "---\ndescription: helper\n---\n# Research Helper",
|
||||
"skills/research-helper/SKILL.md": (
|
||||
"---\n"
|
||||
"name: research-helper\n"
|
||||
"description: Search the web and summarize findings.\n"
|
||||
"---\n"
|
||||
"# Research Helper\n\n"
|
||||
"Use this skill to do deep web research and summarize results.\n"
|
||||
),
|
||||
"skills/research-helper/references/details.md": "---\ndescription: nested\n---\nShould not be synced",
|
||||
}
|
||||
|
||||
@@ -97,9 +104,13 @@ class TestLogContextMiddleware:
|
||||
labels = {call["label"] for call in synced_calls}
|
||||
assert "system/human" in labels
|
||||
assert "system/persona" in labels
|
||||
assert "skills/research-helper/SKILL" not in labels
|
||||
assert "skills/research-helper" in labels
|
||||
assert "skills/research-helper/references/details" not in labels
|
||||
|
||||
by_label = {call["label"]: call for call in synced_calls}
|
||||
assert by_label["skills/research-helper"]["description"] == "Search the web and summarize findings."
|
||||
assert by_label["skills/research-helper"]["value"].startswith("# Research Helper")
|
||||
|
||||
def test_extracts_actor_id_from_headers(self, client):
|
||||
response = client.get("/v1/agents/agent-123e4567-e89b-42d3-8456-426614174000", headers={"user_id": "user-abc123"})
|
||||
assert response.status_code == 200
|
||||
|
||||
@@ -312,10 +312,10 @@ def test_compile_git_memory_filesystem_no_description_when_empty():
|
||||
|
||||
|
||||
def test_compile_git_memory_filesystem_condenses_skills_to_top_level_entries():
|
||||
"""skills/ should render as top-level skill folders with description.
|
||||
"""skills/ should render as top-level skill entries with description.
|
||||
|
||||
We intentionally avoid showing nested files under skills/ in the system prompt
|
||||
tree to keep context concise.
|
||||
We intentionally avoid showing nested files under skills/ in the system
|
||||
prompt tree to keep context concise.
|
||||
"""
|
||||
|
||||
m = Memory(
|
||||
@@ -324,13 +324,13 @@ def test_compile_git_memory_filesystem_condenses_skills_to_top_level_entries():
|
||||
blocks=[
|
||||
Block(label="system/human", value="human data", limit=100),
|
||||
Block(
|
||||
label="skills/searching-messages/SKILL",
|
||||
label="skills/searching-messages",
|
||||
value="# searching messages",
|
||||
limit=100,
|
||||
description="Search past messages to recall context.",
|
||||
),
|
||||
Block(
|
||||
label="skills/creating-skills/SKILL",
|
||||
label="skills/creating-skills",
|
||||
value="# creating skills",
|
||||
limit=100,
|
||||
description="Guide for creating effective skills.",
|
||||
@@ -347,10 +347,10 @@ def test_compile_git_memory_filesystem_condenses_skills_to_top_level_entries():
|
||||
out = m.compile()
|
||||
|
||||
# Condensed top-level skill entries with descriptions.
|
||||
assert "searching-messages/ (Search past messages to recall context.)" in out
|
||||
assert "creating-skills/ (Guide for creating effective skills.)" in out
|
||||
assert "searching-messages (Search past messages to recall context.)" in out
|
||||
assert "creating-skills (Guide for creating effective skills.)" in out
|
||||
|
||||
# Do not show SKILL.md or nested skill docs in tree.
|
||||
assert "skills/searching-messages/SKILL.md" not in out
|
||||
assert "skills/creating-skills/SKILL.md" not in out
|
||||
# Do not show .md suffixes or nested skill docs in tree.
|
||||
assert "searching-messages.md" not in out
|
||||
assert "creating-skills.md" not in out
|
||||
assert "references/workflows" not in out
|
||||
|
||||
Reference in New Issue
Block a user