From e8d3fcda8e9cf852cdf8bb7772565b1b435f1848 Mon Sep 17 00:00:00 2001 From: avallete Date: Mon, 16 Nov 2026 19:10:47 +0100 Subject: [PATCH 1/4] feat(cli): nudge legacy start and init users toward the new local stack `supabase start` on the legacy backend and `supabase init` without the stack opt-in now emit an info log pointing to the experimental local stack and its docs. Coding agents get an extra line asking them to offer the switch to the user before changing config. The start nudge shows at most once every 7 days, tracked in $SUPABASE_HOME/stack-nudge.json. Co-Authored-By: Claude Opus 5.5 --- apps/cli/src/command-internal/stack-nudge.ts | 100 ++++++++++++++++++ apps/cli/src/commands/init/SIDE_EFFECTS.md | 6 ++ apps/cli/src/commands/init/init.handler.ts | 2 + .../commands/init/init.integration.test.ts | 63 ++++++++++- apps/cli/src/commands/start/SIDE_EFFECTS.md | 6 ++ apps/cli/src/commands/start/start.handler.ts | 2 + .../commands/start/start.integration.test.ts | 89 +++++++++++++++- 7 files changed, 265 insertions(+), 3 deletions(-) create mode 100644 apps/cli/src/command-internal/stack-nudge.ts diff --git a/apps/cli/src/command-internal/stack-nudge.ts b/apps/cli/src/command-internal/stack-nudge.ts new file mode 100644 index 0000000000..36e72731a4 --- /dev/null +++ b/apps/cli/src/command-internal/stack-nudge.ts @@ -0,0 +1,100 @@ +import { Clock, Effect, FileSystem, Option, Path, Schema } from "effect"; + +import { CommandSettings } from "../config/command-settings.service.ts"; +import { Output } from "../shared/output/output.service.ts"; +import { AiTool } from "../shared/telemetry/ai-tool.service.ts"; +import { resolveAgentMode } from "./agent-mode.ts"; +import { AgentFlag } from "./global-flags.ts"; + +const DOCS_URL = + "https://supabase.com/docs/guides/local-development/running-multiple-local-projects"; + +export const START_STACK_NUDGE_MESSAGE = `Try the new local stack: faster, lighter, and one project per worktree in parallel. +To switch: remove the fixed ports from supabase/config.toml, then add \`stack = true\` under \`[experimental]\`. +Steps and limitations: ${DOCS_URL}`; + +export const INIT_STACK_NUDGE_MESSAGE = `Try the new faster, lighter, parallel local stack: SUPABASE_EXPERIMENTAL_STACK=1 supabase init +Learn more: ${DOCS_URL}`; + +export const INIT_STACK_ENABLED_MESSAGE = + "Experimental local stack enabled in supabase/config.toml. Share feedback: https://github.com/supabase/cli/issues"; + +const NUDGE_STATE_FILE = "stack-nudge.json"; +const NUDGE_INTERVAL_MILLIS = 7 * 24 * 60 * 60 * 1000; + +const NudgeState = Schema.fromJsonString(Schema.Struct({ lastShownAt: Schema.Finite })); + +const START_AGENT_ASK_LINE = + "Coding agents: offer this switch to the user and ask before changing supabase/config.toml."; +const INIT_AGENT_ASK_LINE = + "Coding agents: offer this to the user and ask before re-running init with the new stack."; + +/** + * Who to nudge: a coding agent, a human at a terminal, or nobody. The nudge goes through + * `output.info`, so every output format renders it on its own log channel and result payloads + * stay unchanged. + */ +export const nudgeAudience = Effect.gen(function* () { + const output = yield* Output; + const agentFlag = Option.getOrElse(yield* Effect.serviceOption(AgentFlag), () => "auto" as const); + const tool = yield* Effect.serviceOption(AiTool); + if ( + resolveAgentMode( + agentFlag, + Option.flatMap(tool, (detected) => detected.name), + ) + ) { + return "agent" as const; + } + return output.interactive ? ("human" as const) : undefined; +}); + +/** + * Prints the stack nudge on stderr at most once every 7 days. The throttle state is best-effort: + * any read or write failure is swallowed so it can never fail `start`. + */ +export const maybeShowStartStackNudge = Effect.fn("StackNudge.maybeShowStart")(function* () { + const audience = yield* nudgeAudience; + if (audience === undefined) return; + const output = yield* Output; + const fs = yield* FileSystem.FileSystem; + const path = yield* Path.Path; + const settings = yield* CommandSettings; + const statePath = path.join(settings.supabaseHome, NUDGE_STATE_FILE); + const now = yield* Clock.currentTimeMillis; + + const lastShownAt = yield* fs.readFileString(statePath).pipe( + Effect.flatMap(Schema.decodeUnknownEffect(NudgeState)), + Effect.map((state) => state.lastShownAt), + Effect.orElseSucceed(() => undefined), + ); + const throttled = lastShownAt !== undefined && now - lastShownAt < NUDGE_INTERVAL_MILLIS; + yield* Effect.annotateCurrentSpan({ "stack_nudge.throttled": throttled }); + if (throttled) return; + + yield* output.info( + audience === "agent" + ? `${START_STACK_NUDGE_MESSAGE}\n${START_AGENT_ASK_LINE}` + : START_STACK_NUDGE_MESSAGE, + ); + yield* Effect.gen(function* () { + const encoded = yield* Schema.encodeEffect(NudgeState)({ lastShownAt: now }); + yield* fs.makeDirectory(settings.supabaseHome, { recursive: true, mode: 0o700 }); + yield* fs.writeFileString(statePath, encoded); + }).pipe(Effect.ignore); +}); + +/** Prints the `init` nudge or confirmation on stderr to a human at a terminal or an agent. */ +export const showInitStackNote = Effect.fn("StackNudge.showInit")(function* ( + experimentalStack: boolean, +) { + const audience = yield* nudgeAudience; + if (audience === undefined) return; + const output = yield* Output; + if (experimentalStack) return yield* output.info(INIT_STACK_ENABLED_MESSAGE); + yield* output.info( + audience === "agent" + ? `${INIT_STACK_NUDGE_MESSAGE}\n${INIT_AGENT_ASK_LINE}` + : INIT_STACK_NUDGE_MESSAGE, + ); +}); diff --git a/apps/cli/src/commands/init/SIDE_EFFECTS.md b/apps/cli/src/commands/init/SIDE_EFFECTS.md index 75bcfabce5..0cfcce0aa6 100644 --- a/apps/cli/src/commands/init/SIDE_EFFECTS.md +++ b/apps/cli/src/commands/init/SIDE_EFFECTS.md @@ -61,6 +61,12 @@ In interactive mode (`-i`/`--interactive`), may prompt for IDE settings preferen Success is emitted as raw text even when the CLI is invoked with non-text output modes. +After success, in every output format, when stdout is interactive or a coding agent is driving the +run, one info log is emitted (no throttle; text and json print it on stderr, stream-json emits a +`log` event on stdout): without the stack opt-in, +`Try the new faster, lighter, parallel local stack: SUPABASE_EXPERIMENTAL_STACK=1 supabase init` plus a +docs link (agents also get a line asking them to offer it to the user before re-running init); with it, `Experimental local stack enabled in supabase/config.toml. Share feedback: `. + When `supabase/config.json`, `supabase/config.jsonc` or `supabase/config.toml` already exists and `--force` is not set (stderr; the first of those files in that order is named, and the platform check selects the exact per-OS path separator and errno text; `config.toml` is shown): On Linux/macOS: diff --git a/apps/cli/src/commands/init/init.handler.ts b/apps/cli/src/commands/init/init.handler.ts index b7e7079ebd..374f6c6f5c 100644 --- a/apps/cli/src/commands/init/init.handler.ts +++ b/apps/cli/src/commands/init/init.handler.ts @@ -4,6 +4,7 @@ import { initProject } from "../../shared/init/project-init.ts"; import { Output } from "../../shared/output/output.service.ts"; import { resolveExperimentalFeature } from "../../shared/config/experimental-feature.ts"; import { WorkdirFlag, resolveYes } from "../../command-internal/global-flags.ts"; +import { showInitStackNote } from "../../command-internal/stack-nudge.ts"; import { InitConfigExistsError } from "./init.errors.ts"; import type { InitFlags } from "./init.command.ts"; @@ -53,4 +54,5 @@ export const init = Effect.fn("init")(function* (flags: InitFlags) { } yield* output.raw("Finished supabase init.\n"); + yield* showInitStackNote(experimentalStack); }); diff --git a/apps/cli/src/commands/init/init.integration.test.ts b/apps/cli/src/commands/init/init.integration.test.ts index 648b3ba677..3faeb275fc 100644 --- a/apps/cli/src/commands/init/init.integration.test.ts +++ b/apps/cli/src/commands/init/init.integration.test.ts @@ -17,7 +17,12 @@ import { Stdio, } from "effect"; import { CliArgs } from "../../shared/cli/cli-args.service.ts"; -import { ExperimentalFlag, WorkdirFlag, YesFlag } from "../../command-internal/global-flags.ts"; +import { + AgentFlag, + ExperimentalFlag, + WorkdirFlag, + YesFlag, +} from "../../command-internal/global-flags.ts"; import { normalizeCause } from "../../shared/output/normalize-error.ts"; import { textOutputLayer } from "../../shared/output/output.layer.ts"; import { Output } from "../../shared/output/output.service.ts"; @@ -528,6 +533,62 @@ describe("init", () => { }); }); + it.effect.each([ + { env: {}, interactive: true, expected: "SUPABASE_EXPERIMENTAL_STACK=1 supabase init" }, + { + env: { SUPABASE_EXPERIMENTAL_STACK: "1" }, + interactive: true, + expected: "Experimental local stack enabled in supabase/config.toml", + }, + { env: {}, interactive: false, expected: undefined }, + { + env: {}, + interactive: false, + agent: true, + expected: "Coding agents: offer this to the user and ask before re-running init", + }, + ])( + "stack note (interactive=$interactive, agent=$agent, env=$env)", + ({ env, interactive, agent, expected }) => { + const tempDir = tempRoot.current; + + return Effect.gen(function* () { + const { layer, out } = setup(tempDir, { env, interactive }); + + yield* init({ + interactive: false, + useOrioledb: false, + force: false, + withVscodeWorkspace: false, + withVscodeSettings: false, + withIntellijSettings: false, + }).pipe( + Effect.provide( + agent === true + ? Layer.mergeAll(layer, Layer.succeed(AgentFlag, "yes" as const)) + : layer, + ), + ); + + if (expected === undefined) { + expect( + out.messages + .filter((m) => m.type === "info") + .map((m) => m.message) + .join("\n"), + ).not.toContain("local stack"); + } else { + expect( + out.messages + .filter((m) => m.type === "info") + .map((m) => m.message) + .join("\n"), + ).toContain(expected); + } + }); + }, + ); + it.effect("keeps the established template when SUPABASE_EXPERIMENTAL_STACK=0", () => { const tempDir = tempRoot.current; diff --git a/apps/cli/src/commands/start/SIDE_EFFECTS.md b/apps/cli/src/commands/start/SIDE_EFFECTS.md index 93df2b8067..ca716feca2 100644 --- a/apps/cli/src/commands/start/SIDE_EFFECTS.md +++ b/apps/cli/src/commands/start/SIDE_EFFECTS.md @@ -212,6 +212,7 @@ command. | Path | Format | When | | -------------------------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `$SUPABASE_HOME/stack-nudge.json` | JSON | after the stack nudge is shown: `{"lastShownAt": }`; read and written best-effort, failures are swallowed | | `/supabase/.branches/_current_branch` | text | on every start, only if absent — writes `"main"` | | `/supabase/snippets/` | — | when Studio is enabled, only if absent — created before any container and kept on rollback; `podman create -v`, unlike Docker, rejects a missing bind source | | `/supabase/.temp/start-secrets//env/` | dotenv | Edge Runtime's own JWT/service-role-key/secret env artifacts — see below | @@ -410,6 +411,11 @@ buckets to prune.` for a bucket left in place. These seeding lines use the raw w - stdout: the `status` pretty table (rounded box, same renderer `supabase status` uses). - stderr: the local-dev security notice block (bind-to-`0.0.0.0` / shared-default-keys / no-auth-on-Studio-pgMeta-analytics warning). +- info log (conditional, fresh start only, never on the already-running path; text and json print it + on stderr, stream-json emits a `log` event with level `info` on stdout): a three-line nudge to + try the experimental local stack (`Try the new local stack: ...`, the switch steps, and the docs URL; agents also get a line asking them to offer the switch to the user). Shown only + in every output format when stdout is interactive or a coding agent is detected, and at most once + per 7 days (see "Files Written"). Never fails `start`. ### `--output-format json` / `--output-format stream-json` diff --git a/apps/cli/src/commands/start/start.handler.ts b/apps/cli/src/commands/start/start.handler.ts index 67e16ab81f..6c2c4f660a 100644 --- a/apps/cli/src/commands/start/start.handler.ts +++ b/apps/cli/src/commands/start/start.handler.ts @@ -109,6 +109,7 @@ import { StatusListError, } from "../../command-internal/status-errors.ts"; import { renderStatusPretty } from "../../command-internal/status-pretty.ts"; +import { maybeShowStartStackNudge } from "../../command-internal/stack-nudge.ts"; import { gateStatusState, resolveStatusLocalState, @@ -1665,5 +1666,6 @@ export const start = Effect.fn("start")(function* (flags: StartFlags) { const { values: statusValues } = yield* buildStatusValues(statusExcluded, values); yield* output.success("", statusValues); } + yield* maybeShowStartStackNudge(); }).pipe(Effect.scoped, Effect.ensuring(telemetryState.flush)); }); diff --git a/apps/cli/src/commands/start/start.integration.test.ts b/apps/cli/src/commands/start/start.integration.test.ts index 6b882ee0bb..0cc2158764 100644 --- a/apps/cli/src/commands/start/start.integration.test.ts +++ b/apps/cli/src/commands/start/start.integration.test.ts @@ -58,6 +58,7 @@ import { classifyCliErrorActionability, } from "../../shared/telemetry/error-actionability.ts"; import { + AgentFlag, DebugFlag, ExperimentalFlag, NetworkIdFlag, @@ -643,6 +644,8 @@ interface SetupOpts { readonly networkId?: Option.Option; /** `--experimental`/`SUPABASE_EXPERIMENTAL`. Defaults to `false`. */ readonly experimental?: boolean; + /** Stdout is a terminal. Defaults to `false`. */ + readonly interactive?: boolean; /** Replaces the `DbConnection.connect` behind the Postgres readiness probe. Defaults to succeeding. */ readonly dbConnect?: (typeof DbConnection)["Service"]["connect"]; } @@ -655,10 +658,14 @@ const setup = Effect.fnUntraced(function* (opts: SetupOpts = {}) { opts.configContents ?? `project_id = "${opts.configuredProjectId ?? "demo"}"\n`, ); } - const out = mockOutput({ format: opts.format ?? "text" }); + const out = mockOutput({ format: opts.format ?? "text", interactive: opts.interactive }); const telemetry = mockTelemetryStateTracked(); const analytics = mockAnalytics(); - const cliSettings = mockCommandSettings({ workdir }); + const hostPath = yield* Path.Path; + const cliSettings = mockCommandSettings({ + workdir, + supabaseHome: hostPath.join(workdir, ".supabase-home"), + }); const child = mockStartContainerCliSpawner(opts.route ?? defaultRoute(), { failSpawn: opts.failSpawn, onSecretCopy: opts.onSecretCopy, @@ -1960,6 +1967,84 @@ describe("start integration", () => { }).pipe(Effect.provide([BunServices.layer, BunCrypto.layer])), ); + describe("stack nudge", () => { + const NUDGE = "Try the new local stack"; + + it.effect("shows the nudge once per 7 days on an interactive terminal", () => + Effect.gen(function* () { + const first = yield* setup({ interactive: true }); + yield* start(flags()).pipe(Effect.provide(first.layer)); + expect( + first.out.messages + .filter((m) => m.type === "info") + .map((m) => m.message) + .join("\n"), + ).toContain(NUDGE); + + const second = yield* setup({ interactive: true }); + yield* start(flags()).pipe(Effect.provide(second.layer)); + expect( + second.out.messages + .filter((m) => m.type === "info") + .map((m) => m.message) + .join("\n"), + ).not.toContain(NUDGE); + }).pipe(Effect.provide([BunServices.layer, BunCrypto.layer])), + ); + + it.effect("stays silent when stdout is not a terminal", () => + Effect.gen(function* () { + const { layer, out } = yield* setup({ interactive: false }); + yield* start(flags()).pipe(Effect.provide(layer)); + expect( + out.messages + .filter((m) => m.type === "info") + .map((m) => m.message) + .join("\n"), + ).not.toContain(NUDGE); + }).pipe(Effect.provide([BunServices.layer, BunCrypto.layer])), + ); + + it.effect("shows the nudge to an agent without a terminal", () => + Effect.gen(function* () { + const { layer, out } = yield* setup({ interactive: false }); + yield* start(flags()).pipe( + Effect.provide(Layer.mergeAll(layer, Layer.succeed(AgentFlag, "yes" as const))), + ); + expect( + out.messages + .filter((m) => m.type === "info") + .map((m) => m.message) + .join("\n"), + ).toContain(NUDGE); + }).pipe(Effect.provide([BunServices.layer, BunCrypto.layer])), + ); + + it.effect("shows the nudge on stderr in json mode for an agent", () => + Effect.gen(function* () { + const { layer, out } = yield* setup({ format: "json", interactive: false }); + yield* start(flags()).pipe( + Effect.provide(Layer.mergeAll(layer, Layer.succeed(AgentFlag, "yes" as const))), + ); + expect( + out.messages + .filter((m) => m.type === "info") + .map((m) => m.message) + .join("\n"), + ).toContain(NUDGE); + expect( + out.messages + .filter((m) => m.type === "info") + .map((m) => m.message) + .join("\n"), + ).toContain("Coding agents: offer this switch to the user"); + expect(out.messages.find((m) => m.type === "success")?.data).toMatchObject({ + DB_URL: expect.any(String), + }); + }).pipe(Effect.provide([BunServices.layer, BunCrypto.layer])), + ); + }); + it.effect("emits a machine status payload in json mode instead of the pretty table", () => Effect.gen(function* () { const { layer, out } = yield* setup({ format: "json" }); From 393367cb4a170fa4536541633e7937702d7d8e26 Mon Sep 17 00:00:00 2001 From: avallete Date: Tue, 17 Nov 2026 11:53:41 +0100 Subject: [PATCH 2/4] fix(cli): address review findings on the stack nudge - init nudge suggests `init --force`, since plain init fails on the config it just created - text mode writes the nudge to stderr; json/stream-json keep output.info, and start emits it before the result event - a future throttle timestamp counts as stale - share agentDetected between hosted consent and the nudge - drop unused exports (knip), tighten docs and tests Co-Authored-By: Claude Opus 5.5 --- apps/cli/src/command-internal/agent-mode.ts | 15 ++- .../hosted-consent/hosted-consent.prompt.ts | 14 +-- apps/cli/src/command-internal/stack-nudge.ts | 51 +++++----- apps/cli/src/commands/init/SIDE_EFFECTS.md | 12 ++- .../commands/init/init.integration.test.ts | 18 +--- apps/cli/src/commands/start/SIDE_EFFECTS.md | 12 ++- apps/cli/src/commands/start/start.handler.ts | 3 +- .../commands/start/start.integration.test.ts | 93 ++++++------------- 8 files changed, 89 insertions(+), 129 deletions(-) diff --git a/apps/cli/src/command-internal/agent-mode.ts b/apps/cli/src/command-internal/agent-mode.ts index 7327c46a82..2e75952819 100644 --- a/apps/cli/src/command-internal/agent-mode.ts +++ b/apps/cli/src/command-internal/agent-mode.ts @@ -1,4 +1,7 @@ -import { Option } from "effect"; +import { Effect, Option } from "effect"; + +import { AiTool } from "../shared/telemetry/ai-tool.service.ts"; +import { AgentFlag } from "./global-flags.ts"; /** Agent-mode resolution: `yes`→true, `no`→false, `auto`→agent detected. */ export function resolveAgentMode( @@ -9,3 +12,13 @@ export function resolveAgentMode( if (agentFlag === "no") return false; return Option.isSome(aiToolName); } + +/** Whether `--agent` or a detected AI tool marks this run as driven by a coding agent. */ +export const agentDetected = Effect.gen(function* () { + const flag = Option.getOrElse(yield* Effect.serviceOption(AgentFlag), () => "auto" as const); + const tool = yield* Effect.serviceOption(AiTool); + return resolveAgentMode( + flag, + Option.flatMap(tool, (detected) => detected.name), + ); +}); diff --git a/apps/cli/src/command-internal/hosted-consent/hosted-consent.prompt.ts b/apps/cli/src/command-internal/hosted-consent/hosted-consent.prompt.ts index 91cbaf3097..9c389cdabc 100644 --- a/apps/cli/src/command-internal/hosted-consent/hosted-consent.prompt.ts +++ b/apps/cli/src/command-internal/hosted-consent/hosted-consent.prompt.ts @@ -2,25 +2,15 @@ import { Effect, Option } from "effect"; import { Output } from "../../shared/output/output.service.ts"; import { isMachineResourceFormat } from "../../shared/output/resource-format.ts"; -import { AiTool } from "../../shared/telemetry/ai-tool.service.ts"; import { Tty } from "../../shared/runtime/tty.service.ts"; -import { resolveAgentMode } from "../agent-mode.ts"; -import { AgentFlag, OutputFlag } from "../global-flags.ts"; +import { agentDetected } from "../agent-mode.ts"; +import { OutputFlag } from "../global-flags.ts"; export interface PromptBlocker { readonly reason: string; readonly agent: boolean; } -const agentDetected = Effect.gen(function* () { - const flag = Option.getOrElse(yield* Effect.serviceOption(AgentFlag), () => "auto" as const); - const tool = yield* Effect.serviceOption(AiTool); - return resolveAgentMode( - flag, - Option.flatMap(tool, (detected) => detected.name), - ); -}); - /** * Why this run cannot ask a question, or `None` when it can: text output on an interactive * stdout with a TTY stdin, no machine `-o` format, and no agent driving it. diff --git a/apps/cli/src/command-internal/stack-nudge.ts b/apps/cli/src/command-internal/stack-nudge.ts index 36e72731a4..946f5d2ae6 100644 --- a/apps/cli/src/command-internal/stack-nudge.ts +++ b/apps/cli/src/command-internal/stack-nudge.ts @@ -1,22 +1,20 @@ -import { Clock, Effect, FileSystem, Option, Path, Schema } from "effect"; +import { Clock, Effect, FileSystem, Path, Schema } from "effect"; import { CommandSettings } from "../config/command-settings.service.ts"; import { Output } from "../shared/output/output.service.ts"; -import { AiTool } from "../shared/telemetry/ai-tool.service.ts"; -import { resolveAgentMode } from "./agent-mode.ts"; -import { AgentFlag } from "./global-flags.ts"; +import { agentDetected } from "./agent-mode.ts"; const DOCS_URL = "https://supabase.com/docs/guides/local-development/running-multiple-local-projects"; -export const START_STACK_NUDGE_MESSAGE = `Try the new local stack: faster, lighter, and one project per worktree in parallel. +const START_STACK_NUDGE_MESSAGE = `Try the new local stack: faster, lighter, and one project per worktree in parallel. To switch: remove the fixed ports from supabase/config.toml, then add \`stack = true\` under \`[experimental]\`. Steps and limitations: ${DOCS_URL}`; -export const INIT_STACK_NUDGE_MESSAGE = `Try the new faster, lighter, parallel local stack: SUPABASE_EXPERIMENTAL_STACK=1 supabase init +const INIT_STACK_NUDGE_MESSAGE = `Try the new faster, lighter, parallel local stack: SUPABASE_EXPERIMENTAL_STACK=1 supabase init --force (regenerates this config) Learn more: ${DOCS_URL}`; -export const INIT_STACK_ENABLED_MESSAGE = +const INIT_STACK_ENABLED_MESSAGE = "Experimental local stack enabled in supabase/config.toml. Share feedback: https://github.com/supabase/cli/issues"; const NUDGE_STATE_FILE = "stack-nudge.json"; @@ -27,28 +25,24 @@ const NudgeState = Schema.fromJsonString(Schema.Struct({ lastShownAt: Schema.Fin const START_AGENT_ASK_LINE = "Coding agents: offer this switch to the user and ask before changing supabase/config.toml."; const INIT_AGENT_ASK_LINE = - "Coding agents: offer this to the user and ask before re-running init with the new stack."; + "Coding agents: offer this to the user and ask before re-running init with --force."; /** - * Who to nudge: a coding agent, a human at a terminal, or nobody. The nudge goes through - * `output.info`, so every output format renders it on its own log channel and result payloads - * stay unchanged. + * Who to nudge: a coding agent, a human at a terminal, or nobody. Text mode writes to stderr so + * piped stdout stays clean; json and stream-json use `output.info` so result payloads are unchanged. */ -export const nudgeAudience = Effect.gen(function* () { +const nudgeAudience = Effect.gen(function* () { const output = yield* Output; - const agentFlag = Option.getOrElse(yield* Effect.serviceOption(AgentFlag), () => "auto" as const); - const tool = yield* Effect.serviceOption(AiTool); - if ( - resolveAgentMode( - agentFlag, - Option.flatMap(tool, (detected) => detected.name), - ) - ) { - return "agent" as const; - } + if (yield* agentDetected) return "agent" as const; return output.interactive ? ("human" as const) : undefined; }); +const emitNudge = Effect.fnUntraced(function* (message: string) { + const output = yield* Output; + if (output.format === "text") return yield* output.raw(`${message}\n`, "stderr"); + return yield* output.info(message); +}); + /** * Prints the stack nudge on stderr at most once every 7 days. The throttle state is best-effort: * any read or write failure is swallowed so it can never fail `start`. @@ -56,7 +50,6 @@ export const nudgeAudience = Effect.gen(function* () { export const maybeShowStartStackNudge = Effect.fn("StackNudge.maybeShowStart")(function* () { const audience = yield* nudgeAudience; if (audience === undefined) return; - const output = yield* Output; const fs = yield* FileSystem.FileSystem; const path = yield* Path.Path; const settings = yield* CommandSettings; @@ -68,11 +61,14 @@ export const maybeShowStartStackNudge = Effect.fn("StackNudge.maybeShowStart")(f Effect.map((state) => state.lastShownAt), Effect.orElseSucceed(() => undefined), ); - const throttled = lastShownAt !== undefined && now - lastShownAt < NUDGE_INTERVAL_MILLIS; + const throttled = + lastShownAt !== undefined && + now - lastShownAt >= 0 && + now - lastShownAt < NUDGE_INTERVAL_MILLIS; yield* Effect.annotateCurrentSpan({ "stack_nudge.throttled": throttled }); if (throttled) return; - yield* output.info( + yield* emitNudge( audience === "agent" ? `${START_STACK_NUDGE_MESSAGE}\n${START_AGENT_ASK_LINE}` : START_STACK_NUDGE_MESSAGE, @@ -90,9 +86,8 @@ export const showInitStackNote = Effect.fn("StackNudge.showInit")(function* ( ) { const audience = yield* nudgeAudience; if (audience === undefined) return; - const output = yield* Output; - if (experimentalStack) return yield* output.info(INIT_STACK_ENABLED_MESSAGE); - yield* output.info( + if (experimentalStack) return yield* emitNudge(INIT_STACK_ENABLED_MESSAGE); + yield* emitNudge( audience === "agent" ? `${INIT_STACK_NUDGE_MESSAGE}\n${INIT_AGENT_ASK_LINE}` : INIT_STACK_NUDGE_MESSAGE, diff --git a/apps/cli/src/commands/init/SIDE_EFFECTS.md b/apps/cli/src/commands/init/SIDE_EFFECTS.md index 0cfcce0aa6..5a9192b4b8 100644 --- a/apps/cli/src/commands/init/SIDE_EFFECTS.md +++ b/apps/cli/src/commands/init/SIDE_EFFECTS.md @@ -61,11 +61,13 @@ In interactive mode (`-i`/`--interactive`), may prompt for IDE settings preferen Success is emitted as raw text even when the CLI is invoked with non-text output modes. -After success, in every output format, when stdout is interactive or a coding agent is driving the -run, one info log is emitted (no throttle; text and json print it on stderr, stream-json emits a -`log` event on stdout): without the stack opt-in, -`Try the new faster, lighter, parallel local stack: SUPABASE_EXPERIMENTAL_STACK=1 supabase init` plus a -docs link (agents also get a line asking them to offer it to the user before re-running init); with it, `Experimental local stack enabled in supabase/config.toml. Share feedback: `. +After success, one nudge or confirmation is emitted (no throttle). It is shown in text mode (on +stderr) when stdout is a TTY, and in any output format when a coding agent is detected or +`--agent yes` is set; json prints it on stderr and stream-json emits a `log` event. Without the +stack opt-in the message is +`Try the new faster, lighter, parallel local stack: SUPABASE_EXPERIMENTAL_STACK=1 supabase init --force (regenerates this config)` +plus a docs link; agents also get a line asking them to ask the user before re-running init with +`--force`. With the opt-in it is `Experimental local stack enabled in supabase/config.toml. Share feedback: `. When `supabase/config.json`, `supabase/config.jsonc` or `supabase/config.toml` already exists and `--force` is not set (stderr; the first of those files in that order is named, and the platform check selects the exact per-OS path separator and errno text; `config.toml` is shown): diff --git a/apps/cli/src/commands/init/init.integration.test.ts b/apps/cli/src/commands/init/init.integration.test.ts index 3faeb275fc..c86885aaae 100644 --- a/apps/cli/src/commands/init/init.integration.test.ts +++ b/apps/cli/src/commands/init/init.integration.test.ts @@ -534,7 +534,7 @@ describe("init", () => { }); it.effect.each([ - { env: {}, interactive: true, expected: "SUPABASE_EXPERIMENTAL_STACK=1 supabase init" }, + { env: {}, interactive: true, expected: "SUPABASE_EXPERIMENTAL_STACK=1 supabase init --force" }, { env: { SUPABASE_EXPERIMENTAL_STACK: "1" }, interactive: true, @@ -545,7 +545,7 @@ describe("init", () => { env: {}, interactive: false, agent: true, - expected: "Coding agents: offer this to the user and ask before re-running init", + expected: "Coding agents: offer this to the user and ask before re-running init with --force", }, ])( "stack note (interactive=$interactive, agent=$agent, env=$env)", @@ -571,19 +571,9 @@ describe("init", () => { ); if (expected === undefined) { - expect( - out.messages - .filter((m) => m.type === "info") - .map((m) => m.message) - .join("\n"), - ).not.toContain("local stack"); + expect(out.stderrText).not.toContain("local stack"); } else { - expect( - out.messages - .filter((m) => m.type === "info") - .map((m) => m.message) - .join("\n"), - ).toContain(expected); + expect(out.stderrText).toContain(expected); } }); }, diff --git a/apps/cli/src/commands/start/SIDE_EFFECTS.md b/apps/cli/src/commands/start/SIDE_EFFECTS.md index ca716feca2..6e1fc1491e 100644 --- a/apps/cli/src/commands/start/SIDE_EFFECTS.md +++ b/apps/cli/src/commands/start/SIDE_EFFECTS.md @@ -411,11 +411,13 @@ buckets to prune.` for a bucket left in place. These seeding lines use the raw w - stdout: the `status` pretty table (rounded box, same renderer `supabase status` uses). - stderr: the local-dev security notice block (bind-to-`0.0.0.0` / shared-default-keys / no-auth-on-Studio-pgMeta-analytics warning). -- info log (conditional, fresh start only, never on the already-running path; text and json print it - on stderr, stream-json emits a `log` event with level `info` on stdout): a three-line nudge to - try the experimental local stack (`Try the new local stack: ...`, the switch steps, and the docs URL; agents also get a line asking them to offer the switch to the user). Shown only - in every output format when stdout is interactive or a coding agent is detected, and at most once - per 7 days (see "Files Written"). Never fails `start`. +- stack nudge (conditional, fresh start only, never on the already-running path): a three-line + suggestion to try the experimental local stack (`Try the new local stack: ...`, the switch steps, + and the docs URL; agents also get a line asking them to offer the switch to the user). Shown in + text mode (on stderr, after the security notice) when stdout is a TTY, and in any output format + when a coding agent is detected or `--agent yes` is set; json prints it on stderr and stream-json + emits a `log` event before the `result` event. At most once per 7 days (see "Files Written"). + Never fails `start`. ### `--output-format json` / `--output-format stream-json` diff --git a/apps/cli/src/commands/start/start.handler.ts b/apps/cli/src/commands/start/start.handler.ts index 6c2c4f660a..a4961a38b6 100644 --- a/apps/cli/src/commands/start/start.handler.ts +++ b/apps/cli/src/commands/start/start.handler.ts @@ -1662,10 +1662,11 @@ export const start = Effect.fn("start")(function* (flags: StartFlags) { const { values: statusValues, names } = yield* buildStatusValues(statusExcluded, values); yield* output.raw(renderStatusPretty(statusValues, names)); yield* output.raw(startSecurityNotice(), "stderr"); + yield* maybeShowStartStackNudge(); } else { const { values: statusValues } = yield* buildStatusValues(statusExcluded, values); + yield* maybeShowStartStackNudge(); yield* output.success("", statusValues); } - yield* maybeShowStartStackNudge(); }).pipe(Effect.scoped, Effect.ensuring(telemetryState.flush)); }); diff --git a/apps/cli/src/commands/start/start.integration.test.ts b/apps/cli/src/commands/start/start.integration.test.ts index 0cc2158764..97d2f1c683 100644 --- a/apps/cli/src/commands/start/start.integration.test.ts +++ b/apps/cli/src/commands/start/start.integration.test.ts @@ -661,11 +661,7 @@ const setup = Effect.fnUntraced(function* (opts: SetupOpts = {}) { const out = mockOutput({ format: opts.format ?? "text", interactive: opts.interactive }); const telemetry = mockTelemetryStateTracked(); const analytics = mockAnalytics(); - const hostPath = yield* Path.Path; - const cliSettings = mockCommandSettings({ - workdir, - supabaseHome: hostPath.join(workdir, ".supabase-home"), - }); + const cliSettings = mockCommandSettings({ workdir }); const child = mockStartContainerCliSpawner(opts.route ?? defaultRoute(), { failSpawn: opts.failSpawn, onSecretCopy: opts.onSecretCopy, @@ -1969,26 +1965,21 @@ describe("start integration", () => { describe("stack nudge", () => { const NUDGE = "Try the new local stack"; + const nudgeShown = Effect.fnUntraced(function* () { + const { layer, out } = yield* setup({ interactive: true }); + yield* start(flags()).pipe(Effect.provide(layer)); + return out.stderrText.includes(NUDGE); + }); - it.effect("shows the nudge once per 7 days on an interactive terminal", () => + it.effect("shows the nudge on stderr again only after 7 days", () => Effect.gen(function* () { - const first = yield* setup({ interactive: true }); - yield* start(flags()).pipe(Effect.provide(first.layer)); - expect( - first.out.messages - .filter((m) => m.type === "info") - .map((m) => m.message) - .join("\n"), - ).toContain(NUDGE); + expect(yield* nudgeShown()).toBe(true); - const second = yield* setup({ interactive: true }); - yield* start(flags()).pipe(Effect.provide(second.layer)); - expect( - second.out.messages - .filter((m) => m.type === "info") - .map((m) => m.message) - .join("\n"), - ).not.toContain(NUDGE); + yield* TestClock.adjust(7 * 24 * 60 * 60 * 1000 - 1); + expect(yield* nudgeShown()).toBe(false); + + yield* TestClock.adjust("1 millis"); + expect(yield* nudgeShown()).toBe(true); }).pipe(Effect.provide([BunServices.layer, BunCrypto.layer])), ); @@ -1996,52 +1987,28 @@ describe("start integration", () => { Effect.gen(function* () { const { layer, out } = yield* setup({ interactive: false }); yield* start(flags()).pipe(Effect.provide(layer)); - expect( - out.messages - .filter((m) => m.type === "info") - .map((m) => m.message) - .join("\n"), - ).not.toContain(NUDGE); - }).pipe(Effect.provide([BunServices.layer, BunCrypto.layer])), - ); - - it.effect("shows the nudge to an agent without a terminal", () => - Effect.gen(function* () { - const { layer, out } = yield* setup({ interactive: false }); - yield* start(flags()).pipe( - Effect.provide(Layer.mergeAll(layer, Layer.succeed(AgentFlag, "yes" as const))), - ); - expect( - out.messages - .filter((m) => m.type === "info") - .map((m) => m.message) - .join("\n"), - ).toContain(NUDGE); + expect(out.stderrText).not.toContain(NUDGE); }).pipe(Effect.provide([BunServices.layer, BunCrypto.layer])), ); - it.effect("shows the nudge on stderr in json mode for an agent", () => - Effect.gen(function* () { - const { layer, out } = yield* setup({ format: "json", interactive: false }); - yield* start(flags()).pipe( - Effect.provide(Layer.mergeAll(layer, Layer.succeed(AgentFlag, "yes" as const))), - ); - expect( - out.messages - .filter((m) => m.type === "info") - .map((m) => m.message) - .join("\n"), - ).toContain(NUDGE); - expect( - out.messages + it.effect( + "emits the nudge to an agent in json mode without changing the result payload", + () => + Effect.gen(function* () { + const { layer, out } = yield* setup({ format: "json", interactive: false }); + yield* start(flags()).pipe( + Effect.provide(Layer.mergeAll(layer, Layer.succeed(AgentFlag, "yes" as const))), + ); + const info = out.messages .filter((m) => m.type === "info") .map((m) => m.message) - .join("\n"), - ).toContain("Coding agents: offer this switch to the user"); - expect(out.messages.find((m) => m.type === "success")?.data).toMatchObject({ - DB_URL: expect.any(String), - }); - }).pipe(Effect.provide([BunServices.layer, BunCrypto.layer])), + .join("\n"); + expect(info).toContain(NUDGE); + expect(info).toContain("Coding agents: offer this switch to the user"); + expect(out.messages.find((m) => m.type === "success")?.data).toMatchObject({ + DB_URL: expect.any(String), + }); + }).pipe(Effect.provide([BunServices.layer, BunCrypto.layer])), ); }); From b32fdf0293cf238075b38641802956b1052d28e9 Mon Sep 17 00:00:00 2001 From: avallete Date: Tue, 17 Nov 2026 12:02:10 +0100 Subject: [PATCH 3/4] fix(cli): shell-neutral init nudge, skip nudge on ignored health checks Co-Authored-By: Claude Opus 5.5 --- apps/cli/src/command-internal/stack-nudge.ts | 2 +- apps/cli/src/commands/init/SIDE_EFFECTS.md | 2 +- apps/cli/src/commands/init/init.integration.test.ts | 6 +++++- apps/cli/src/commands/start/SIDE_EFFECTS.md | 3 ++- apps/cli/src/commands/start/start.handler.ts | 4 ++-- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/apps/cli/src/command-internal/stack-nudge.ts b/apps/cli/src/command-internal/stack-nudge.ts index 946f5d2ae6..dd219fd295 100644 --- a/apps/cli/src/command-internal/stack-nudge.ts +++ b/apps/cli/src/command-internal/stack-nudge.ts @@ -11,7 +11,7 @@ const START_STACK_NUDGE_MESSAGE = `Try the new local stack: faster, lighter, and To switch: remove the fixed ports from supabase/config.toml, then add \`stack = true\` under \`[experimental]\`. Steps and limitations: ${DOCS_URL}`; -const INIT_STACK_NUDGE_MESSAGE = `Try the new faster, lighter, parallel local stack: SUPABASE_EXPERIMENTAL_STACK=1 supabase init --force (regenerates this config) +const INIT_STACK_NUDGE_MESSAGE = `Try the new faster, lighter, parallel local stack: set SUPABASE_EXPERIMENTAL_STACK=1 and re-run \`supabase init --force\` (regenerates this config) Learn more: ${DOCS_URL}`; const INIT_STACK_ENABLED_MESSAGE = diff --git a/apps/cli/src/commands/init/SIDE_EFFECTS.md b/apps/cli/src/commands/init/SIDE_EFFECTS.md index 5a9192b4b8..51f8108f9d 100644 --- a/apps/cli/src/commands/init/SIDE_EFFECTS.md +++ b/apps/cli/src/commands/init/SIDE_EFFECTS.md @@ -65,7 +65,7 @@ After success, one nudge or confirmation is emitted (no throttle). It is shown i stderr) when stdout is a TTY, and in any output format when a coding agent is detected or `--agent yes` is set; json prints it on stderr and stream-json emits a `log` event. Without the stack opt-in the message is -`Try the new faster, lighter, parallel local stack: SUPABASE_EXPERIMENTAL_STACK=1 supabase init --force (regenerates this config)` +``Try the new faster, lighter, parallel local stack: set SUPABASE_EXPERIMENTAL_STACK=1 and re-run `supabase init --force` (regenerates this config)`` plus a docs link; agents also get a line asking them to ask the user before re-running init with `--force`. With the opt-in it is `Experimental local stack enabled in supabase/config.toml. Share feedback: `. diff --git a/apps/cli/src/commands/init/init.integration.test.ts b/apps/cli/src/commands/init/init.integration.test.ts index c86885aaae..2746628272 100644 --- a/apps/cli/src/commands/init/init.integration.test.ts +++ b/apps/cli/src/commands/init/init.integration.test.ts @@ -534,7 +534,11 @@ describe("init", () => { }); it.effect.each([ - { env: {}, interactive: true, expected: "SUPABASE_EXPERIMENTAL_STACK=1 supabase init --force" }, + { + env: {}, + interactive: true, + expected: "set SUPABASE_EXPERIMENTAL_STACK=1 and re-run `supabase init --force`", + }, { env: { SUPABASE_EXPERIMENTAL_STACK: "1" }, interactive: true, diff --git a/apps/cli/src/commands/start/SIDE_EFFECTS.md b/apps/cli/src/commands/start/SIDE_EFFECTS.md index 6e1fc1491e..8ebbc5523f 100644 --- a/apps/cli/src/commands/start/SIDE_EFFECTS.md +++ b/apps/cli/src/commands/start/SIDE_EFFECTS.md @@ -411,7 +411,8 @@ buckets to prune.` for a bucket left in place. These seeding lines use the raw w - stdout: the `status` pretty table (rounded box, same renderer `supabase status` uses). - stderr: the local-dev security notice block (bind-to-`0.0.0.0` / shared-default-keys / no-auth-on-Studio-pgMeta-analytics warning). -- stack nudge (conditional, fresh start only, never on the already-running path): a three-line +- stack nudge (conditional, fresh start only, never on the already-running path or with + `--ignore-health-check`): a three-line suggestion to try the experimental local stack (`Try the new local stack: ...`, the switch steps, and the docs URL; agents also get a line asking them to offer the switch to the user). Shown in text mode (on stderr, after the security notice) when stdout is a TTY, and in any output format diff --git a/apps/cli/src/commands/start/start.handler.ts b/apps/cli/src/commands/start/start.handler.ts index a4961a38b6..100c6cd90c 100644 --- a/apps/cli/src/commands/start/start.handler.ts +++ b/apps/cli/src/commands/start/start.handler.ts @@ -1662,10 +1662,10 @@ export const start = Effect.fn("start")(function* (flags: StartFlags) { const { values: statusValues, names } = yield* buildStatusValues(statusExcluded, values); yield* output.raw(renderStatusPretty(statusValues, names)); yield* output.raw(startSecurityNotice(), "stderr"); - yield* maybeShowStartStackNudge(); + if (!flags.ignoreHealthCheck) yield* maybeShowStartStackNudge(); } else { const { values: statusValues } = yield* buildStatusValues(statusExcluded, values); - yield* maybeShowStartStackNudge(); + if (!flags.ignoreHealthCheck) yield* maybeShowStartStackNudge(); yield* output.success("", statusValues); } }).pipe(Effect.scoped, Effect.ensuring(telemetryState.flush)); From 32befc78107eed07f517499374a666bd4c1bfc93 Mon Sep 17 00:00:00 2001 From: avallete Date: Thu, 19 Nov 2026 22:55:15 +0100 Subject: [PATCH 4/4] fix(cli): non-destructive init nudge, respect explicit stack opt-out - init no longer suggests `init --force`; it points to the guide for switching this project and to the env var for the next init - an explicit SUPABASE_EXPERIMENTAL_STACK=0 silences both nudges - document stack-nudge.json in the SUPABASE_HOME guide Co-Authored-By: Claude Opus 5.5 --- apps/cli/docs/supabase-home.md | 8 ++++++++ apps/cli/src/command-internal/stack-nudge.ts | 14 +++++++++++--- .../cli/src/commands/init/init.integration.test.ts | 6 ++++-- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/apps/cli/docs/supabase-home.md b/apps/cli/docs/supabase-home.md index 57e51097b8..edaf277073 100644 --- a/apps/cli/docs/supabase-home.md +++ b/apps/cli/docs/supabase-home.md @@ -53,6 +53,7 @@ Managed stack documents and runtime artifacts are shared through the global CLI / access-token cli-latest + stack-nudge.json telemetry.json bin/ stacks/ @@ -140,6 +141,13 @@ subdirectory they use `/cli-latest`. A failed fetch writes an emp suppresses the notice and further fetches until it expires. The cache is skipped when the file, `supabase/.temp`, or `SUPABASE_HOME` is a symlink. `SUPABASE_NO_UPDATE_NOTIFIER=1` disables the check. +## Local stack nudge + +On the legacy backend, `supabase start` suggests trying the experimental local stack at most once +every seven days. It records the last time it showed the suggestion as `{"lastShownAt": }` +in `/stack-nudge.json`. A missing, unreadable, or future timestamp shows the +suggestion again, and a failed write never fails `start`. + ## Related docs - [CLI Code Structure](./code-structure.md) diff --git a/apps/cli/src/command-internal/stack-nudge.ts b/apps/cli/src/command-internal/stack-nudge.ts index dd219fd295..b9f82cd9b5 100644 --- a/apps/cli/src/command-internal/stack-nudge.ts +++ b/apps/cli/src/command-internal/stack-nudge.ts @@ -1,6 +1,7 @@ import { Clock, Effect, FileSystem, Path, Schema } from "effect"; import { CommandSettings } from "../config/command-settings.service.ts"; +import { resolveExperimentalFeature } from "../shared/config/experimental-feature.ts"; import { Output } from "../shared/output/output.service.ts"; import { agentDetected } from "./agent-mode.ts"; @@ -11,8 +12,8 @@ const START_STACK_NUDGE_MESSAGE = `Try the new local stack: faster, lighter, and To switch: remove the fixed ports from supabase/config.toml, then add \`stack = true\` under \`[experimental]\`. Steps and limitations: ${DOCS_URL}`; -const INIT_STACK_NUDGE_MESSAGE = `Try the new faster, lighter, parallel local stack: set SUPABASE_EXPERIMENTAL_STACK=1 and re-run \`supabase init --force\` (regenerates this config) -Learn more: ${DOCS_URL}`; +const INIT_STACK_NUDGE_MESSAGE = `Try the new faster, lighter, parallel local stack: set SUPABASE_EXPERIMENTAL_STACK=1 before your next \`supabase init\`. +To switch this project: ${DOCS_URL}`; const INIT_STACK_ENABLED_MESSAGE = "Experimental local stack enabled in supabase/config.toml. Share feedback: https://github.com/supabase/cli/issues"; @@ -25,7 +26,7 @@ const NudgeState = Schema.fromJsonString(Schema.Struct({ lastShownAt: Schema.Fin const START_AGENT_ASK_LINE = "Coding agents: offer this switch to the user and ask before changing supabase/config.toml."; const INIT_AGENT_ASK_LINE = - "Coding agents: offer this to the user and ask before re-running init with --force."; + "Coding agents: offer this to the user and ask before changing supabase/config.toml."; /** * Who to nudge: a coding agent, a human at a terminal, or nobody. Text mode writes to stderr so @@ -33,6 +34,13 @@ const INIT_AGENT_ASK_LINE = */ const nudgeAudience = Effect.gen(function* () { const output = yield* Output; + // With the config side pinned to true, only an explicit shell `SUPABASE_EXPERIMENTAL_STACK=0` + // resolves to false; that user opted out, so the nudge stays quiet. + const optedOut = !(yield* resolveExperimentalFeature({ + feature: "stack", + configValue: Effect.succeed(true), + }).pipe(Effect.orElseSucceed(() => true))); + if (optedOut) return undefined; if (yield* agentDetected) return "agent" as const; return output.interactive ? ("human" as const) : undefined; }); diff --git a/apps/cli/src/commands/init/init.integration.test.ts b/apps/cli/src/commands/init/init.integration.test.ts index bbb46788f7..26f126fa9a 100644 --- a/apps/cli/src/commands/init/init.integration.test.ts +++ b/apps/cli/src/commands/init/init.integration.test.ts @@ -536,7 +536,7 @@ describe("init", () => { { env: {}, interactive: true, - expected: "set SUPABASE_EXPERIMENTAL_STACK=1 and re-run `supabase init --force`", + expected: "set SUPABASE_EXPERIMENTAL_STACK=1 before your next `supabase init`", }, { env: { SUPABASE_EXPERIMENTAL_STACK: "1" }, @@ -544,11 +544,13 @@ describe("init", () => { expected: "Experimental local stack enabled in supabase/config.toml", }, { env: {}, interactive: false, expected: undefined }, + { env: { SUPABASE_EXPERIMENTAL_STACK: "0" }, interactive: true, expected: undefined }, { env: {}, interactive: false, agent: true, - expected: "Coding agents: offer this to the user and ask before re-running init with --force", + expected: + "Coding agents: offer this to the user and ask before changing supabase/config.toml", }, ])( "stack note (interactive=$interactive, agent=$agent, env=$env)",