Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
58 lines
1.5 KiB
Go
58 lines
1.5 KiB
Go
package agentruntime
|
|
|
|
import "testing"
|
|
|
|
func TestAppServerTurnProjectionTerminalClassificationMatchesLegacy(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
tests := []struct {
|
|
name string
|
|
turn map[string]any
|
|
want codexAppServerTurnPhase
|
|
}{
|
|
{
|
|
name: "completed",
|
|
turn: map[string]any{"id": "turn-1", "status": "completed"},
|
|
want: codexAppServerTurnPhaseCompleted,
|
|
},
|
|
{
|
|
name: "failed",
|
|
turn: map[string]any{"id": "turn-1", "status": "failed"},
|
|
want: codexAppServerTurnPhaseFailed,
|
|
},
|
|
{
|
|
name: "interrupted",
|
|
turn: map[string]any{"id": "turn-1", "status": "interrupted"},
|
|
want: codexAppServerTurnPhaseCanceled,
|
|
},
|
|
{
|
|
name: "unknown remains legacy completed",
|
|
turn: map[string]any{"id": "turn-1", "status": "done"},
|
|
want: codexAppServerTurnPhaseCompleted,
|
|
},
|
|
}
|
|
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
t.Parallel()
|
|
projected := appServerProjectedTurnTerminalPhase(tt.turn, false)
|
|
legacy := appServerLegacyTurnTerminalPhase(tt.turn)
|
|
if projected != legacy {
|
|
t.Fatalf("projected phase = %q, legacy = %q", projected, legacy)
|
|
}
|
|
if projected != tt.want {
|
|
t.Fatalf("projected phase = %q, want %q", projected, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
func TestAppServerTurnProjectionForceCanceledWins(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
turn := map[string]any{"id": "turn-1", "status": "completed"}
|
|
if got := appServerProjectedTurnTerminalPhase(turn, true); got != codexAppServerTurnPhaseCanceled {
|
|
t.Fatalf("force-canceled phase = %q, want %q", got, codexAppServerTurnPhaseCanceled)
|
|
}
|
|
}
|