(meta: {
customTitle?: string
tag?: string
agentName?: string
agentColor?: string
agentSetting?: string
mode?: 'coordinator' | 'normal'
worktreeSession?: PersistedWorktreeSession | null
prNumber?: number
prUrl?: string
prRepository?: string
})
| 2936 | * agent banner) and re-appended on session exit via reAppendSessionMetadata. |
| 2937 | */ |
| 2938 | export function restoreSessionMetadata(meta: { |
| 2939 | customTitle?: string |
| 2940 | tag?: string |
| 2941 | agentName?: string |
| 2942 | agentColor?: string |
| 2943 | agentSetting?: string |
| 2944 | mode?: 'coordinator' | 'normal' |
| 2945 | worktreeSession?: PersistedWorktreeSession | null |
| 2946 | prNumber?: number |
| 2947 | prUrl?: string |
| 2948 | prRepository?: string |
| 2949 | }): void { |
| 2950 | const project = getProject() |
| 2951 | // ??= so --name (cacheSessionTitle) wins over the resumed |
| 2952 | // session's title. REPL.tsx clears before calling, so /resume is unaffected. |
| 2953 | if (meta.customTitle) project.currentSessionTitle ??= meta.customTitle |
| 2954 | if (meta.tag !== undefined) project.currentSessionTag = meta.tag || undefined |
| 2955 | if (meta.agentName) project.currentSessionAgentName = meta.agentName |
| 2956 | if (meta.agentColor) project.currentSessionAgentColor = meta.agentColor |
| 2957 | if (meta.agentSetting) project.currentSessionAgentSetting = meta.agentSetting |
| 2958 | if (meta.mode) project.currentSessionMode = meta.mode |
| 2959 | if (meta.worktreeSession !== undefined) |
| 2960 | project.currentSessionWorktree = meta.worktreeSession |
| 2961 | if (meta.prNumber !== undefined) |
| 2962 | project.currentSessionPrNumber = meta.prNumber |
| 2963 | if (meta.prUrl) project.currentSessionPrUrl = meta.prUrl |
| 2964 | if (meta.prRepository) project.currentSessionPrRepository = meta.prRepository |
| 2965 | } |
| 2966 | |
| 2967 | /** |
| 2968 | * Clear all cached session metadata (title, tag, agent name/color). |
no test coverage detected