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,
)
| 277 | |
| 278 | |
| 279 | def _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 | |
| 319 | def _require_storage_for_empty_mode( |
no outgoing calls
searching dependent graphs…