Migrate CLI execution and terminal reports

This commit is contained in:
2026-11-18 19:04:15 +00:00
parent e7a8b0db04
commit 77f168c660
7 changed files with 66 additions and 66 deletions

View File

@@ -106,7 +106,6 @@ func (textPreparedRunFormatter) Format(prepared *promptkit.PreparedRun) ([]byte,
var b bytes.Buffer
fmt.Fprintf(&b, "prompt: %s\n", prepared.PromptID)
fmt.Fprintf(&b, "prompt_version: %s\n", prepared.PromptVersion)
fmt.Fprintf(&b, "selected_profile_id: %s\n", prepared.SelectedProfileID)
if prepared.SelectedBackendID != "" {
fmt.Fprintf(&b, "selected_backend_id: %s\n", prepared.SelectedBackendID)

View File

@@ -17,10 +17,12 @@ func TestTextFormatterIncludesPreparedRunDetails(t *testing.T) {
t.Fatalf("expected no error, got %v", err)
}
s := string(out)
if strings.Contains(s, "prompt_version") {
t.Fatalf("unexpected prompt version in text output: %s", s)
}
for _, want := range []string{
"prompt: prompt.id",
"prompt_version: v1",
"selected_profile_id: local-fast",
"selected_backend_id: local",
"endpoint: http://llm/v1",
@@ -194,8 +196,8 @@ func TestJSONFormatterEmitsValidJSONAndIncludesPreparedRunFields(t *testing.T) {
if decoded["prompt_id"] != "prompt.id" {
t.Fatalf("expected prompt_id in json output, got %#v", decoded["prompt_id"])
}
if decoded["prompt_version"] != "v1" {
t.Fatalf("expected prompt_version in json output, got %#v", decoded["prompt_version"])
if _, ok := decoded["prompt_version"]; ok {
t.Fatalf("unexpected prompt_version in json output: %#v", decoded)
}
if decoded["selected_profile_id"] != "local-fast" {
t.Fatalf("expected selected_profile_id in json output, got %#v", decoded["selected_profile_id"])
@@ -344,7 +346,6 @@ func TestFormatPreparedRunByNameUnknownFailsClearly(t *testing.T) {
func samplePreparedRun() *promptkit.PreparedRun {
return &promptkit.PreparedRun{
PromptID: "prompt.id",
PromptVersion: "v1",
PromptHash: "prompt-hash",
SelectedProfileID: "local-fast",
SelectedBackendID: "local",