Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.
TypeScript adeagent-ideai-agentsautomationbotclaude-codecodexghosttygrok-bothermes-agentmobile-appmuseopenclawopencodeorchestrationpiruntimeterminalworktreesyc-backed
import { describe, expect, it } from 'vitest'
import {
getAgentRowConversationName,
type ConversationNameTab
} from './agent-row-conversation-name'
function makeTab(overrides: Partial<ConversationNameTab> = {}): ConversationNameTab {
return { customTitle: null, title: '', ...overrides }
}
describe('getAgentRowConversationName', () => {
it('prefers the manual tab rename over every other source', () => {
const tab = makeTab({
customTitle: 'Patient sync spike',
quickCommandLabel: 'Run tests',
generatedTitle: 'Fix intake flow',
title: '✳ Investigate replay bug'
})
expect(getAgentRowConversationName(tab, 'claude', true)).toBe('Patient sync spike')
})
it('falls back to the quick-command label before titles', () => {
const tab = makeTab({ quickCommandLabel: 'Run tests', title: '✳ Investigate replay bug' })
expect(getAgentRowConversationName(tab, 'claude', true)).toBe('Run tests')
})
it('keeps OpenCode semantic session titles whole', () => {
const tab = makeTab({ title: 'OC | build the release pipeline', generatedTitle: 'Older title' })
expect(getAgentRowConversationName(tab, 'opencode', false)).toBe(
'OC | build the release pipeline'
)
expect(getAgentRowConversationName(tab, 'opencode', true)).toBe(
'OC | build the release pipeline'
)
})
it("shows the title owned by the row's provider session", () => {
const tab = makeTab({
aiVaultTitle: { agent: 'claude', sessionId: 's1', title: 'Fix the lease probe' },
generatedTitle: 'Fix intake flow',
title: '\u2733 Investigate replay bug'
})
expect(getAgentRowConversationName(tab, 'claude', true, undefined, 's1')).toBe(
'Fix the lease probe'
)
expect(getAgentRowConversationName(tab, 'claude', true, undefined, 's2')).toBe(
'Fix intake flow'
)
expect(getAgentRowConversationName(tab, 'codex', true, undefined, 's1')).toBe('Fix intake flow')
expect(getAgentRowConversationName(tab, 'claude', true)).toBe('Fix intake flow')
})
it('lets a manual rename and a quick command still outrank the provider title', () => {
const vault = { agent: 'claude' as const, sessionId: 's1', title: 'Fix the lease probe' }
expect(
getAgentRowConversationName(
makeTab({ aiVaultTitle: vault, customTitle: 'Mine' }),
'claude',
true,
undefined,
's1'
)
).toBe('Mine')
expect(
getAgentRowConversationName(
makeTab({ aiVaultTitle: vault, quickCommandLabel: 'Run tests' }),
'claude',
true,
undefined,
's1'
)
).toBe('Run tests')
})
it('keeps a cwd-shaped provider title that the live-title sanitizer would discard', () => {
// `auth/login` is a real session name; as a scraped live title it would be read as a cwd.
const tab = makeTab({
aiVaultTitle: { agent: 'claude', sessionId: 's1', title: 'auth/login' },
title: '\u2733 Investigate replay bug'
})
expect(getAgentRowConversationName(tab, 'claude', true, undefined, 's1')).toBe('auth/login')
expect(getAgentRowConversationName(makeTab({ title: 'auth/login' }), 'claude', true)).toBeNull()
})
it('uses the generated title only when generated titles are enabled', () => {
const tab = makeTab({ generatedTitle: 'Fix intake flow', title: '✳ Investigate replay bug' })
expect(getAgentRowConversationName(tab, 'claude', true)).toBe('Fix intake flow')
expect(getAgentRowConversationName(tab, 'claude', false)).toBe('Investigate replay bug')
})
it('names a split pane from its own live title, not the tab title', () => {
// Tab live title belongs to the focused pane; siblings need their own.
const tab = makeTab({ title: '\u2733 Linear work log' })
expect(getAgentRowConversationName(tab, 'claude', false, '\u2733 Redis cache strategy')).toBe(
'Redis cache strategy'
)
expect(
getAgentRowConversationName(tab, 'opencode', false, 'OC | build the release pipeline')
).toBe('OC | build the release pipeline')
expect(getAgentRowConversationName(tab, 'claude', false, null)).toBeNull()
expect(getAgentRowConversationName(tab, 'claude', false)).toBe('Linear work log')
})
it('keeps tab-owned names above the pane title', () => {
// User-given names belong to the tab and remain stable across pane focus.
const custom = makeTab({ customTitle: 'Patient sync spike' })
expect(getAgentRowConversationName(custom, 'claude', false, 'Redis cache strategy')).toBe(
'Patient sync spike'
)
const quick = makeTab({ quickCommandLabel: 'Run tests' })
expect(getAgentRowConversationName(quick, 'claude', false, null)).toBe('Run tests')
const generated = makeTab({ generatedTitle: 'Fix intake flow' })
expect(getAgentRowConversationName(generated, 'claude', true, null)).toBe('Fix intake flow')
})
it('strips leading status decoration from agent-set titles', () => {
expect(
getAgentRowConversationName(makeTab({ title: '✳ Fix patient intake flow' }), 'claude', false)
).toBe('Fix patient intake flow')
expect(
getAgentRowConversationName(makeTab({ title: '⠋ Refactor replay guard' }), 'codex', false)
).toBe('Refactor replay guard')
})
it('rejects spinner+cwd titles instead of surfacing paths as names', () => {
expect(
getAgentRowConversationName(makeTab({ title: '⠋ ~/orca/workspaces' }), 'codex', false)
).toBeNull()
expect(
getAgentRowConversationName(makeTab({ title: '/Users/dev/repo' }), 'codex', false)
).toBeNull()
expect(
getAgentRowConversationName(makeTab({ title: 'C:\\repos\\orca' }), 'codex', false)
).toBeNull()
expect(
getAgentRowConversationName(makeTab({ title: 'orca/workspaces' }), 'codex', false)
).toBeNull()
expect(
getAgentRowConversationName(
makeTab({ title: '\\\\wsl.localhost\\Ubuntu\\home\\dev\\orca' }),
'codex',
false
)
).toBeNull()
expect(
getAgentRowConversationName(makeTab({ title: 'repos\\orca' }), 'codex', false)
).toBeNull()
})
it('accepts multi-word titles that merely contain a slash', () => {
expect(
getAgentRowConversationName(makeTab({ title: 'Fix a/b toggle in settings' }), 'codex', false)
).toBe('Fix a/b toggle in settings')
})
it('rejects synthetic status titles', () => {
expect(
getAgentRowConversationName(makeTab({ title: 'Codex ready' }), 'codex', false)
).toBeNull()
expect(
getAgentRowConversationName(makeTab({ title: 'Codex - action required' }), 'codex', false)
).toBeNull()
expect(
getAgentRowConversationName(makeTab({ title: 'Cursor Agent' }), 'cursor', false)
).toBeNull()
})
it('rejects identity-echo, management, and placeholder titles', () => {
expect(getAgentRowConversationName(makeTab({ title: 'Claude' }), 'claude', false)).toBeNull()
expect(
getAgentRowConversationName(makeTab({ title: '✳ Claude Code' }), 'claude', false)
).toBeNull()
expect(
getAgentRowConversationName(
makeTab({ title: 'Claude Code - action required' }),
'claude',
false
)
).toBeNull()
expect(
getAgentRowConversationName(makeTab({ title: '✦ Gemini CLI' }), 'gemini', false)
).toBeNull()
expect(
getAgentRowConversationName(makeTab({ title: '◇ Ready (orca)' }), 'gemini', false)
).toBeNull()
expect(
getAgentRowConversationName(makeTab({ title: 'claude agents' }), 'claude', false)
).toBeNull()
expect(getAgentRowConversationName(makeTab({ title: 'Agent' }), 'claude', false)).toBeNull()
})
it("rejects jcode's live identity title so the row shows the prompt instead", () => {
// jcode's per-second codename/diff/duration title would hide the actual prompt/reply preview.
expect(
getAgentRowConversationName(
makeTab({ title: '🌐 jcode Puppy · +3 -0 · last ~23s' }),
'jcode',
false
)
).toBeNull()
expect(
getAgentRowConversationName(makeTab({ title: '🐍 jcode Snake · work ~6s' }), 'jcode', false)
).toBeNull()
expect(
getAgentRowConversationName(makeTab({ title: '🐍 jcode/creek Snake' }), 'jcode', false)
).toBeNull()
expect(
getAgentRowConversationName(makeTab({ title: 'Fix the greet helper' }), 'jcode', false)
).toBe('Fix the greet helper')
})
it('rejects empty, glyph-only, and default terminal titles', () => {
expect(
getAgentRowConversationName(
makeTab({ title: 'Workbench', defaultTitle: 'Workbench' }),
'claude',
false
)
).toBeNull()
expect(getAgentRowConversationName(makeTab(), 'claude', false)).toBeNull()
expect(getAgentRowConversationName(makeTab({ title: '✳' }), 'claude', false)).toBeNull()
expect(
getAgentRowConversationName(makeTab({ title: 'Terminal 1' }), 'claude', false)
).toBeNull()
expect(
getAgentRowConversationName(
makeTab({ title: 'Terminal 2', defaultTitle: 'Terminal 2' }),
'claude',
false
)
).toBeNull()
})
})