Commit c252a04
Phase B: RuntimeConnection discriminated config + CopilotClientOptions
Mirrors PR #1343 Phase 9 (.NET) and PR #1357 Phase I (TypeScript). Removes
the flat `SubprocessConfig` / `ExternalServerConfig` split in favour of a
`RuntimeConnection` discriminated hierarchy, with process-management
options moved to a new `CopilotClientOptions` dataclass.
Public API:
* `RuntimeConnection` abstract base with static factories `stdio()`,
`tcp()`, `uri()`.
* `ChildProcessRuntimeConnection` intermediate base carrying `path` and
`args` shared by Stdio + Tcp.
* `StdioRuntimeConnection`, `TcpRuntimeConnection`, `UriRuntimeConnection`
concrete subclasses; pattern-match / `isinstance` on the class to
branch on the transport.
* `CopilotClientOptions(connection=..., working_directory=..., log_level=...,
env=..., github_token=..., base_directory=..., use_logged_in_user=...,
telemetry=..., session_fs=..., session_idle_timeout_seconds=...,
enable_remote_sessions=...)`.
* `CopilotClient(options=CopilotClientOptions(...) | None, *, auto_start=...,
on_list_models=...)`.
Renames:
* `copilot_home` → `base_directory`
* `remote` → `enable_remote_sessions`
* `CopilotClient.actual_port` → `CopilotClient.runtime_port`
* `CopilotClient.on(...)` → `CopilotClient.on_lifecycle(...)`
* `tcp_connection_token` moves off `CopilotClientOptions` and onto
the variant: `TcpRuntimeConnection.connection_token` /
`UriRuntimeConnection.connection_token`
* `use_stdio` bool is gone — the variant class IS the discriminator.
Migration:
* All hand-written code that previously branched on `isinstance(config,
ExternalServerConfig)` now branches on the runtime-connection variant
via `isinstance(connection, UriRuntimeConnection)` /
`StdioRuntimeConnection` etc., giving proper type narrowing in
pyright/mypy without relying on Literal-based tagged-union narrowing.
* Samples, scenarios, README, and tests updated in lock-step.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 56c52a3 commit c252a04
61 files changed
Lines changed: 1875 additions & 1520 deletions
File tree
- python
- copilot
- generated
- e2e
- testharness
- test/scenarios
- auth
- byok-anthropic/python
- byok-azure/python
- byok-ollama/python
- byok-openai/python
- gh-app/python
- bundling
- app-backend-to-server/python
- app-direct-server/python
- container-proxy
- python
- fully-bundled/python
- callbacks
- hooks/python
- permissions/python
- user-input/python
- modes
- default/python
- minimal/python
- prompts
- attachments/python
- reasoning-effort/python
- system-message/python
- sessions
- concurrent-sessions/python
- infinite-sessions/python
- session-resume/python
- streaming/python
- tools
- custom-agents/python
- mcp-servers/python
- no-tools/python
- skills/python
- tool-filtering/python
- tool-overrides/python
- virtual-filesystem/python
- transport
- reconnect/python
- stdio/python
- tcp/python
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
140 | 142 | | |
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
146 | | - | |
| 148 | + | |
147 | 149 | | |
148 | | - | |
| 150 | + | |
149 | 151 | | |
150 | 152 | | |
151 | 153 | | |
152 | 154 | | |
153 | | - | |
| 155 | + | |
154 | 156 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
162 | 163 | | |
163 | | - | |
| 164 | + | |
164 | 165 | | |
165 | 166 | | |
| 167 | + | |
166 | 168 | | |
167 | | - | |
| 169 | + | |
168 | 170 | | |
169 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
170 | 174 | | |
171 | 175 | | |
172 | 176 | | |
| |||
197 | 201 | | |
198 | 202 | | |
199 | 203 | | |
200 | | - | |
| 204 | + | |
201 | 205 | | |
202 | 206 | | |
203 | | - | |
| 207 | + | |
204 | 208 | | |
205 | 209 | | |
206 | 210 | | |
| |||
531 | 535 | | |
532 | 536 | | |
533 | 537 | | |
534 | | - | |
| 538 | + | |
535 | 539 | | |
536 | | - | |
| 540 | + | |
537 | 541 | | |
538 | 542 | | |
539 | 543 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
| |||
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
| 69 | + | |
65 | 70 | | |
66 | 71 | | |
67 | 72 | | |
68 | 73 | | |
| 74 | + | |
69 | 75 | | |
70 | 76 | | |
71 | 77 | | |
| |||
75 | 81 | | |
76 | 82 | | |
77 | 83 | | |
78 | | - | |
79 | 84 | | |
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
| 91 | + | |
86 | 92 | | |
87 | 93 | | |
88 | 94 | | |
| |||
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
96 | | - | |
| 102 | + | |
| 103 | + | |
97 | 104 | | |
98 | 105 | | |
99 | 106 | | |
100 | 107 | | |
| 108 | + | |
101 | 109 | | |
102 | 110 | | |
103 | 111 | | |
0 commit comments