Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
refactor(star-prompt): remove the deployment opt-out switch (#10292)
Bohan Jiangb7f8efcaae6c
diff --git a/.env.example b/.env.exampleindex 69215c4e13..dd0f25358a 100644--- a/.env.example+++ b/.env.example@@ -739,10 +739,6 @@ DISABLE_WORKSPACE_CREATION=# workspaces. Requires a backend restart.WORKSPACE_CREATION_ALLOWED_EMAILS=-# Set to "true" to stop the app from asking users to star Multica on GitHub.-# Read from /api/config at runtime; requires a backend restart.-DISABLE_STAR_PROMPT=-# ==================== Anonymous Self-host Telemetry ====================# The API server sends one first-party, deployment-level anonymous snapshot per# UTC day to https://telemetry.multica.ai. It contains the release version,diff --git a/SELF_HOSTING_ADVANCED.md b/SELF_HOSTING_ADVANCED.mdindex 075b5908a5..68d2eae20e 100644--- a/SELF_HOSTING_ADVANCED.md+++ b/SELF_HOSTING_ADVANCED.md@@ -111,14 +111,6 @@ Things to know:> Note: setting `ALLOW_SIGNUP=false` enables invite-only account creation. A new user with a live pending workspace invitation can create an account with the invited email; users without an allowlist match or a valid invitation remain blocked. Invitations also permit emails outside configured allowlists when `ALLOW_SIGNUP=true`. Revocation does not delete accounts already created using an invitation or prevent those accounts from signing in. Combine this with `DISABLE_WORKSPACE_CREATION=true` when invitees must join an existing workspace instead of creating their own.-### GitHub Star Prompt (Optional)--| Variable | Description |-|----------|-------------|-| `DISABLE_STAR_PROMPT` | Set to `true` to stop the app from asking users to star Multica on GitHub |--The prompt is a small card that can appear after an agent has completed a few issues: at most twice per account, at least 30 days apart, and never again once the user clicks Star. Users can still star Multica from the Help menu. While the card or Help menu is open, the browser asks `api.github.com` for the star count; with the switch on, the server rejects new showings and the card never appears. Changes take effect after restarting the backend; the web UI reads the switch from `/api/config`, so no web rebuild is needed.-### File Storage (Optional)Uploads and attachments are written to local disk by default. Set `S3_BUCKET` todiff --git a/apps/web/features/landing/i18n/en.ts b/apps/web/features/landing/i18n/en.tsindex 29cc8a95d3..5f05d06977 100644--- a/apps/web/features/landing/i18n/en.ts+++ b/apps/web/features/landing/i18n/en.ts@@ -326,7 +326,7 @@ export function createEnDict(): LandingDict {"Rename a project from its menu in the project list or on the project page.","Edit a saved view from its menu in the sidebar.","Drag the icons in the left navigation bar to reorder spaces.",- "After you finish some work, Multica may ask you to star it on GitHub, at most twice per account and at least 30 days apart. The Help menu always has a GitHub link. Self-hosted deployments can turn the prompt off with DISABLE_STAR_PROMPT=true.",+ "After you finish some work, Multica may ask you to star it on GitHub, at most twice per account and at least 30 days apart. The Help menu always has a GitHub link.",],improvements: ["The navigation bar is narrower, buttons and labels are rectangular by default, the desktop title bar and panel edges line up, and on wide screens Issues and chat use a wider reading column.",diff --git a/apps/web/features/landing/i18n/ja.ts b/apps/web/features/landing/i18n/ja.tsindex 4414214f91..e0fa219e12 100644--- a/apps/web/features/landing/i18n/ja.ts+++ b/apps/web/features/landing/i18n/ja.ts@@ -87,7 +87,7 @@ export function createJaDict(): LandingDict {"プロジェクト一覧やプロジェクトのページのメニューから、プロジェクトの名前を変更できます。","サイドバーで、保存済みビューのメニューからそのビューを編集できます。","左のナビゲーションバーのアイコンをドラッグして、スペースを並べ替えられます。",- "ある程度作業を終えると、GitHub でのスターをお願いすることがあります。1 アカウントにつき最大 2 回、30 日以上あけて表示されます。ヘルプメニューにはいつでも GitHub へのリンクがあります。セルフホストでは DISABLE_STAR_PROMPT=true で表示を止められます。",+ "ある程度作業を終えると、GitHub でのスターをお願いすることがあります。1 アカウントにつき最大 2 回、30 日以上あけて表示されます。ヘルプメニューにはいつでも GitHub へのリンクがあります。",],improvements: ["ナビゲーションバーが細くなり、ボタンとラベルは既定で四角になりました。デスクトップのタイトルバーとパネルの端がそろい、広い画面では Issue とチャットの本文が広い幅で表示されます。",diff --git a/apps/web/features/landing/i18n/ko.ts b/apps/web/features/landing/i18n/ko.tsindex 7c9d086031..6a2cb09600 100644--- a/apps/web/features/landing/i18n/ko.ts+++ b/apps/web/features/landing/i18n/ko.ts@@ -86,7 +86,7 @@ export function createKoDict(): LandingDict {"프로젝트 목록이나 프로젝트 페이지의 메뉴에서 프로젝트 이름을 바꿀 수 있습니다.","사이드바에서 저장된 보기의 메뉴로 그 보기를 바로 편집할 수 있습니다.","왼쪽 탐색 바의 아이콘을 끌어서 공간 순서를 바꿀 수 있습니다.",- "작업을 어느 정도 마치면 GitHub 별표를 요청할 수 있습니다. 계정마다 최대 두 번, 최소 30일 간격으로 표시됩니다. 도움말 메뉴에는 항상 GitHub 링크가 있습니다. 셀프 호스팅에서는 DISABLE_STAR_PROMPT=true로 끌 수 있습니다.",+ "작업을 어느 정도 마치면 GitHub 별표를 요청할 수 있습니다. 계정마다 최대 두 번, 최소 30일 간격으로 표시됩니다. 도움말 메뉴에는 항상 GitHub 링크가 있습니다.",],improvements: ["탐색 바가 좁아지고 버튼과 라벨은 기본적으로 사각형이 됐습니다. 데스크톱 제목 표시줄과 패널 가장자리가 맞춰지고, 넓은 화면에서는 Issue와 채팅 본문이 더 넓은 폭으로 표시됩니다.",diff --git a/apps/web/features/landing/i18n/zh.ts b/apps/web/features/landing/i18n/zh.tsindex 97bb2fbbbc..aa65d3cf1d 100644--- a/apps/web/features/landing/i18n/zh.ts+++ b/apps/web/features/landing/i18n/zh.ts@@ -311,7 +311,7 @@ export function createZhDict(): LandingDict {"在项目列表或项目页面的菜单里可以直接重命名项目。","在侧栏里可以从已保存视图的菜单直接编辑它。","拖动左侧导航栏里的图标即可调整空间顺序。",- "完成一些工作后,Multica 可能会邀请你在 GitHub 上点 Star,每个账号最多两次、间隔至少 30 天。帮助菜单里始终有 GitHub 链接。自部署可以设置 DISABLE_STAR_PROMPT=true 关闭这个提示。",+ "完成一些工作后,Multica 可能会邀请你在 GitHub 上点 Star,每个账号最多两次、间隔至少 30 天。帮助菜单里始终有 GitHub 链接。",],improvements: ["导航栏变窄,按钮和标签默认为矩形,桌面端标题栏和面板边缘对齐;宽屏下 Issue 和聊天使用更宽的阅读区域。",diff --git a/deploy/helm/multica/templates/configmap.yaml b/deploy/helm/multica/templates/configmap.yamlindex 387fbd4005..b6cf25d077 100644--- a/deploy/helm/multica/templates/configmap.yaml+++ b/deploy/helm/multica/templates/configmap.yaml@@ -22,7 +22,6 @@ data:ALLOWED_EMAIL_DOMAINS: {{ .Values.backend.config.allowedEmailDomains | quote }}DISABLE_WORKSPACE_CREATION: {{ .Values.backend.config.disableWorkspaceCreation | quote }}WORKSPACE_CREATION_ALLOWED_EMAILS: {{ .Values.backend.config.workspaceCreationAllowedEmails | quote }}- DISABLE_STAR_PROMPT: {{ .Values.backend.config.disableStarPrompt | quote }}DO_NOT_TRACK: {{ .Values.backend.config.doNotTrack | quote }}MULTICA_VCS_INTEGRATION_ENABLED: {{ .Values.backend.config.vcsIntegrationEnabled | quote }}MULTICA_CLOUD_URL: {{ .Values.backend.config.cloud.url | quote }}diff --git a/deploy/helm/multica/values.yaml b/deploy/helm/multica/values.yamlindex 8da494238d..ec80c031a3 100644--- a/deploy/helm/multica/values.yaml+++ b/deploy/helm/multica/values.yaml@@ -152,8 +152,6 @@ backend:# create workspaces. Empty = every signed-in user may create one.# disableWorkspaceCreation=true still blocks everyone.workspaceCreationAllowedEmails: ""- # Set to true to stop the app from asking users to star Multica on GitHub.- disableStarPrompt: false# Set to "1" or "true" to disable first-party anonymous self-host# telemetry collection and delivery.doNotTrack: ""diff --git a/docker-compose.selfhost.yml b/docker-compose.selfhost.ymlindex a194b42caf..9b89bac181 100644--- a/docker-compose.selfhost.yml+++ b/docker-compose.selfhost.yml@@ -113,7 +113,6 @@ services:ALLOWED_EMAIL_DOMAINS: ${ALLOWED_EMAIL_DOMAINS:-}DISABLE_WORKSPACE_CREATION: ${DISABLE_WORKSPACE_CREATION:-}WORKSPACE_CREATION_ALLOWED_EMAILS: ${WORKSPACE_CREATION_ALLOWED_EMAILS:-}- DISABLE_STAR_PROMPT: ${DISABLE_STAR_PROMPT:-}DO_NOT_TRACK: ${DO_NOT_TRACK:-}# Managed Cloud stays off for self-hosting. All managed Cloud clients use# this single URL when it is configured.diff --git a/packages/core/api/schemas.ts b/packages/core/api/schemas.tsindex 5f4c41b55c..7f55057f00 100644--- a/packages/core/api/schemas.ts+++ b/packages/core/api/schemas.ts@@ -957,8 +957,6 @@ export interface AppConfigResponse {daemon_app_url?: string;daemon_setup_target?: "cloud" | "self_host" | "unknown";workspace_creation_disabled?: boolean;- /** DISABLE_STAR_PROMPT on the server. Absent means the prompt is allowed. */- star_prompt_disabled?: boolean;/** Whether this deployment offers the self-hosted Git provider integration* (self-host only; off on the managed cloud). Absent/false hides the whole* Settings → Integrations "Git providers" section. */@@ -1246,7 +1244,6 @@ export const AppConfigSchema = z.object({daemon_app_url: OptionalStringSchema,daemon_setup_target: z.enum(["cloud", "self_host", "unknown"]).optional().catch("unknown"),workspace_creation_disabled: BooleanWithDefaultSchema(false).optional(),- star_prompt_disabled: BooleanWithDefaultSchema(false).optional(),vcs_integration_available: BooleanWithDefaultSchema(false).optional(),feature_flags: FeatureFlagsSchema,local_worktree_supported: BooleanWithDefaultSchema(false),@@ -1266,7 +1263,6 @@ export const EMPTY_APP_CONFIG: AppConfigResponse = {daemon_app_url: "",daemon_setup_target: "unknown",workspace_creation_disabled: false,- star_prompt_disabled: false,vcs_integration_available: false,// Fail closed: an unreadable config must not look like a server that// validates execution_mode.diff --git a/packages/core/config/index.ts b/packages/core/config/index.tsindex 8cb9c8bb27..3a1278a414 100644--- a/packages/core/config/index.ts+++ b/packages/core/config/index.ts@@ -19,9 +19,6 @@ interface ConfigState {// must be hidden. Defaults to false so unknown / older servers behave like// the managed-cloud case.workspaceCreationDisabled: boolean;- // DISABLE_STAR_PROMPT: the deployment opted out of the "Star us on GitHub"- // prompt. Defaults to false so older servers keep the prompt.- starPromptDisabled: boolean;// Self-host-only gate for the Git provider integration (Forgejo / Gitea /// GitLab). When false the whole Settings → Integrations "Git providers"// section is hidden. Defaults to false so unknown / older servers and the@@ -64,7 +61,6 @@ interface ConfigState {daemonSetupTarget?: DaemonSetupTarget;}) => void;setDaemonConfigStatus: (status: DaemonConfigStatus) => void;- setStarPromptDisabled: (disabled?: boolean) => void;setFeatureFlags: (flags?: Record<string, boolean>) => void;setServerVersion: (version?: string) => void;setLocalWorktreeSupported: (supported?: boolean) => void;@@ -84,7 +80,6 @@ export const configStore = createStore<ConfigState>((set) => ({daemonConfigStatus: "loading",daemonSetupTarget: "unknown",workspaceCreationDisabled: false,- starPromptDisabled: false,vcsIntegrationAvailable: false,featureFlags: {},serverVersion: "",@@ -111,7 +106,6 @@ export const configStore = createStore<ConfigState>((set) => ({daemonConfigStatus: "ready",}),setDaemonConfigStatus: (daemonConfigStatus) => set({ daemonConfigStatus }),- setStarPromptDisabled: (disabled = false) => set({ starPromptDisabled: disabled === true }),setFeatureFlags: (flags = {}) => set({ featureFlags: { ...flags } }),setServerVersion: (version = "") => set({ serverVersion: version }),setLocalWorktreeSupported: (supported = false) =>diff --git a/packages/core/platform/auth-initializer.tsx b/packages/core/platform/auth-initializer.tsxindex fb35c01bf3..004c3ba8ec 100644--- a/packages/core/platform/auth-initializer.tsx+++ b/packages/core/platform/auth-initializer.tsx@@ -90,7 +90,6 @@ export function AuthInitializer({daemonAppUrl: cfg.daemon_app_url,daemonSetupTarget,});- configStore.getState().setStarPromptDisabled(cfg.star_prompt_disabled);configStore.getState().setFeatureFlags(cfg.feature_flags);configStore.getState().setServerVersion(cfg.server_version);// Absent on every server that predates the worktree save gate, whichdiff --git a/packages/views/star-prompt/star-prompt.test.tsx b/packages/views/star-prompt/star-prompt.test.tsxindex e86f86dd9d..de83b43ad8 100644--- a/packages/views/star-prompt/star-prompt.test.tsx+++ b/packages/views/star-prompt/star-prompt.test.tsx@@ -3,7 +3,6 @@ import { act, fireEvent, render, screen, waitFor } from "@testing-library/react"import { QueryClient, QueryClientProvider } from "@tanstack/react-query";import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";import { setApiInstance, type ApiClient } from "@multica/core/api";-import { configStore } from "@multica/core/config";import { I18nProvider } from "@multica/core/i18n/react";import { useSessionPromptStore } from "@multica/core/session-prompt";import {@@ -128,7 +127,6 @@ afterEach(() => {vi.useRealTimers();vi.unstubAllGlobals();vi.clearAllMocks();- configStore.getState().setStarPromptDisabled(false);});describe("StarPrompt", () => {@@ -221,14 +219,6 @@ describe("StarPrompt", () => {expect(listIssues).not.toHaveBeenCalled();expect(claimStarPromptShowing).not.toHaveBeenCalled();});-- it("does nothing when the deployment turns it off", async () => {- configStore.getState().setStarPromptDisabled(true);- renderPrompt();- await agentFinishesIssue();-- expect(listIssues).not.toHaveBeenCalled();- });});describe("StarPrompt after the source survey", () => {diff --git a/packages/views/star-prompt/star-prompt.tsx b/packages/views/star-prompt/star-prompt.tsxindex d33ea2c861..e33357a169 100644--- a/packages/views/star-prompt/star-prompt.tsx+++ b/packages/views/star-prompt/star-prompt.tsx@@ -7,7 +7,6 @@ import { Button, buttonVariants } from "@multica/ui/components/ui/button";import { cn } from "@multica/ui/lib/utils";import { useAuthStore } from "@multica/core/auth";import { useChatStore } from "@multica/core/chat";-import { useConfigStore } from "@multica/core/config";import { formatStarCount, githubStarsOptions, MULTICA_GITHUB_URL } from "@multica/core/github/stars";import { createLogger } from "@multica/core/logger";import { needsSourceBackfill } from "@multica/core/onboarding";@@ -70,7 +69,6 @@ export function StarPrompt() {const wsId = useCurrentWorkspace()?.id ?? null;const qc = useQueryClient();const moment = useStarPromptStore((s) => s.moment);- const disabled = useConfigStore((s) => s.starPromptDisabled);const chatOpen = useChatStore((s) => s.isOpen);const floatingChatEnabled = useChatStore((s) => s.floatingChatEnabled);const { pathname } = useNavigation();@@ -92,7 +90,7 @@ export function StarPrompt() {if (!moment || !wsId) return;const consider = async (m: StarPromptMoment, workspaceId: string) => {- if (m.wsId !== workspaceId || disabled) return;+ if (m.wsId !== workspaceId) return;if (useSessionPromptStore.getState().prompted) return;const user = useAuthStore.getState().user;if (!starPromptDue(user, Date.now())) return;@@ -116,7 +114,7 @@ export function StarPrompt() {consider(moment, wsId).catch((err) => logger.warn("failed to evaluate star prompt", err));}, STAR_PROMPT_DELAY_MS);return () => window.clearTimeout(timer);- }, [moment, wsId, disabled, qc]);+ }, [moment, wsId, qc]);// The chat window covers this corner while it is open.if (!showing || chatOpen) return null;diff --git a/server/cmd/server/router.go b/server/cmd/server/router.goindex 6c5eab71c4..361b099486 100644--- a/server/cmd/server/router.go+++ b/server/cmd/server/router.go@@ -434,7 +434,6 @@ func NewRouterWithOptions(pool *pgxpool.Pool, hub *realtime.Hub, bus *events.BusAllowedEmails: splitAndTrim(os.Getenv("ALLOWED_EMAILS")),AllowedEmailDomains: splitAndTrim(os.Getenv("ALLOWED_EMAIL_DOMAINS")),DisableWorkspaceCreation: os.Getenv("DISABLE_WORKSPACE_CREATION") == "true",- DisableStarPrompt: os.Getenv("DISABLE_STAR_PROMPT") == "true",WorkspaceCreationAllowedEmails: splitAndTrim(os.Getenv("WORKSPACE_CREATION_ALLOWED_EMAILS")),VCSIntegrationEnabled: os.Getenv("MULTICA_VCS_INTEGRATION_ENABLED") == "true",PublicURL: strings.TrimRight(strings.TrimSpace(os.Getenv("MULTICA_PUBLIC_URL")), "/"),diff --git a/server/internal/handler/config.go b/server/internal/handler/config.goindex 2a209fd61d..3352454621 100644--- a/server/internal/handler/config.go+++ b/server/internal/handler/config.go@@ -35,9 +35,6 @@ type AppConfig struct {// from the JSON when false to keep responses identical to the// previous shape for the common managed-cloud case (#3433).WorkspaceCreationDisabled bool `json:"workspace_creation_disabled,omitempty"`- // StarPromptDisabled mirrors DISABLE_STAR_PROMPT so clients skip the- // "Star us on GitHub" prompt. Omitted when false.- StarPromptDisabled bool `json:"star_prompt_disabled,omitempty"`// Public daemon setup config consumed by the web app at runtime so// self-hosted instances can show `multica setup self-host` commands// with the operator's own domains instead of Multica Cloud defaults.@@ -139,7 +136,6 @@ func (h *Handler) GetConfig(w http.ResponseWriter, r *http.Request) {config.DaemonServerURL, config.DaemonAppURL = daemonSetupURLsFromEnv()config.DaemonSetupTarget = "self_host"config.VCSIntegrationAvailable = h.cfg.VCSIntegrationEnabled- config.StarPromptDisabled = h.cfg.DisableStarPromptconfig.FeatureFlags = featureflags.EvaluateFrontendPublicFlags(r.Context(), h.FeatureFlags)// Only surface the build version on self-hosted deployments. The managed// cloud is continuously deployed and its users can't choose the build, sodiff --git a/server/internal/handler/handler.go b/server/internal/handler/handler.goindex 39c8350fac..d054a185dc 100644--- a/server/internal/handler/handler.go+++ b/server/internal/handler/handler.go@@ -77,10 +77,6 @@ type Config struct {// invitation only. The public /api/config endpoint mirrors this flag so// the UI can hide every "Create workspace" affordance — see #3433.DisableWorkspaceCreation bool- // DisableStarPrompt turns off the "Star us on GitHub" prompt for every- // user of the deployment: /api/config tells clients not to show it, and- // claiming a showing is refused. The Help menu link is unaffected.- DisableStarPrompt bool// WorkspaceCreationAllowedEmails, when non-empty, restricts// POST /api/workspaces to callers whose account email matches one of// the entries (case-insensitive). Empty means every signed-in user maydiff --git a/server/internal/handler/star_prompt.go b/server/internal/handler/star_prompt.goindex 7174d6a28c..1998232d4f 100644--- a/server/internal/handler/star_prompt.go+++ b/server/internal/handler/star_prompt.go@@ -27,10 +27,6 @@ func (h *Handler) ClaimStarPromptShowing(w http.ResponseWriter, r *http.Request)if !ok {return}- if h.cfg.DisableStarPrompt {- writeError(w, http.StatusConflict, "star prompt is disabled")- return- }now := time.Now()user, err := h.Queries.ClaimStarPromptShowing(r.Context(), db.ClaimStarPromptShowingParams{ID: parseUUID(userID),diff --git a/server/internal/handler/star_prompt_test.go b/server/internal/handler/star_prompt_test.goindex f887b9c35d..0c504f949a 100644--- a/server/internal/handler/star_prompt_test.go+++ b/server/internal/handler/star_prompt_test.go@@ -133,31 +133,6 @@ func TestStarPromptStarredRetiresThePrompt(t *testing.T) {}}-func TestClaimStarPromptShowingHonoursDeploymentSwitch(t *testing.T) {- userID := starPromptUser(t, "[email protected]", 4)- prev := testHandler.cfg.DisableStarPrompt- t.Cleanup(func() { testHandler.cfg.DisableStarPrompt = prev })- testHandler.cfg.DisableStarPrompt = true-- if w := callStarPrompt(t, userID, "claim"); w.Code != http.StatusConflict {- t.Fatalf("claim while disabled: expected 409, got %d", w.Code)- }- if n := storedStarPromptShownCount(t, userID); n != 0 {- t.Fatalf("refused claim must not write, got count %d", n)- }-- req := httptest.NewRequest("GET", "/api/config", nil)- rec := httptest.NewRecorder()- testHandler.GetConfig(rec, req)- var cfg AppConfig- if err := json.Unmarshal(rec.Body.Bytes(), &cfg); err != nil {- t.Fatalf("decode config: %v", err)- }- if !cfg.StarPromptDisabled {- t.Fatal("config should report the star prompt as disabled")- }-}-func TestGetMeAlwaysSerializesStarPromptCount(t *testing.T) {userID := newWaitlistTestUser(t, "[email protected]")