Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(flags): turn agent DMs on in dev and default new flags on in dev (#8162)

teo765004220d13
diff --git a/.agents/skills/feature-flags/SKILL.md b/.agents/skills/feature-flags/SKILL.md
index 6879f5a444..5e72aa22f5 100644
--- a/.agents/skills/feature-flags/SKILL.md
+++ b/.agents/skills/feature-flags/SKILL.md
@@ -22,7 +22,8 @@ Most product rollouts are **remote**. Use **env-only** when there is no PostHog
flag and never will be (compile-time / local kill switch).
Ask before assuming. If the user said "flag it" and did not mention PostHog,
-prefer remote and confirm.
+prefer remote and confirm. The answer decides where the flag lives, not who
+sees it: either way a new flag is usually on in dev (see `default` below).
## 2. Define it
@@ -33,10 +34,12 @@ Add one `defineFlag` next to its neighbors. Do not add `ENABLE_*_FLAG` /
`disable-browser-turso-cache`). Export the object in matching camelCase
(`enableFoo`).
- `env`: the name after `VITE_`, e.g. `'ENABLE_FOO'` → `VITE_ENABLE_FOO`.
-- `default`: used when env is unset. On a remote flag, `false` is a real
- override and **skips PostHog**. On-in-dev / on-in-local is
- `DEV_MODE_ENV || undefined` or `LOCAL_ONLY || undefined`, not the boolean
- itself.
+- `default`: used when env is unset. Turn a new flag on in dev:
+ `DEV_MODE_ENV` on an env-only flag; on a remote flag `onInDev`
+ (`DEV_MODE_ENV || undefined`), not the boolean itself. If it must stay off in
+ dev, say why in a comment above it. On a remote flag, `false` is a real
+ override and **skips PostHog**. On-in-local only is
+ `LOCAL_ONLY || undefined`.
- Never invert on the flag object. If the product question is "disable X",
invert at the call site (`!isFeatureEnabled(disableX)`).
- Env-only exports that are used as `if (ENABLE_FOO)` must be the boolean:
@@ -51,7 +54,7 @@ export const enableFoo = defineFlag({
export const ENABLE_BAR = defineFlag({
env: 'ENABLE_BAR',
- default: false,
+ default: DEV_MODE_ENV,
}).enabled;
```
diff --git a/apps/web/src/lib/core/constant/featureFlags.ts b/apps/web/src/lib/core/constant/featureFlags.ts
index bd0eb3b223..09bbb89f54 100644
--- a/apps/web/src/lib/core/constant/featureFlags.ts
+++ b/apps/web/src/lib/core/constant/featureFlags.ts
@@ -69,9 +69,10 @@ function envOverride(env: string | undefined): boolean | undefined {
* Define a feature flag. Pass `key` for PostHog, or `env` (and no `key`)
* for env-only. `env` is the name after `VITE_`, e.g. `'ENABLE_REMINDERS'`.
*
- * `default` is used when env is unset. Omit it on env-only flags for `false`.
- * For remote flags, omit it (or pass `undefined`) to defer to PostHog.
- * The caller decides when a default applies, e.g. `DEV_MODE_ENV || undefined`.
+ * `default` is used when env is unset. A new flag is usually on in dev:
+ * `DEV_MODE_ENV` for env-only, `onInDev` (`DEV_MODE_ENV || undefined`) for
+ * remote. One that stays off in dev says why in a comment. Omitted, an
+ * env-only flag is `false` and a remote flag defers to PostHog.
*
* Remote: `useFeatureFlag(flag)` or `isFeatureEnabled(flag)`.
* Env-only: `isFeatureEnabled(flag)` only.
@@ -729,11 +730,11 @@ export const enableChatV3Agents = defineFlag({
default: onInDev,
});
-// Private conversations with agent personas. Explicit environment opt-in;
-// this flag has no remote PostHog source. VITE_ENABLE_AGENT_DMS=true enables it.
+// Private conversations with agent personas. On in dev; there is no PostHog
+// flag. Override with VITE_ENABLE_AGENT_DMS.
export const ENABLE_AGENT_DMS = defineFlag({
env: 'ENABLE_AGENT_DMS',
- default: false,
+ default: DEV_MODE_ENV,
}).enabled;
// The built-in @cursor mention, using the mentioning user's own Cursor account.
diff --git a/docs/agent-guide/channels.md b/docs/agent-guide/channels.md
index 562b711790..6ce3259038 100644
--- a/docs/agent-guide/channels.md
+++ b/docs/agent-guide/channels.md
@@ -19,10 +19,11 @@ repeat with a plus-addressed DM recipient to check the email-name fallback.
## Private conversations with an agent
-Agent DM discovery is enabled with the local/environment flag
-`VITE_ENABLE_AGENT_DMS=true`; it defaults off and has no PostHog flag. Set it
-before starting Vite or building the frontend. Disabling discovery does not
-delete existing conversations or cancel their work.
+Agent DM discovery is on in development builds (dev.macro.com and `bun run dev`)
+and off in production; there is no PostHog flag. Override it with
+`VITE_ENABLE_AGENT_DMS=true` or `false` before starting Vite or building the
+frontend. Disabling discovery does not delete existing conversations or cancel
+their work.
Choose an agent in **Create → Message**, or click **Message** in its settings or
bot profile. The picker offers your agents, eligible team agents, and Macro.