mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-14 22:09:37 +08:00
feat: expand mcp transports and skill execution
This commit is contained in:
27
pkg/tools/skill_exec_test.go
Normal file
27
pkg/tools/skill_exec_test.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package tools
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSkillExecWriteAuditIncludesCallerIdentity(t *testing.T) {
|
||||
workspace := t.TempDir()
|
||||
tool := NewSkillExecTool(workspace)
|
||||
|
||||
tool.writeAudit("demo", "scripts/run.sh", "test", "coder", "subagent", true, "")
|
||||
|
||||
data, err := os.ReadFile(filepath.Join(workspace, "memory", "skill-audit.jsonl"))
|
||||
if err != nil {
|
||||
t.Fatalf("read audit file: %v", err)
|
||||
}
|
||||
text := string(data)
|
||||
if !strings.Contains(text, `"caller_agent":"coder"`) {
|
||||
t.Fatalf("expected caller_agent in audit row, got: %s", text)
|
||||
}
|
||||
if !strings.Contains(text, `"caller_scope":"subagent"`) {
|
||||
t.Fatalf("expected caller_scope in audit row, got: %s", text)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user