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.

chore(agents): label the in-memory harness “Macro Agent” in the UI (#6737)

Wolf Mermelsteina375a5ee9abb
diff --git a/apps/web/src/features/agents-view/core/roster.test.ts b/apps/web/src/features/agents-view/core/roster.test.ts
index c07ebcf53a..056364dc2d 100644
--- a/apps/web/src/features/agents-view/core/roster.test.ts
+++ b/apps/web/src/features/agents-view/core/roster.test.ts
@@ -88,7 +88,10 @@ describe('buildAgentRoster', () => {
'coder',
'coder',
]);
- expect(saved[0]?.runtime).toEqual({ label: 'Macro', connected: true });
+ expect(saved[0]?.runtime).toEqual({
+ label: 'Macro Agent',
+ connected: true,
+ });
expect(saved[0]?.unavailableReason).toBeUndefined();
expect(saved[1]?.share).toBe('team');
expect(saved[1]?.runtime).toEqual({ label: 'Cursor', connected: true });
diff --git a/apps/web/src/features/agents-view/core/roster.ts b/apps/web/src/features/agents-view/core/roster.ts
index 084194fe4d..4e99b944a7 100644
--- a/apps/web/src/features/agents-view/core/roster.ts
+++ b/apps/web/src/features/agents-view/core/roster.ts
@@ -7,6 +7,7 @@ import {
isMacroAgentId,
MACRO_AGENT_HANDLE,
MACRO_AGENT_NAME,
+ MACRO_HARNESS_NAME,
} from '@core/constant/macroAgent';
import { type AgentKind, kindForHarness, systemBotKind } from './agent-kind';
@@ -90,7 +91,7 @@ export function runtimeLabel(
switch (harness) {
case 'in-memory':
case 'macro-inmem':
- return 'Macro';
+ return MACRO_HARNESS_NAME;
case 'cursor':
return 'Cursor';
case 'macrod':
@@ -183,7 +184,7 @@ export function buildAgentRoster(input: RosterInput): RosterAgent[] {
harness: 'in-memory',
defaultModel: input.macroDefaultModel,
share: 'system',
- runtime: { label: 'Macro', connected: true },
+ runtime: { label: MACRO_HARNESS_NAME, connected: true },
},
{
id: CURSOR_BOT_ID,
diff --git a/apps/web/src/features/agents-view/queries/connected-runtimes.ts b/apps/web/src/features/agents-view/queries/connected-runtimes.ts
index 0cccc269e2..5c46e3db34 100644
--- a/apps/web/src/features/agents-view/queries/connected-runtimes.ts
+++ b/apps/web/src/features/agents-view/queries/connected-runtimes.ts
@@ -1,3 +1,4 @@
+import { MACRO_HARNESS_NAME } from '@core/constant/macroAgent';
import {
type AgentModelTarget,
buildAgentModelTargets,
@@ -27,7 +28,7 @@ export function connectedRuntimes(
if (target.harness === 'in-memory') {
return {
id: 'in-memory',
- name: 'Macro Harness',
+ name: MACRO_HARNESS_NAME,
kind: 'builtin',
target,
connected: true,
diff --git a/apps/web/src/features/agents-view/views/RosterPage.tsx b/apps/web/src/features/agents-view/views/RosterPage.tsx
index 4058e5b293..988dbbf34c 100644
--- a/apps/web/src/features/agents-view/views/RosterPage.tsx
+++ b/apps/web/src/features/agents-view/views/RosterPage.tsx
@@ -17,6 +17,7 @@ import {
MACRO_AGENT_BOT_ID,
MACRO_AGENT_HANDLE,
MACRO_AGENT_NAME,
+ MACRO_HARNESS_NAME,
} from '@core/constant/macroAgent';
import { useSettingsState } from '@core/constant/SettingsState';
import { useChannelsContext } from '@core/context/channels';
@@ -91,7 +92,7 @@ const MACRO_ROW: Row = {
handle: MACRO_AGENT_HANDLE,
kind: 'agent',
share: 'system',
- runtime: 'Macro Harness',
+ runtime: MACRO_HARNESS_NAME,
model: 'Default model',
channels: 'All channels',
canEdit: false,
@@ -321,7 +322,7 @@ export function RosterPage(props: {
<div id="runtimeList">
<RuntimeRow
icon={<MacroLogo class="ph" />}
- name="Macro Harness"
+ name={MACRO_HARNESS_NAME}
badge="system"
sub="Built in · runs in Macro's cloud"
connected
@@ -330,7 +331,7 @@ export function RosterPage(props: {
<button
type="button"
class="icon-btn"
- aria-label="Configure Macro Harness"
+ aria-label={`Configure ${MACRO_HARNESS_NAME}`}
onClick={() => openSettings('Harness')}
>
<GearIcon class="ph" />
diff --git a/apps/web/src/features/block-agent/component/compose-agent-session-options.test.ts b/apps/web/src/features/block-agent/component/compose-agent-session-options.test.ts
index ac06dc077b..57539f9a42 100644
--- a/apps/web/src/features/block-agent/component/compose-agent-session-options.test.ts
+++ b/apps/web/src/features/block-agent/component/compose-agent-session-options.test.ts
@@ -4,6 +4,7 @@ import { CURSOR_BOT_ID } from '@core/constant/cursorAgent';
import { describe, expect, it } from 'vitest';
import {
harnessDisplayName,
+ harnessTitle,
sessionHarnessTitle,
sessionRepositoryUrl,
} from './compose-agent-session-options';
@@ -35,8 +36,9 @@ describe('sessionRepositoryUrl', () => {
describe('harnessDisplayName', () => {
it('names Macro runtimes after the product', () => {
- expect(harnessDisplayName('in-memory')).toBe('Macro');
- expect(harnessDisplayName('sandbox')).toBe('Macro');
+ expect(harnessDisplayName('in-memory')).toBe('Macro Agent');
+ expect(harnessDisplayName('macro-inmem')).toBe('Macro Agent');
+ expect(harnessDisplayName('sandbox')).toBe('Macro Agent');
});
it('names the Cursor runtime', () => {
@@ -48,6 +50,20 @@ describe('harnessDisplayName', () => {
});
});
+describe('harnessTitle', () => {
+ it('uses the product name for Macro slugs instead of title-casing them', () => {
+ expect(harnessTitle('macro-inmem')).toBe('Macro Agent');
+ expect(harnessTitle('in-memory')).toBe('Macro Agent');
+ expect(harnessTitle('sandbox')).toBe('Macro Agent');
+ });
+
+ it('title-cases other slugs', () => {
+ expect(harnessTitle('claude-code')).toBe('Claude Code');
+ expect(harnessTitle('codex-cloud')).toBe('Codex Cloud');
+ expect(harnessTitle(undefined)).toBe('Agent session');
+ });
+});
+
describe('sessionHarnessTitle', () => {
it.each([
[CURSOR_BOT_ID, 'Cursor'],
@@ -65,4 +81,9 @@ describe('sessionHarnessTitle', () => {
'Claude Cloud'
);
});
+
+ it('uses the product name for Macro slugs', () => {
+ expect(sessionHarnessTitle({ harness: 'macro-inmem' })).toBe('Macro Agent');
+ expect(sessionHarnessTitle({ harness: 'in-memory' })).toBe('Macro Agent');
+ });
});
diff --git a/apps/web/src/features/block-agent/component/compose-agent-session-options.ts b/apps/web/src/features/block-agent/component/compose-agent-session-options.ts
index abf4db28e5..fb6c9aa4c9 100644
--- a/apps/web/src/features/block-agent/component/compose-agent-session-options.ts
+++ b/apps/web/src/features/block-agent/component/compose-agent-session-options.ts
@@ -2,6 +2,7 @@ import { isCoderHarness } from '@app/features/agents-view/core/agent-kind';
import { isClaudeBotId } from '@core/constant/claudeAgent';
import { isCodexBotId } from '@core/constant/codexAgent';
import { isCursorBotId } from '@core/constant/cursorAgent';
+import { MACRO_HARNESS_NAME } from '@core/constant/macroAgent';
/**
* The repository a session works in, for the header menu and side panel.
@@ -16,9 +17,8 @@ export function sessionRepositoryUrl(
return session.repoUrl ?? undefined;
}
-/** 'claude-code' → 'Claude Code'; the fallback when nothing names a harness. */
-export function harnessTitle(harness: string | undefined): string {
- if (!harness) return 'Agent session';
+/** Title-case a harness slug when nothing names it (`claude-code` → `Claude Code`). */
+function titledHarness(harness: string): string {
return harness
.split(/[-_]/)
.filter(Boolean)
@@ -26,6 +26,22 @@ export function harnessTitle(harness: string | undefined): string {
.join(' ');
}
+/**
+ * Label for a session's harness. Macro slugs would otherwise title-case to
+ * "Macro Inmem" / "In Memory"; everything else stays a titled slug.
+ */
+export function harnessTitle(harness: string | undefined): string {
+ if (!harness) return 'Agent session';
+ if (
+ harness === 'in-memory' ||
+ harness === 'macro-inmem' ||
+ harness === 'sandbox'
+ ) {
+ return MACRO_HARNESS_NAME;
+ }
+ return titledHarness(harness);
+}
+
/**
* The harness slug a session should be labeled with. First-party cloud bots
* own a fixed slug (Cursor / Codex / Claude Cloud), even when an older row
@@ -52,14 +68,14 @@ export function sessionHarnessTitle(session: {
/**
* User-facing name for the runtime a persona runs on. Harness ids are
- * plumbing ("in-memory", "sandbox"); the product names are the coders.
+ * plumbing (`in-memory`, `macro-inmem`); the product name is Macro Agent.
*/
export function harnessDisplayName(harness: string): string {
switch (harness) {
case 'in-memory':
case 'macro-inmem':
case 'sandbox':
- return 'Macro';
+ return MACRO_HARNESS_NAME;
case 'cursor':
return 'Cursor';
case 'codex-cloud':
diff --git a/apps/web/src/features/settings/Agents.tsx b/apps/web/src/features/settings/Agents.tsx
index aaf182bcd5..c6933ff798 100644
--- a/apps/web/src/features/settings/Agents.tsx
+++ b/apps/web/src/features/settings/Agents.tsx
@@ -4,7 +4,10 @@ import { isLargeModelCatalog } from '@core/component/AI/component/input/modelCat
import { MODEL_PRETTYNAME, Model } from '@core/component/AI/constant/model';
import { toast } from '@core/component/Toast/Toast';
import { claudeCloud } from '@core/constant/featureFlags';
-import { MACRO_AGENT_BOT_ID } from '@core/constant/macroAgent';
+import {
+ MACRO_AGENT_BOT_ID,
+ MACRO_HARNESS_NAME,
+} from '@core/constant/macroAgent';
import { useChannelsContext } from '@core/context/channels';
import { useUserId } from '@core/context/user';
import { usePipedreamMcpFlag } from '@core/pipedream/flag';
@@ -78,7 +81,7 @@ type ChannelOption = ReturnType<typeof botAssignableChannelOptions>[number];
const IN_MEMORY_HARNESS: ConnectedHarness = {
id: 'in-memory',
- name: 'In-memory',
+ name: MACRO_HARNESS_NAME,
kind: 'builtin',
allowPermissionBypass: true,
target: { harness: 'in-memory' },
@@ -89,7 +92,7 @@ const MACRO_AGENT: AgentSummary = {
name: 'Macro',
tag: 'macro',
instructions: '',
- harness: 'In-memory',
+ harness: MACRO_HARNESS_NAME,
defaultModel: MODEL_PRETTYNAME[Model.sonnet5],
channelSummary: 'All channels',
share: 'Team',
@@ -395,7 +398,7 @@ function summarizeAgent(
}
function harnessName(id: string): string {
- if (id === 'in-memory') return 'In-memory';
+ if (id === 'in-memory') return MACRO_HARNESS_NAME;
if (id === 'cursor') return 'Cursor';
if (id === 'claude-cloud') return 'Claude Cloud';
// Any other id is a registered macrod harness uuid; if it is not in the
diff --git a/apps/web/src/features/settings/Harness.test.tsx b/apps/web/src/features/settings/Harness.test.tsx
index a5d3b68b00..34fe723ea3 100644
--- a/apps/web/src/features/settings/Harness.test.tsx
+++ b/apps/web/src/features/settings/Harness.test.tsx
@@ -321,7 +321,7 @@ describe('Harness', () => {
it('shows Claude with the Anthropic logo above Cursor in the harness list', () => {
render(() => <Harness />);
- expect(screen.getByRole('heading', { name: 'In-memory' })).toBeTruthy();
+ expect(screen.getByRole('heading', { name: 'Macro Agent' })).toBeTruthy();
expect(screen.getByRole('heading', { name: 'Cursor' })).toBeTruthy();
const claude = screen.getByRole('heading', { name: 'Claude Cloud' });
const cursor = screen.getByRole('heading', { name: 'Cursor' });
diff --git a/apps/web/src/features/settings/Harness.tsx b/apps/web/src/features/settings/Harness.tsx
index ca3ead0cc8..807794e584 100644
--- a/apps/web/src/features/settings/Harness.tsx
+++ b/apps/web/src/features/settings/Harness.tsx
@@ -1,6 +1,7 @@
import { ModelCatalogPicker } from '@core/component/AI/component/input/ModelCatalogPicker';
import { isLargeModelCatalog } from '@core/component/AI/component/input/modelCatalog';
import { toast } from '@core/component/Toast/Toast';
+import { MACRO_HARNESS_NAME } from '@core/constant/macroAgent';
import { ThrownResultError } from '@core/util/result';
import CursorIcon from '@icon/wide-cursor-ide.svg';
import ArrowUpRightIcon from '@phosphor/arrow-up-right.svg';
@@ -163,15 +164,15 @@ export function Harness() {
</HarnessIcon>
<div class="min-w-0 flex-1">
<div class="flex items-center gap-2">
- <h2 class="text-sm font-medium text-ink">In-memory</h2>
+ <h2 class="text-sm font-medium text-ink">{MACRO_HARNESS_NAME}</h2>
<span class="rounded-full bg-success-bg px-2 py-0.5 text-[11px] font-medium text-success">
Built in
</span>
</div>
<p class="mt-1 text-sm text-ink-muted">
- Macro's in-memory harness runs agents directly in your workspace.
- It is ready to use and does not require any configuration. This is
- not a coding harness.
+ Macro Agent runs directly in your workspace. It is ready to use
+ and does not require any configuration. This is not a coding
+ harness.
</p>
</div>
</section>
diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/MagicChip/create-magic-chip-model.test.ts b/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/MagicChip/create-magic-chip-model.test.ts
index fc6be9f3f4..38d4387aa7 100644
--- a/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/MagicChip/create-magic-chip-model.test.ts
+++ b/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/MagicChip/create-magic-chip-model.test.ts
@@ -358,6 +358,30 @@ describe('createMagicChipModel', () => {
}
);
+ it.each(['in-memory', 'macro-inmem', 'sandbox'])(
+ 'names the %s session Macro Agent, not Macro Agent Agent',
+ async (harness) => {
+ serviceClient.get.mockResolvedValue({
+ isOk: () => true,
+ isErr: () => false,
+ value: {
+ status: { kind: 'disconnected' },
+ harness,
+ model: '',
+ canEdit: true,
+ },
+ });
+ let model!: ReturnType<typeof createMagicChipModel>;
+ const dispose = createRoot((dispose) => {
+ model = createModel(props);
+ return dispose;
+ });
+ await settle();
+ expect(model.header()?.agent).toBe('Macro Agent');
+ dispose();
+ }
+ );
+
it('restarts an initial pending snapshot when registration arrives', async () => {
const snapshot = (pullRequestUrl: string | null) => ({
isErr: () => false,
diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/MagicChip/create-magic-chip-model.ts b/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/MagicChip/create-magic-chip-model.ts
index 754daee0ed..241552f424 100644
--- a/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/MagicChip/create-magic-chip-model.ts
+++ b/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/MagicChip/create-magic-chip-model.ts
@@ -48,9 +48,9 @@ type SessionIdentity = {
};
/**
- * The persona as the header names it: the runtime's product name followed
- * by "Agent" (`Macro Agent`, `Cursor Agent`), a titled slug for a runtime
- * the composer does not name.
+ * The persona as the header names it: the runtime's product name, with
+ * "Agent" appended when that name does not already end in it (`Macro Agent`,
+ * `Cursor Agent`). A titled slug for a runtime the composer does not name.
*/
function agentName(session: {
harness?: string;
@@ -59,7 +59,8 @@ function agentName(session: {
const harness = sessionHarnessSlug(session);
if (!harness) return undefined;
const known = harnessDisplayName(harness);
- return `${known === harness ? harnessTitle(harness) : known} Agent`;
+ const base = known === harness ? harnessTitle(harness) : known;
+ return base.endsWith(' Agent') ? base : `${base} Agent`;
}
/**
diff --git a/apps/web/src/lib/core/constant/macroAgent.ts b/apps/web/src/lib/core/constant/macroAgent.ts
index f5831df9e7..e42609a0ce 100644
--- a/apps/web/src/lib/core/constant/macroAgent.ts
+++ b/apps/web/src/lib/core/constant/macroAgent.ts
@@ -15,6 +15,12 @@ export const MACRO_AGENT_PRINCIPAL_ID = `bot|${MACRO_AGENT_BOT_ID}`;
/** Display name for Macro. */
export const MACRO_AGENT_NAME = 'Macro';
+/**
+ * User-facing name for Macro's built-in harness (`in-memory` / `macro-inmem`).
+ * Wire slugs stay as they are; this is only what the UI prints.
+ */
+export const MACRO_HARNESS_NAME = 'Macro Agent';
+
/** Handle used to find Macro in the mention typeahead (`@macro`). */
export const MACRO_AGENT_HANDLE = 'macro';
diff --git a/docs/AGENT_GUIDE/surfaces.md b/docs/AGENT_GUIDE/surfaces.md
index 29f10af9f0..73bbdbd27a 100644
--- a/docs/AGENT_GUIDE/surfaces.md
+++ b/docs/AGENT_GUIDE/surfaces.md
@@ -791,7 +791,7 @@ are managed on that page, rather than in Settings.
`Back to app` returns to the previous surface. Open via user-email button menu or `Ctrl+;`.
`Agents` → `Create agent` (or edit an existing agent) opens runtime selectors.
-The model list is loaded live and independently for In-memory, connected Cursor, and every
+The model list is loaded live and independently for Macro Agent, connected Cursor, and every
registered macrod harness. The selected harness stays selected when the list refreshes.
A paired macrod connects on startup, so models can load before any agents are bound.
A harness can show `Loading models…`, an unsupported message, or
diff --git a/docs/CLAUDE_CLOUD_DEMO.md b/docs/CLAUDE_CLOUD_DEMO.md
index 882b56230c..d89b07fd11 100644
--- a/docs/CLAUDE_CLOUD_DEMO.md
+++ b/docs/CLAUDE_CLOUD_DEMO.md
@@ -86,7 +86,7 @@ Claude's consent page and completing the one-time code exchange.
## Use in Macro
1. Connect through the Claude row in Settings → Harness, then create or edit a private agent in Settings → Agents.
-2. Select **Claude Cloud**. It is offered for new selections only when model discovery confirms that your Macro identity has a configured connection. When editing a saved Claude agent, the harness stays visibly selected while discovery loads or fails. Models belong to the selected harness: Fable is available through Claude Cloud only, and switching to In-memory replaces the catalog and model preference with that harness's choices.
+2. Select **Claude Cloud**. It is offered for new selections only when model discovery confirms that your Macro identity has a configured connection. When editing a saved Claude agent, the harness stays visibly selected while discovery loads or fails. Models belong to the selected harness: Fable is available through Claude Cloud only, and switching to Macro Agent replaces the catalog and model preference with that harness's choices.
3. Choose from Claude's model catalog. Settings calls `GET /v1/models` with your connected account's OAuth credential, without the code-session beta header (which this endpoint rejects). Discovery follows pagination and fails visibly on provider errors or an incomplete catalog; it never scans recent sessions, reads transcripts, creates a worker, or spends inference. IDs, names, and ordering come from the API, with **Claude · subscription default** retained as the provider's reset choice. Fable can appear even when you have no previous sessions. New conversations pass the selected model in Claude's creation configuration. Existing conversations retain aliases reported by their own worker alongside the direct account catalog. The first prompt requests initialization alongside the model and user message, and subsequent worker catalogs replace that session's aliases without removing account-listed choices or resetting your saved preference. The Models API is not a guarantee that every cloud worker accepts every listed model: Claude validates the request when the worker runs. Selection saves the next-turn preference after event submission; it does not wait for an idle worker. Each prompt repeats that preference immediately before the user message in one ordered batch, including after a Macro restart. A worker rejection surfaces an error and requests interruption; this cannot guarantee zero inference before the rejection arrives.
4. Start a session with that agent or mention it in a channel. Prompts, follow-ups, text streaming, tool cards, cancellation, and transcript load use Macro's existing session interface.
5. In the session header, use **Open in Claude** (the external-link icon; in the toolbar overflow on narrow screens). Existing demo sessions get the link too.