MCPcopy Index your code
hub / github.com/github/copilot-sdk / _post_create_options_patch

Function _post_create_options_patch

python/copilot/_mode.py:279–316  ·  view source on GitHub ↗

Build the patch sent via ``session.options.update`` after create/resume. In empty mode the four overridable flags default to safe values (caller-supplied values win); ``installedPlugins=[]`` is unconditional. Returns ``None`` if no patch should be sent.

(
    mode: CopilotClientMode | None,
    skip_custom_instructions: bool | None,
    custom_agents_local_only: bool | None,
    coauthor_enabled: bool | None,
    manage_schedule_enabled: bool | None,
)

Source from the content-addressed store, hash-verified

277
278
279def _post_create_options_patch(
280 mode: CopilotClientMode | None,
281 skip_custom_instructions: bool | None,
282 custom_agents_local_only: bool | None,
283 coauthor_enabled: bool | None,
284 manage_schedule_enabled: bool | None,
285) -> dict[str, Any] | None:
286 """Build the patch sent via ``session.options.update`` after create/resume.
287
288 In empty mode the four overridable flags default to safe values
289 (caller-supplied values win); ``installedPlugins=[]`` is unconditional.
290 Returns ``None`` if no patch should be sent.
291 """
292 if mode == "empty":
293 patch: dict[str, Any] = {
294 "skipCustomInstructions": (
295 skip_custom_instructions if skip_custom_instructions is not None else True
296 ),
297 "customAgentsLocalOnly": (
298 custom_agents_local_only if custom_agents_local_only is not None else True
299 ),
300 "coauthorEnabled": coauthor_enabled if coauthor_enabled is not None else False,
301 "manageScheduleEnabled": (
302 manage_schedule_enabled if manage_schedule_enabled is not None else False
303 ),
304 "installedPlugins": [],
305 }
306 return patch
307 patch = {}
308 if skip_custom_instructions is not None:
309 patch["skipCustomInstructions"] = skip_custom_instructions
310 if custom_agents_local_only is not None:
311 patch["customAgentsLocalOnly"] = custom_agents_local_only
312 if coauthor_enabled is not None:
313 patch["coauthorEnabled"] = coauthor_enabled
314 if manage_schedule_enabled is not None:
315 patch["manageScheduleEnabled"] = manage_schedule_enabled
316 return patch or None
317
318
319def _require_storage_for_empty_mode(

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…