Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix(autopilot): show last run status in list (#8354)
GODFINNSfe4d6a49c341
diff --git a/server/cmd/multica/cmd_autopilot.go b/server/cmd/multica/cmd_autopilot.goindex 5fd9da3df3..8fd953285f 100644--- a/server/cmd/multica/cmd_autopilot.go+++ b/server/cmd/multica/cmd_autopilot.go@@ -221,13 +221,14 @@ func runAutopilotList(cmd *cobra.Command, _ []string) error {// NEXT_RUN is what distinguishes a scheduled autopilot from one with no// trigger at all. The list payload has carried next_run_at all along, but// the table dropped it, leaving the two indistinguishable here (MUL-6680).- headers := []string{"ID", "TITLE", "STATUS", "MODE", "ASSIGNEE", "NEXT_RUN", "LAST_RUN"}+ headers := []string{"ID", "TITLE", "STATUS", "LAST_STATUS", "MODE", "ASSIGNEE", "NEXT_RUN", "LAST_RUN"}rows := make([][]string, 0, len(resp.Autopilots))for _, a := range resp.Autopilots {rows = append(rows, []string{displayID(strVal(a, "id"), fullID),strVal(a, "title"),strVal(a, "status"),+ displayLastRunStatus(strVal(a, "last_run_status")),strVal(a, "execution_mode"),actors.agent(strVal(a, "assignee_id")),relativeTimestamp(strVal(a, "next_run_at")),@@ -238,6 +239,14 @@ func runAutopilotList(cmd *cobra.Command, _ []string) error {return nil}+func displayLastRunStatus(status string) string {+ trimmed := strings.TrimSpace(status)+ if trimmed == "" {+ return "—"+ }+ return trimmed+}+func runAutopilotGet(cmd *cobra.Command, args []string) error {output, _ := cmd.Flags().GetString("output")showSecrets, _ := cmd.Flags().GetBool("show-secrets")diff --git a/server/cmd/multica/cmd_autopilot_test.go b/server/cmd/multica/cmd_autopilot_test.goindex 96e4043eb6..53cb0ad6b4 100644--- a/server/cmd/multica/cmd_autopilot_test.go+++ b/server/cmd/multica/cmd_autopilot_test.go@@ -65,6 +65,54 @@ func newAutopilotGetTestCmd() *cobra.Command {return cmd}+func newAutopilotListTestCmd() *cobra.Command {+ cmd := &cobra.Command{Use: "list"}+ cmd.Flags().String("status", "", "")+ cmd.Flags().String("output", "table", "")+ cmd.Flags().Bool("full-id", false, "")+ return cmd+}++func TestRunAutopilotListTableShowsLastRunStatus(t *testing.T) {+ const autopilotID = "11111111-1111-1111-1111-111111111111"++ srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {+ if r.Method != http.MethodGet || r.URL.Path != "/api/autopilots" {+ t.Fatalf("request = %s %s, want GET /api/autopilots", r.Method, r.URL.Path)+ }+ _ = json.NewEncoder(w).Encode(map[string]any{+ "autopilots": []map[string]any{+ {+ "id": autopilotID,+ "title": "GitHub Ops — Stall & Sync Sweep",+ "status": "active",+ "last_run_status": "failed",+ "execution_mode": "run_only",+ "last_run_at": "2026-09-09T20:00:02Z",+ "next_run_at": "2026-09-10T08:00:00Z",+ },+ },+ "total": 1,+ })+ }))+ defer srv.Close()++ setCLITestServerEnv(t, srv.URL)++ out, err := captureStdout(t, func() error {+ return runAutopilotList(newAutopilotListTestCmd(), nil)+ })+ if err != nil {+ t.Fatalf("runAutopilotList: %v", err)+ }++ for _, want := range []string{"LAST_STATUS", "failed", "active", "run_only"} {+ if !strings.Contains(out, want) {+ t.Fatalf("table output missing %q:\n%s", want, out)+ }+ }+}+func TestRunAutopilotGetRedactsWebhookCredentialsByDefault(t *testing.T) {const (autopilotID = "11111111-1111-1111-1111-111111111111"diff --git a/server/internal/service/builtin_skills/multica-platform/references/autopilots.md b/server/internal/service/builtin_skills/multica-platform/references/autopilots.mdindex c8ed7f1d91..e598afc2b4 100644--- a/server/internal/service/builtin_skills/multica-platform/references/autopilots.md+++ b/server/internal/service/builtin_skills/multica-platform/references/autopilots.md@@ -48,6 +48,11 @@ offline, quota exhausted, a duplicate already in flight — dispatched nothing,its `failure_reason` says which. Do not report a manual run as done withoutseeing one of those two statuses.+The default `multica autopilot list` table includes `LAST_STATUS`. Treat a+healthy-looking `STATUS=active` row with `LAST_STATUS=failed` as a failing+autopilot; inspect `multica autopilot runs <id> --output json` for the failure+reason.+A schedule trigger without `--timezone` runs in **UTC**. Name the zone whenevera human confirmed a wall-clock time, or they will confirm a morning job andreceive an afternoon one.