Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

harness ps and message headers name every agent as the app does (#1231)

Deefd3f4031dcba
diff --git a/cli/src/agentClient/model.spec.ts b/cli/src/agentClient/model.spec.ts
index 055427050..fdd65abfe 100644
--- a/cli/src/agentClient/model.spec.ts
+++ b/cli/src/agentClient/model.spec.ts
@@ -86,6 +86,16 @@ describe('a harness as the agent verbs show it', () => {
expect(all.find((r) => r.name === 'kid')).toMatchObject({ startedBy: 'lead', yours: false })
})
+ it('names every agent as the app does, never by its id', () => {
+ // `harness ps` listed a Kilo harness as "kilo": the table here knew six agents and passed the rest through.
+ const named = (engine: string) => rowsOf([frame('a', { engine })], { machineId: 'm', machine: 'mac', caller: null, ledger: ledger(), now: NOW, all: false })[0]!.agent
+ expect(['claude', 'codex', 'opencode', 'cursor', 'grok', 'pi'].map(named)).toEqual(['Claude Code', 'Codex', 'OpenCode', 'Cursor', 'Grok', 'pi'])
+ expect(['kilo', 'amp', 'copilot', 'devin', 'hermes', 'muse', 'commandcode', 'agy'].map(named))
+ .toEqual(['Kilo', 'Amp', 'Copilot', 'Devin', 'Hermes', 'Muse', 'Command Code', 'Antigravity'])
+ // One Harness does not know yet is still said, as it calls itself.
+ expect(named('newagent')).toBe('newagent')
+ })
+
it('finds a harness by its whole name, a name\'s start, or an id\'s start', () => {
const rows = [{ name: 'Reviewer', id: 'aaaaaaaa-1' }, { name: 'reviewer-2', id: 'bbbbbbbb-2' }, { name: 'fixer', id: 'cccccccc-3' }]
expect(matching('reviewer', rows).map((r) => r.id)).toEqual(['aaaaaaaa-1'])
diff --git a/cli/src/messages/model.ts b/cli/src/messages/model.ts
index 8c1c76049..715f95db1 100644
--- a/cli/src/messages/model.ts
+++ b/cli/src/messages/model.ts
@@ -5,6 +5,7 @@
* (services/AGENTS.md).
*/
import { randomBytes } from 'node:crypto'
+import { engineLabel } from '../lib/agentNames.js'
/** Who sent a message, as its header names them. */
export interface Sender {
@@ -101,9 +102,14 @@ export function parseMessage(value: unknown): Message | null {
return { id: v.id, tabId, from: { ...from, engine, machine }, to: to as Recipient[], text: body, at: v.at, ...(v.fyi === true ? { fyi: true as const } : {}) }
}
-/** The engine's name as a person reads it. */
+/**
+ * The engine's name as a person reads it: the app's own word for each (lib/agentNames.ts), Claude Code by its whole
+ * name and pi as it writes itself. This kept a short table of its own, so `harness ps` listed a Kilo harness as
+ * "kilo", and a message from one was headed "· kilo ·" (CLI 0.3.77, a fresh Ubuntu VM, 2026-10-12); the same for
+ * Amp, Copilot, Devin, Hermes, Muse, Command Code and Antigravity ("agy").
+ */
export function engineName(engine: string): string {
- return ({ claude: 'Claude Code', codex: 'Codex', opencode: 'OpenCode', pi: 'pi', grok: 'Grok', cursor: 'Cursor' } as Record<string, string>)[engine] ?? engine
+ return ({ claude: 'Claude Code', pi: 'pi' } as Record<string, string>)[engine] ?? engineLabel(engine)
}
/** The one line above a message: who sent it, so a teammate's words never pass as the person's. */