Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/cli/commands/launch.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ var hostApps = map[string]hostApp{
"codex": {envFn: openaiEnv("/v1")},
"claude": {envFn: anthropicEnv},
"openclaw": {configInstructions: openclawConfigInstructions},
"droid": {envFn: openaiEnv("/v1")},
"pi": {envFn: openaiEnv("/v1")},
}

// supportedApps is derived from the registries above.
Expand Down
35 changes: 35 additions & 0 deletions cmd/cli/commands/launch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,41 @@ func TestLaunchHostAppDryRunCodex(t *testing.T) {
require.NotContains(t, output, "/engines/v1")
}

func TestLaunchHostAppDryRunDroid(t *testing.T) {
buf := new(bytes.Buffer)
cmd := newTestCmd(buf)

cli := hostApp{envFn: openaiEnv("/v1")}
err := launchHostApp(cmd, "ls", testBaseURL, cli, nil, true)
require.NoError(t, err)

output := buf.String()
require.Contains(t, output, "Would run: ls")
require.Contains(t, output, "OPENAI_BASE_URL="+testBaseURL+"/v1")
require.Contains(t, output, "OPENAI_API_KEY="+dummyAPIKey)
require.NotContains(t, output, "/engines/v1")
}

func TestLaunchHostAppDryRunPi(t *testing.T) {
buf := new(bytes.Buffer)
cmd := newTestCmd(buf)

cli := hostApp{envFn: openaiEnv("/v1")}
err := launchHostApp(cmd, "ls", testBaseURL, cli, nil, true)
require.NoError(t, err)

output := buf.String()
require.Contains(t, output, "Would run: ls")
require.Contains(t, output, "OPENAI_BASE_URL="+testBaseURL+"/v1")
require.Contains(t, output, "OPENAI_API_KEY="+dummyAPIKey)
require.NotContains(t, output, "/engines/v1")
}

func TestDroidAndPiInSupportedApps(t *testing.T) {
require.Contains(t, supportedApps, "droid", "droid should be in supportedApps")
require.Contains(t, supportedApps, "pi", "pi should be in supportedApps")
}

func TestLaunchHostAppDryRunWithArgs(t *testing.T) {
buf := new(bytes.Buffer)
cmd := newTestCmd(buf)
Expand Down