ee1553913(Yink88564391 on X) put an Open button on Codex's Agents row, between its Details and its model picker, so that row's Details sat further left than every other row's (the owner, 11-13: "导致整个页面在 视觉上不是对齐的"). The button is gone. Codex's row menu, beside Open in terminal, has "Open the Codex app" where the desktop app is installed and Open Codex with doesn't say Terminal (openApp); it posts agents/open with the id alone as the button did. With no app, Open in terminal is the menu's only way, as before the button. The tray panel and the web build have neither. Its CSS and the "Open Codex in a terminal" words go; comments and the setting's error say "Open Codex with", not the button. codex-open-button.test.cjs now opens the menu, and checks every connected row's Details and model picker start at one x. Run (mica): GUI codex-open-button 62/62, agent-open-terminal 24/24, agent-prefs 56/56, i18n-keys, i18n-en-no-cjk, chromium and webkit, en/zh/zh-TW/ja/de, 900 and 400px; go vet internal/gui, settings, provider; go test internal/gui, settings, provider, agent -run "Codex|Budget|Settings" ok; gofmt clean. Broken by hand: the button put back on the row turns the line-up check red (codex 479 vs claude 532 at 900px, every language). Again at 5c1c38f63 after the rebase ontodbaf9d68c(mica): codex-open-button 62/62, i18n-keys, go test internal/gui -run "Budget|Codex" ok. Not tried: a real Codex app open from the menu; Windows and Linux.
47 lines
1.7 KiB
Go
47 lines
1.7 KiB
Go
package agent
|
|
|
|
import (
|
|
"context"
|
|
"path/filepath"
|
|
"testing"
|
|
)
|
|
|
|
// Open the Codex app (Yink88564391 on X): on a Mac it opens the bundle
|
|
// whose Info.plist says com.openai.codex, never the ChatGPT chat app's
|
|
// of the same name; on Windows it starts the Store package's app; with no
|
|
// app installed it opens nothing and says so.
|
|
func TestOpenCodexApp(t *testing.T) {
|
|
restartSandbox(t)
|
|
apps := filepath.Join(t.TempDir(), "Applications")
|
|
appFolders = func() []string { return []string{apps} }
|
|
var opened []string
|
|
appOpen = func(_ context.Context, b string) error { opened = append(opened, b); return nil }
|
|
var launched []winProc
|
|
winLaunch = func(p winProc) error { launched = append(launched, p); return nil }
|
|
|
|
restartOnMac = true
|
|
if CodexAppInstalled() || OpenCodexApp(context.Background()) == nil || len(opened) != 0 {
|
|
t.Fatalf("no app installed, yet installed=%v opened=%q", CodexAppInstalled(), opened)
|
|
}
|
|
installApp(t, apps, "ChatGPT.app", codexAppPlist("com.openai.chat", "1.2026.280"))
|
|
if CodexAppInstalled() || OpenCodexApp(context.Background()) == nil || len(opened) != 0 {
|
|
t.Fatalf("the chat app taken for Codex's: opened %q", opened)
|
|
}
|
|
installApp(t, apps, "Codex.app", codexAppPlist("com.openai.codex", "26.930.31730"))
|
|
if !CodexAppInstalled() {
|
|
t.Fatal("Codex.app not seen")
|
|
}
|
|
if err := OpenCodexApp(context.Background()); err != nil || len(opened) != 1 || opened[0] != filepath.Join(apps, "Codex.app") {
|
|
t.Fatalf("opened %q (%v)", opened, err)
|
|
}
|
|
|
|
// Linux has no launcher magpie starts
|
|
restartOnMac = false
|
|
if CodexAppInstalled() || OpenCodexApp(context.Background()) == nil {
|
|
t.Fatal("offered to open the app where magpie cannot")
|
|
}
|
|
if len(launched) != 0 {
|
|
t.Fatalf("launched %v off Windows", launched)
|
|
}
|
|
}
|