Commit 04b27f7
Instrument databricks auth for UCODE_DEBUG diagnostics (#80)
* Instrument databricks auth for UCODE_DEBUG diagnostics
Adds opt-in debug logging to diagnose cases where `databricks auth token`
returns no token even though the CLI itself is authenticated. When
`UCODE_DEBUG=1`, `has_valid_databricks_auth` and `get_databricks_token`
now dump (once per process) the CLI version, the scrubbed profiles list,
the scrubbed `~/.databrickscfg`, and the set of `DATABRICKS_*` env vars
visible to the subprocess, plus the rc/stderr of each `auth token` call.
A `_format_subprocess_result` helper suppresses stdout on success so the
access token never lands in `~/.ucode/debug.log`.
Also removes the dead `databricks auth login --no-browser` retry block
in `get_databricks_token`: with `capture_output=True` the device-code URL
is never visible to the user, so the retry can never complete a fresh
auth — it only obscures the original failure.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Restore get_databricks_token retry and add debug coverage for reauth path
The previous commit removed the silent re-auth retry on the grounds that
--no-browser can never complete a fresh auth. That's true, but the retry
also handles OAuth token refresh for sessions that just need a silent
refresh — which the e2e TestGeminiAuthRecovery test exercises.
Restores the _fetch / auth login --no-browser / _fetch retry loop, adds
debug logging around the reauth attempt (triggered/rc/stderr), and
restores the unit test that covers the retry path.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Update uv.lock registry source to pypi-proxy.cloud.databricks.com
Reflects the current internal PyPI proxy (go/pypi-registry-access).
Download URLs remain files.pythonhosted.org so external users are unaffected.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9822e10 commit 04b27f7
3 files changed
Lines changed: 269 additions & 45 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
91 | 192 | | |
92 | 193 | | |
93 | 194 | | |
| |||
230 | 331 | | |
231 | 332 | | |
232 | 333 | | |
| 334 | + | |
233 | 335 | | |
234 | 336 | | |
235 | 337 | | |
| |||
240 | 342 | | |
241 | 343 | | |
242 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
243 | 349 | | |
244 | 350 | | |
245 | 351 | | |
246 | 352 | | |
247 | | - | |
| 353 | + | |
| 354 | + | |
248 | 355 | | |
249 | 356 | | |
250 | 357 | | |
| |||
312 | 419 | | |
313 | 420 | | |
314 | 421 | | |
| 422 | + | |
315 | 423 | | |
316 | 424 | | |
317 | 425 | | |
318 | 426 | | |
319 | 427 | | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
320 | 438 | | |
321 | 439 | | |
322 | 440 | | |
323 | 441 | | |
| 442 | + | |
324 | 443 | | |
325 | 444 | | |
326 | 445 | | |
327 | 446 | | |
328 | 447 | | |
329 | | - | |
330 | | - | |
331 | | - | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
332 | 454 | | |
333 | 455 | | |
334 | 456 | | |
335 | 457 | | |
| 458 | + | |
336 | 459 | | |
337 | | - | |
| 460 | + | |
338 | 461 | | |
339 | 462 | | |
| 463 | + | |
340 | 464 | | |
341 | 465 | | |
342 | 466 | | |
343 | | - | |
344 | | - | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
345 | 470 | | |
346 | 471 | | |
347 | 472 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
146 | 149 | | |
147 | 150 | | |
148 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
149 | 248 | | |
150 | 249 | | |
151 | 250 | | |
| |||
0 commit comments