fix(install): include agent metadata config in profile installs (#280)

Co-authored-by: Leslie <leslie@Mac-mini.local>
This commit is contained in:
Liang Xiao 2026-03-25 06:15:33 +08:00 committed by GitHub
parent 659cd61cc8
commit 70b7d362dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 52 additions and 2 deletions

View file

@ -3089,6 +3089,20 @@
"dependencies": [],
"category": "essential"
},
{
"id": "agent-metadata",
"name": "Agent Metadata",
"type": "config",
"path": ".opencode/config/agent-metadata.json",
"description": "Centralized agent metadata used for runtime resolution, registry management, and dependency discovery",
"tags": [
"config",
"agents",
"metadata"
],
"dependencies": [],
"category": "essential"
},
{
"id": "readme",
"name": "README",
@ -3133,7 +3147,8 @@
"context:workflows-review",
"context:system-context-guide",
"context:adding-skill-basics",
"config:env-example"
"config:env-example",
"config:agent-metadata"
]
},
"developer": {
@ -3179,6 +3194,7 @@
"context:clean-code",
"context:api-design",
"config:env-example",
"config:agent-metadata",
"config:readme",
"context:openagents-repo/*"
]
@ -3210,6 +3226,7 @@
"context:project-intelligence/*",
"context:adding-skill-basics",
"config:env-example",
"config:agent-metadata",
"config:readme"
]
},
@ -3264,6 +3281,7 @@
"context:clean-code",
"context:api-design",
"config:env-example",
"config:agent-metadata",
"config:readme",
"context:openagents-repo/*"
]
@ -3338,6 +3356,7 @@
"context:frontmatter",
"context:codebase-references",
"config:env-example",
"config:agent-metadata",
"config:readme"
],
"additionalPaths": [
@ -3347,7 +3366,7 @@
}
},
"metadata": {
"lastUpdated": "2026-01-31",
"lastUpdated": "2026-03-21",
"schemaVersion": "1.0.0"
},
"subagents": {

View file

@ -62,6 +62,7 @@ test_essential_profile() {
"agent/subagents/core/documentation.md"
"command/context.md"
"command/clean.md"
"config/agent-metadata.json"
"context/core/essential-patterns.md"
"context/project/project-context.md"
)
@ -96,6 +97,7 @@ test_developer_profile() {
"agent/subagents/code/build-agent.md"
"command/commit.md"
"command/test.md"
"config/agent-metadata.json"
"context/core/standards/code.md"
)
@ -113,6 +115,29 @@ test_developer_profile() {
fi
}
test_agent_metadata_installed() {
echo -e "\n${BOLD}Test: Agent Metadata Config Installation${NC}"
local install_dir="$TEST_DIR/metadata-test/.opencode"
bash "$REPO_ROOT/install.sh" developer --install-dir="$install_dir" > "$TEST_DIR/metadata.log" 2>&1
local metadata_file="$install_dir/config/agent-metadata.json"
if [ -f "$metadata_file" ]; then
pass "Installed agent metadata config"
else
fail "Missing agent metadata config"
return
fi
if command -v jq &> /dev/null && jq -e '.agents.openagent.name == "OpenAgent"' "$metadata_file" > /dev/null; then
pass "Agent metadata file contains expected agent entries"
else
fail "Agent metadata file missing expected OpenAgent entry"
fi
}
test_custom_install_dir() {
echo -e "\n${BOLD}Test: Custom Installation Directory${NC}"
@ -264,6 +289,7 @@ main() {
test_help_and_list
test_essential_profile
test_developer_profile
test_agent_metadata_installed
test_custom_install_dir
test_skip_existing_files
test_file_content_validity

View file

@ -81,6 +81,11 @@ test_fresh_install_piped() {
if echo "" | bash "$REPO_ROOT/install.sh" essential --install-dir="$install_dir" 2>&1 | grep -q "Installation complete"; then
if [ -d "$install_dir" ]; then
pass "Fresh install completed successfully via pipe"
if [ -f "$install_dir/config/agent-metadata.json" ]; then
pass "Fresh piped install included agent metadata config"
else
fail "Fresh piped install missing agent metadata config"
fi
else
fail "Install reported success but directory not created"
fi