@@ -289,6 +289,21 @@ public struct GraphcodeSettings: Codable, Equatable, Sendable {
289289 }
290290 public var claudePermissionMode : ClaudePermissionMode
291291 public var copilotPermissions : CopilotPermissions
292+ /// Empty leaves Copilot's version selection unchanged. Applies to future launches,
293+ /// including resumes, not to sessions already running.
294+ public var copilotPreferredVersion : String
295+
296+ public var normalizedCopilotPreferredVersion : String ? {
297+ let version = copilotPreferredVersion. trimmingCharacters ( in: . whitespacesAndNewlines)
298+ return version. isEmpty ? nil : version
299+ }
300+
301+ /// Installation remains an explicit action on the machine that runs Copilot.
302+ public var copilotInstallCommand : String ? {
303+ guard let version = normalizedCopilotPreferredVersion else { return nil }
304+ return " npm install -g " + PresenceHooks. singleQuoted ( " @github/copilot@ \( version) " )
305+ }
306+
292307 /// Whether a session is told it's part of a graph and how to add loops to it
293308 /// (`SessionBriefing`). Off means loops behave exactly as they did before briefings
294309 /// existed — they do the work they were given and never create anything.
@@ -441,6 +456,7 @@ public struct GraphcodeSettings: Codable, Equatable, Sendable {
441456 piProjectTrust: PiProjectTrust = . approve,
442457 claudePermissionMode: ClaudePermissionMode = . auto,
443458 copilotPermissions: CopilotPermissions = . allowEverything,
459+ copilotPreferredVersion: String = " " ,
444460 briefsSessionsAboutTheGraph: Bool = true ,
445461 autoSelectsModel: Bool = false ,
446462 showsActivityStrip: Bool = false ,
@@ -460,6 +476,7 @@ public struct GraphcodeSettings: Codable, Equatable, Sendable {
460476 self . piProjectTrust = piProjectTrust
461477 self . claudePermissionMode = claudePermissionMode
462478 self . copilotPermissions = copilotPermissions
479+ self . copilotPreferredVersion = copilotPreferredVersion
463480 self . briefsSessionsAboutTheGraph = briefsSessionsAboutTheGraph
464481 self . autoSelectsModel = autoSelectsModel
465482 self . showsActivityStrip = showsActivityStrip
@@ -494,6 +511,8 @@ public struct GraphcodeSettings: Codable, Equatable, Sendable {
494511 copilotPermissions =
495512 try container. decodeIfPresent ( CopilotPermissions . self, forKey: . copilotPermissions)
496513 ?? . allowEverything
514+ copilotPreferredVersion =
515+ try container. decodeIfPresent ( String . self, forKey: . copilotPreferredVersion) ?? " "
497516 briefsSessionsAboutTheGraph =
498517 try container. decodeIfPresent ( Bool . self, forKey: . briefsSessionsAboutTheGraph) ?? true
499518 endsResolvedSessionsAfterMinutes =
0 commit comments