fix(skills): harden canonical agent installation

This commit is contained in:
玉澜 committed 2026-08-13 21:22:57 +08:00
1 parent 9ff31cdd55
commit de8df0fa6f
22 files changed
+571 -75

No files matched your search

+8 -1
View File
@@ -135,11 +135,18 @@ func TestPackageManagerVerifierCoversSpecificAndFallbackSkillRoots(t *testing.T)
}
verifyCmd := exec.Command("sh", verifierPath, "--npm-only")
verifyCmd.Env = append(os.Environ(), "DWS_PACKAGE_DIST_DIR="+distDir)
hostXDG := filepath.Join(t.TempDir(), "host-xdg")
verifyCmd.Env = replaceTestEnv(os.Environ(),
"DWS_PACKAGE_DIST_DIR", distDir,
"XDG_CONFIG_HOME", hostXDG,
)
output, err := verifyCmd.CombinedOutput()
if err != nil {
t.Fatalf("verify-package-managers.sh error = %v\noutput:\n%s", err, output)
}
if _, err := os.Stat(hostXDG); !os.IsNotExist(err) {
t.Fatalf("package verifier touched inherited XDG_CONFIG_HOME %s: %v", hostXDG, err)
}
for _, scenario := range []string{"specific-agent-roots", "generic-fallback"} {
if !strings.Contains(string(output), "verifying npm package install ("+scenario+")") {
t.Errorf("verifier output is missing %s scenario:\n%s", scenario, output)