feat: complete v0.3.1 agent workflow
This commit is contained in:
@@ -3,10 +3,12 @@ package app
|
||||
import (
|
||||
"context"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"agentu/internal/agent"
|
||||
"agentu/internal/session"
|
||||
"agentu/internal/skills"
|
||||
"agentu/pkg/config"
|
||||
"agentu/pkg/llm"
|
||||
)
|
||||
@@ -99,3 +101,13 @@ func TestInitializeSessionResumesExplicitID(t *testing.T) {
|
||||
t.Fatal("explicit resume did not restore saved context")
|
||||
}
|
||||
}
|
||||
|
||||
func TestSystemPromptIncludesGlobalSkillsAndApprovalMode(t *testing.T) {
|
||||
cfg := &config.Config{Agent: config.AgentConfig{SystemPrompt: "base", WorkingDir: "/tmp/project"}}
|
||||
prompt := systemPrompt(cfg, true, false, []skills.Skill{{Name: "review", Path: "/tmp/review/SKILL.md", Content: "Review carefully."}})
|
||||
for _, want := range []string{"base", "interactive user approval", "### review", "Review carefully."} {
|
||||
if !strings.Contains(prompt, want) {
|
||||
t.Fatalf("prompt missing %q:\n%s", want, prompt)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user