Repository navigation
Conversation
Copilot CLI holds its provider credential for the whole session, so the
Databricks token ug passed at launch expired mid-session (the 30-minute
refresher only rewrote ~/.copilot/ucode.env, which Copilot never reads).
The token was also persisted in that file and its backup, and `ug revert`
restored it.
`ug copilot` now starts a per-session proxy on 127.0.0.1. Copilot gets the
proxy URL and a random session secret; the proxy accepts the secret only on
gateway model routes (/ai-gateway/{anthropic,mlflow/v1,openai/v1}/), swaps
it for a fresh Databricks token (CLI profile or custom OAuth), and adds the
ucode/copilot User-Agent, request tags and managed http_headers. A rejected
token is refreshed and the request retried; when refresh itself fails the
proxy answers with a "Databricks sign-in expired" error in the request's
dialect and logs to ~/.ucode/logs/copilot-proxy.log instead of the TUI.
- Configure and launch write no credential; earlier tokens are scrubbed
from ucode.env, a token-bearing backup is dropped (also before revert),
and ug no longer backs up its own file on reconfigure.
- The refresher thread is gone, so a running session no longer resets
current_workspace or rewrites state.
- Ctrl-C no longer re-signals Copilot (send_signal(SIGINT) raised on
Windows); ug waits for Copilot to exit and then stops the proxy.
- Inherited COPILOT_PROVIDER_API_KEY(_COMMAND) / _TRANSPORT are dropped so
they can't bypass the proxy.
Tests: hermetic socket tests for the proxy (secret, path allowlist incl.
encoded traversal, header swap, refresh-and-retry, actionable 401), Copilot
unit tests, the Copilot e2e now runs through the proxy, and a new
non-blocking Copilot integration lane (Linux + Windows) with Claude and GPT
headless journeys that also assert no credential on disk.
Co-authored-by: Isaac <no-reply@databricks.com>
…fused connect Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
… revert Co-authored-by: Isaac <no-reply@databricks.com>
…oken Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
….json Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
This was referenced Oct 21, 2026
Collaborator
Author
|
Closing: Copilot's model entries have no description field, so a readable name would replace the model id instead of sitting next to it. Keeping raw ids, as Codex does. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🥞 Stacked PR
Use this link to review incremental changes.
What did you change, and why?
Change: the Copilot session registry names each model with the same readable label Claude Code's picker uses (for example "GPT 5.4 Nano" or "Claude Sonnet 4.5") instead of the raw
system.ai.*id, so/modeland Copilot's footer are readable.model_display_labelmoves fromagents/claude.py(_picker_label) todatabricks.pyso Claude and Copilot share it; Claude's picker output is unchanged.render_providers_configsets each model'snamefrom it;idandwireModelstay the routable id, so--modeland/model <id>are unaffected.How is this tested?
tests/test_agent_copilot.py: registry entries carry the readable name./model dbx-responses/system.ai.gpt-5-4-nano.Stacked on #1218.
This pull request and its description were written by Isaac.