(meta: {
customTitle?: string
tag?: string
agentName?: string
agentColor?: string
agentSetting?: string
mode?: 'coordinator' | 'normal'
worktreeSession?: PersistedWorktreeSession | null
prNumber?: number
prUrl?: string
prRepository?: string
})
| 2756 | * agent banner) and re-appended on session exit via reAppendSessionMetadata. |
| 2757 | */ |
| 2758 | export function restoreSessionMetadata(meta: { |
| 2759 | customTitle?: string |
| 2760 | tag?: string |
| 2761 | agentName?: string |
| 2762 | agentColor?: string |
| 2763 | agentSetting?: string |
| 2764 | mode?: 'coordinator' | 'normal' |
| 2765 | worktreeSession?: PersistedWorktreeSession | null |
| 2766 | prNumber?: number |
| 2767 | prUrl?: string |
| 2768 | prRepository?: string |
| 2769 | }): void { |
| 2770 | const project = getProject() |
| 2771 | // ??= so --name (cacheSessionTitle) wins over the resumed |
| 2772 | // session's title. REPL.tsx clears before calling, so /resume is unaffected. |
| 2773 | if (meta.customTitle) project.currentSessionTitle ??= meta.customTitle |
| 2774 | if (meta.tag !== undefined) project.currentSessionTag = meta.tag || undefined |
| 2775 | if (meta.agentName) project.currentSessionAgentName = meta.agentName |
| 2776 | if (meta.agentColor) project.currentSessionAgentColor = meta.agentColor |
| 2777 | if (meta.agentSetting) project.currentSessionAgentSetting = meta.agentSetting |
| 2778 | if (meta.mode) project.currentSessionMode = meta.mode |
| 2779 | if (meta.worktreeSession !== undefined) |
| 2780 | project.currentSessionWorktree = meta.worktreeSession |
| 2781 | if (meta.prNumber !== undefined) |
| 2782 | project.currentSessionPrNumber = meta.prNumber |
| 2783 | if (meta.prUrl) project.currentSessionPrUrl = meta.prUrl |
| 2784 | if (meta.prRepository) project.currentSessionPrRepository = meta.prRepository |
| 2785 | } |
| 2786 | |
| 2787 | /** |
| 2788 | * Clear all cached session metadata (title, tag, agent name/color). |
no test coverage detected