mirror of
https://github.com/stablyai/orca.git
synced 2026-11-18 20:06:10 +00:00
fix(activity): name a resumed session by its own title in the agents list (#41127)
The Agents list titled a thread with the tab's generated title, the first prompt that tab saw. After `claude --resume` in a new tab, that is the message sent after the resume, so the list kept a status note as the thread's name while the tab and the agent row showed the session's own name. Rank a named provider title of the pane's own session above the generated title, as resolveTabNameSource does, and share the session ownership check with the agent row.
This commit is contained in:
@@ -7,6 +7,7 @@ import { isJcodeIdentityTerminalTitle } from '../title/providers/jcode-terminal-
|
||||
import { SYNTHETIC_AGENT_TITLE_PROFILES } from '../title/synthetic-agent-title'
|
||||
import type { TerminalTab } from '../../workspace-layout/terminal-tab-types'
|
||||
import { resolveTabNameSource } from '../../tab-title-resolution'
|
||||
import { aiVaultTitleOfSession } from '../../ai-vault/contracts/ai-vault-session-title'
|
||||
|
||||
export type ConversationNameTab = Pick<
|
||||
TerminalTab,
|
||||
@@ -111,19 +112,12 @@ export function getAgentRowConversationName(
|
||||
): string | null {
|
||||
const liveTitle =
|
||||
paneLiveTitle === undefined ? (tab.title?.trim() ?? '') : (paneLiveTitle?.trim() ?? '')
|
||||
// Provider titles belong to their session, not every pane in the tab.
|
||||
const aiVaultTitle = tab.aiVaultTitle
|
||||
const named = resolveTabNameSource(
|
||||
{
|
||||
customTitle: tab.customTitle,
|
||||
quickCommandLabel: tab.quickCommandLabel,
|
||||
liveTitle,
|
||||
sessionTitle:
|
||||
aiVaultTitle &&
|
||||
aiVaultTitle.agent === agentType &&
|
||||
aiVaultTitle.sessionId === providerSessionId
|
||||
? aiVaultTitle
|
||||
: null,
|
||||
sessionTitle: aiVaultTitleOfSession(tab.aiVaultTitle, agentType, providerSessionId),
|
||||
generatedTitle: tab.generatedTitle
|
||||
},
|
||||
generatedTitlesEnabled
|
||||
|
||||
@@ -11,6 +11,15 @@ export type AiVaultSessionTitle = {
|
||||
kind?: AiVaultSessionTitleKind
|
||||
}
|
||||
|
||||
/** A tab's provider title names only the pane running that session, not every pane in the tab. */
|
||||
export function aiVaultTitleOfSession(
|
||||
title: AiVaultSessionTitle | null | undefined,
|
||||
agent: string | null | undefined,
|
||||
sessionId: string | undefined
|
||||
): AiVaultSessionTitle | null {
|
||||
return title && title.agent === agent && title.sessionId === sessionId ? title : null
|
||||
}
|
||||
|
||||
export type AiVaultSessionTitleRequest = {
|
||||
agent: AiVaultSessionTitle['agent']
|
||||
sessionId: string
|
||||
|
||||
Reference in New Issue
Block a user