(dst, src *Session, title string)
| 172 | } |
| 173 | |
| 174 | func copySessionMetadata(dst, src *Session, title string) { |
| 175 | if src == nil || dst == nil { |
| 176 | return |
| 177 | } |
| 178 | dst.Title = title |
| 179 | dst.ToolsApproved = src.ToolsApproved |
| 180 | dst.HideToolResults = src.HideToolResults |
| 181 | dst.WorkingDir = src.WorkingDir |
| 182 | dst.SendUserMessage = src.SendUserMessage |
| 183 | dst.MaxIterations = src.MaxIterations |
| 184 | // MaxConsecutiveToolCalls and MaxOldToolCallTokens are safety / context |
| 185 | // rails that may be configured deliberately by the user or operator |
| 186 | // (consecutive-tool-call cutoff, old-tool-call truncation budget). |
| 187 | // Dropping them on a fork or branch would silently make the new |
| 188 | // session behave differently from its parent. Clone() preserves both, |
| 189 | // so do the same here. |
| 190 | dst.MaxConsecutiveToolCalls = src.MaxConsecutiveToolCalls |
| 191 | dst.MaxOldToolCallTokens = src.MaxOldToolCallTokens |
| 192 | dst.Starred = src.Starred |
| 193 | dst.Permissions = clonePermissionsConfig(src.Permissions) |
| 194 | dst.AgentModelOverrides = cloneStringMap(src.AgentModelOverrides) |
| 195 | dst.CustomModelsUsed = cloneStringSlice(src.CustomModelsUsed) |
| 196 | dst.AttachedFiles = src.AttachedFilesSnapshot() |
| 197 | } |
| 198 | |
| 199 | // generateBranchTitle creates a title for a branched session based on the parent title. |
| 200 | // If the parent has no title, returns empty string (will trigger auto-generation). |
no test coverage detected