@@ -52,14 +52,14 @@ func TestExecuteAgentListUsesHTTPClient(t *testing.T) {
5252 if req .URL .String () != "http://example.test/api/v1/agents" {
5353 t .Fatalf ("url = %q, want %q" , req .URL .String (), "http://example.test/api/v1/agents" )
5454 }
55- return jsonResponse (http .StatusOK , `[{"id":"u-alice","name":"alice","role":"worker","status":"running","created_at":"2026-04-01T12:00:00Z"}]` ), nil
55+ return jsonResponse (http .StatusOK , `[{"id":"u-alice","name":"alice","role":"worker","status":"running","created_at":"2026-04-01T12:00:00Z","profile":"codex-main" }]` ), nil
5656 }),
5757 }
5858
5959 if err := app .Execute (context .Background (), []string {"--endpoint" , "http://example.test" , "agent" , "list" }); err != nil {
6060 t .Fatalf ("Execute() error = %v" , err )
6161 }
62- assertTableHasRow (t , stdout .String (), "u-alice" , "alice" , "worker" , "running" )
62+ assertTableHasRow (t , stdout .String (), "u-alice" , "alice" , "worker" , "running" , "codex-main" )
6363}
6464
6565func TestExecuteBotListUsesDefaultChannel (t * testing.T ) {
@@ -253,8 +253,8 @@ func TestExecuteMessageSendsToFeishuChannel(t *testing.T) {
253253func TestRenderAgentsTableAlignsLongColumns (t * testing.T ) {
254254 var buf bytes.Buffer
255255 agents := []agent.Agent {
256- {ID : "u-manager" , Name : "manager" , Role : "manager" , Status : "running" },
257- {ID : "u-dev" , Name : "dev" , Role : "worker" , Status : "running" },
256+ {ID : "u-manager" , Name : "manager" , Role : "manager" , Status : "running" , Profile : "codex-main" },
257+ {ID : "u-dev" , Name : "dev" , Role : "worker" , Status : "running" , Profile : "claude-main" },
258258 {ID : "u-alex" , Name : "alex" , Role : "worker" , Status : "running" },
259259 }
260260
@@ -267,7 +267,7 @@ func TestRenderAgentsTableAlignsLongColumns(t *testing.T) {
267267 t .Fatalf ("line count = %d, want 4; output=%q" , len (lines ), buf .String ())
268268 }
269269
270- re := regexp .MustCompile (`^(\S+)(\s{2,})(\S+)(\s{2,})(\S+)(\s{2,})(\S+)$` )
270+ re := regexp .MustCompile (`^(\S+)(\s{2,})(\S+)(\s{2,})(\S+)(\s{2,})(\S+)(\s{2,})(\S+) $` )
271271 if re .FindStringSubmatchIndex (lines [0 ]) == nil {
272272 t .Fatalf ("header not aligned: %q" , lines [0 ])
273273 }
@@ -282,6 +282,16 @@ func TestRenderAgentsTableAlignsLongColumns(t *testing.T) {
282282 }
283283}
284284
285+ func TestRenderAgentsTableUsesDashForMissingProfile (t * testing.T ) {
286+ var buf bytes.Buffer
287+
288+ if err := renderAgentsTable (& buf , []agent.Agent {{ID : "u-alice" , Name : "alice" , Role : "worker" , Status : "running" }}); err != nil {
289+ t .Fatalf ("renderAgentsTable() error = %v" , err )
290+ }
291+
292+ assertTableHasRow (t , buf .String (), "u-alice" , "alice" , "worker" , "running" , "-" )
293+ }
294+
285295func TestExecuteAgentCreateUsesHTTPClient (t * testing.T ) {
286296 var stdout bytes.Buffer
287297 app := & App {
@@ -308,19 +318,19 @@ func TestExecuteAgentCreateUsesHTTPClient(t *testing.T) {
308318 if payload ["description" ] != "worker" {
309319 t .Fatalf ("payload[description] = %#v, want %q" , payload ["description" ], "worker" )
310320 }
311- if payload ["model_id " ] != "gpt-test " {
312- t .Fatalf ("payload[model_id ] = %#v, want %q" , payload ["model_id " ], "gpt-test " )
321+ if payload ["profile " ] != "cliproxy-codex " {
322+ t .Fatalf ("payload[profile ] = %#v, want %q" , payload ["profile " ], "cliproxy-codex " )
313323 }
314324
315- return jsonResponse (http .StatusCreated , `{"id":"u-alice","name":"alice","role":"worker","status":"running","created_at":"2026-04-01T12:00:00Z"}` ), nil
325+ return jsonResponse (http .StatusCreated , `{"id":"u-alice","name":"alice","role":"worker","status":"running","created_at":"2026-04-01T12:00:00Z","profile":"codex-main" }` ), nil
316326 }),
317327 }
318328
319- err := app .Execute (context .Background (), []string {"--endpoint" , "http://example.test" , "--token" , "secret-token" , "agent" , "create" , "--name" , "alice" , "--description" , "worker" , "--model-id " , "gpt-test " })
329+ err := app .Execute (context .Background (), []string {"--endpoint" , "http://example.test" , "--token" , "secret-token" , "agent" , "create" , "--name" , "alice" , "--description" , "worker" , "--profile " , "cliproxy-codex " })
320330 if err != nil {
321331 t .Fatalf ("Execute() error = %v" , err )
322332 }
323- assertTableHasRow (t , stdout .String (), "u-alice" , "alice" , "worker" , "running" )
333+ assertTableHasRow (t , stdout .String (), "u-alice" , "alice" , "worker" , "running" , "codex-main" )
324334}
325335
326336func TestExecuteAgentDeleteUsesHTTPClient (t * testing.T ) {
@@ -357,14 +367,14 @@ func TestExecuteAgentStatusByIDUsesHTTPClient(t *testing.T) {
357367 if req .URL .String () != "http://example.test/api/v1/agents/u-alice" {
358368 t .Fatalf ("url = %q, want %q" , req .URL .String (), "http://example.test/api/v1/agents/u-alice" )
359369 }
360- return jsonResponse (http .StatusOK , `{"id":"u-alice","name":"alice","role":"worker","status":"running","created_at":"2026-04-01T12:00:00Z"}` ), nil
370+ return jsonResponse (http .StatusOK , `{"id":"u-alice","name":"alice","role":"worker","status":"running","created_at":"2026-04-01T12:00:00Z","profile":"codex-main" }` ), nil
361371 }),
362372 }
363373
364374 if err := app .Execute (context .Background (), []string {"--endpoint" , "http://example.test" , "agent" , "status" , "u-alice" }); err != nil {
365375 t .Fatalf ("Execute() error = %v" , err )
366376 }
367- assertTableHasRow (t , stdout .String (), "u-alice" , "alice" , "worker" , "running" )
377+ assertTableHasRow (t , stdout .String (), "u-alice" , "alice" , "worker" , "running" , "codex-main" )
368378}
369379
370380func TestExecuteAgentLogsUsesHTTPClient (t * testing.T ) {
0 commit comments