Repository navigation
Conversation
UG review recommendationRECOMMENDATION: REJECT (request changes) Reasons:
Findings considered: 6 (severities: low: 2, medium: 4); see the inline review comments. Advisory only: this recommendation never approves or merges the pull request. The |
Polly AI ReviewBlocking issues
Security vulnerabilitiesNo confirmed vulnerabilities found. Actual Copilot authentication, workspace-header transmission and gateway inference remain unverified. Non-blocking notes
ApproachNative registration plus a token-provider plugin avoids another proxy. Reuse SummaryDiff size (computed): 8 files; +1688 / -3 lines (1691 changed text lines); 0 binary files.
Shares use additions + deletions, including generated text and lockfiles. Binary files have no line count. Tests include fixtures/helpers under test paths and colocated test/spec files; categories are path-based, not coverage measurements. ChangesAdds local WebSocket registration, removal and status checks; a token-refresh plugin; shared app/plugin provider catalogs; and a reusable VS Code catalog entry point. The diff contains implementation, Python/Node tests and test fixtures. It changes no documentation, dependencies or generated files. Its breadth generally matches the registration and plugin boundaries. Reusing the existing authentication-command builders would reduce duplicated behavior and preserve supported authentication modes. TestsTest-by-test assessmentAssessment is static: tests, lint and typecheck were not run, and the reported passing results are unverified. All three changed test files are new; no existing tests were removed or weakened. Existing CLI coverage establishes support for Claude-backed services with opaque names, but does not protect this new builder. Existing VS Code and CLI tests likewise do not establish desktop SDK compatibility. The fake WebSocket server checks transport messages and resulting registration state, not the real app’s protocol, native model picker or completed inference. Usage attribution and telemetry delivery remain unverified.
Missing API evidence should be covered at the smallest independently runnable SDK component boundary: assert outgoing URL, wire model, authentication and routing headers, then response status and completed payload/events. Registration-state assertions alone cannot establish that contract. After normal authorization, run ScopeAll changed files support the stated desktop registration and plugin outcome, including the stacked parent plugin changes. No clearly unrelated changes were found. Keeping configure, revert and CLI-status wiring out of this PR matches its stated scope; it does not resolve the catalog-loss or false-status bugs above. Automated review by Polly · workflow run |
a311d55 to
3bc8507
Compare
c01c4af to
aa17b6f
Compare
An unwired module that writes a ug-owned local plugin marketplace and turns it on in Copilot's settings.json. The plugin's extension registers ug's provider and model ids and serves them straight from the AI Gateway, minting a token with `ug auth-token` per request (cached until shortly before expiry). Co-authored-by: Isaac <no-reply@databricks.com>
The session uses the extension's model rows instead of the app's, so they repeat the rows' token limits and, for Claude, vision support. Co-authored-by: Isaac <no-reply@databricks.com>
… token remove() now drops the settings keys, waits for the app to unload the extension, then deletes the directory; deleting it first left running extensions serving open chats. The extension drops its cached token when a model call fails with a 401 and mints the next one with --force-refresh (untested live). Co-authored-by: Isaac <no-reply@databricks.com>
The extension now registers ug's providers and model rows over the app's local WebSocket API when it starts, from rows in its config, and deletes ug's providers and rows that the config no longer has. It syncs only when the rows or the app's launch token changed, one extension process at a time, and logs a failure without affecting the models it serves. Model rows also turn off reasoning_effort where asked (Chat Completions models), and never advertise an output limit below the 32K the runtime asks for. The Databricks CLI's directory goes on the token command's PATH. Co-authored-by: Isaac <no-reply@databricks.com>
- The token command comes from ug's own builders, so a PAT or custom OAuth setup keeps its mode: `ug auth-token --host` ignores the saved choices. The sign-in hint follows the mode. - A failed token command shows a hint only for an auth failure, or says ug wasn't found; a hint the session couldn't show yet doesn't count as shown. A 401 also logs the sign-in hint, since the app's own message names Copilot's API-key settings. - A mint running when the token is invalidated no longer caches its token. - remove() leaves a unity-gateway marketplace that points elsewhere. - settings.json: a symlink is refused, and rewrites keep the file's mode. - The row-sync node tests skip on a Node without a global WebSocket. Co-authored-by: Isaac <no-reply@databricks.com>
Desktop-app adapters live in agents/desktop/. The wheel keeps shipping the extension's .mjs files, since hatch includes every file in the package. Co-authored-by: Isaac <no-reply@databricks.com>
With the GitHub Copilot app closed, ug can't delete its rows from the app's picker. defer_remove marks the plugin's config, and on the app's next start the extension deletes ug's providers over the app's local API, then removes ug's two settings.json keys under the same rules as the Python writer, and serves nothing. A lock keeps sessions from racing. cleanup_leftover deletes the directory on a later ug run once the keys are gone. Not yet checked against the live app. Co-authored-by: Isaac <no-reply@databricks.com>
…mpty install() records when Copilot's settings.json didn't exist before. remove(), and cleanup_leftover() after a deferred remove, delete the file only if ug created it and nothing is left in it; otherwise they keep it. Co-authored-by: Isaac <no-reply@databricks.com>
The app's window loads the model picker's providers only when it starts, about 7 s before the first extension runs, so rows the plugin has just created or changed show a generic icon and no Databricks label until the next launch. After a sync that changed ug's rows, one extension process claims a restart under the sync lock, keyed by a hash of the rows, so a relaunch, another chat or an unchanged configure never restarts again. It waits until no chat in the app is running a turn (the app's session event stream, else its own session, plus a quiet window), posts a line in the chat, and a detached helper closes the app without forcing it, waits for it to exit and starts it again with the user's session environment. When it can't (no display on Linux, the app stays up, three minutes without idle), it asks the user to restart instead. Co-authored-by: Isaac <no-reply@databricks.com>
The pytest wrappers ran them only where the unit-test runner happened to have Node, so they could skip. They now run in the VS Code extension job, which sets up Node 22 (with the global WebSocket the extension uses) and is part of the required test check. The pytest syntax checks and the Python-to-extension removal test still skip without Node. Co-authored-by: Isaac <no-reply@databricks.com>
…ateway The plugin is now unity-gateway in the databricks-unity-gateway marketplace, under plugins/unity-gateway. Configure moves an earlier build's unity-gateway marketplace and databricks@unity-gateway key to the new id when their source is ug's plugin directory, and deletes the old plugin copy; status counts either as installed, and removal (also the extension's deferred one) takes out both. A marketplace of either name at another path is still left alone. Co-authored-by: Isaac <no-reply@databricks.com>
…ests Like ug copilot, every model request from the GitHub Copilot app now carries session-id, so the gateway's usage table groups an app chat's turns. It's the session the extension process serves (SESSION_ID, which joinSession resumes), not a random id; an admin header of that name wins. Subagent requests get no thread-id: the SDK's provider headers are static and it has no per-request header hook. Co-authored-by: Isaac <no-reply@databricks.com>
aa17b6f to
ca12c6c
Compare
App 1.4.2 writes only the port to run/ws.port and its own pid to run/app-owner.pid, so the restart never found the app and only posted the hint. The pid now comes from app-owner.pid, with ws.port's second field as a fallback. The restart stays one attempt per change: a launch after a failed one already loads the rows' labels, so it needs no retry. Co-authored-by: Isaac <no-reply@databricks.com>
ca12c6c to
18c7403
Compare
The app stops the extension process a few seconds after the sync that changed its rows, so the idle wait and restart inside it never ran. The extension now starts the detached helper as soon as the sync returns (before the session is joined) and posts one line saying the app restarts once no chat is busy. The helper opens its own watch of the app's session events, waits for idle plus the quiet window, then restarts the app. Without the session events, or when the app closes while it waits, it gives up and leaves the app as it is. Co-authored-by: Isaac <no-reply@databricks.com>
18c7403 to
8c06e97
Compare
In the app, the extension's process.execPath is the Copilot runtime's own binary, which refuses to run a script, so the detached restart helper exited at once. The extension now passes the app's target to a detached `ug copilot-app-restart`, using the absolute ug path its config now carries; ug watches the app's session events, waits for idle and restarts the app. The JavaScript watch and restart code goes away. Co-authored-by: Isaac <no-reply@databricks.com>
8c06e97 to
4c8c88f
Compare
- install checks that extraKnownMarketplaces and enabledPlugins are JSON objects before it writes the plugin, so a refusal leaves no orphan plugin directory behind; - the token command's environment keeps Windows' Path casing instead of adding a second PATH key; - a token the CLI hands out within two minutes of its expiry is reused for 30 s rather than minted again for every request; - the sync lock names its owner, so a process whose lock was taken over as stale can't release the new owner's, and only one process can take a stale lock over; - the first sync (or deferred remove) retries three times with a backoff when the app hasn't published its endpoint yet. Co-authored-by: Isaac <no-reply@databricks.com>
4c8c88f to
8fb0469
Compare
- A deferred remove on an earlier build's install marks that build's extension, under its own plugin directory, so the next app start still deletes the rows and keys; a pending removal is found there too. - install leaves another marketplace of ug's name alone instead of pointing it at ug's plugin, and refuses before writing anything. - The extension catches a rejected session.log, so a hint the chat can't show no longer ends the extension. - Tests take the lock file name and staleness from app-rows.mjs, and the file-mode test skips on Windows, which has no POSIX modes. Co-authored-by: Isaac <no-reply@databricks.com>
8fb0469 to
ccb6930
Compare
write_plugin used to write the marketplace, manifests, extension files and config.json one by one in place, so an app reading the plugin during configure, or a failed copy during a reinstall, could see a half written plugin. It now writes the whole tree to a sibling staging directory, syncs the files, and swaps it in by renames: the old tree moves aside first, as Windows can't rename onto a directory, and comes back if the swap fails. The extension's sync stamp, restart marker and log, ug's created-settings marker and an earlier build's copy are carried over. Settings keys are merged only after the swap, and leftovers from a crashed run are removed after ten minutes. Co-authored-by: Isaac <no-reply@databricks.com>
…oval Before ug deletes its rows from a running app, it will mark the plugin for removal, the flag the deferred removal already uses. Under the sync lock, an extension now reads that flag from its config.json before the sync and before every write, and stops instead of writing ug's rows back. The plugin module also gets sync_lock(), which takes the extensions' lock file under the same protocol (an owner-named file, an atomic stale takeover), so ug can hold it while it unregisters. Co-authored-by: Isaac <no-reply@databricks.com>
An unwired module that adds ug's Claude, GPT and open-model providers and their models to the running GitHub Copilot app through its local WebSocket API, and deletes them again. One function builds both the app's provider and model rows and the Copilot plugin's providers from the model catalog VS Code uses, so their ids always match. The rows point at the AI Gateway; the plugin serves them with a fresh token. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
The plugin's extension now writes the providers and model rows to the app, so desired_providers() also returns them as the plugin's input, with every provider id ug owns, and register() is gone. unregister() and status() stay for revert and status. Chat Completions models turn off reasoning_effort. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
…atalog The app applies its own settings to a row whose id is a Copilot catalog model's, over the row's: a Kimi K3 row with id kimi-k3 got reasoning_effort high despite reasoningEffort false. GPT and open-model rows now use the gateway's full id, or databricks.<id> for a bare Model Provider Service target. Claude rows keep Copilot's catalog ids, which make the app apply Claude's request settings. Co-authored-by: Isaac <no-reply@databricks.com>
…nown version The app version only decides whether ug warns that it hasn't been verified, so an app that refuses get_healthcheck now gets that warning instead of failing unregister and status. Co-authored-by: Isaac <no-reply@databricks.com>
ccb6930 to
b079e4a
Compare
🥞 Stacked PR
Use this link to review incremental changes.
Summary
ucode.agents.desktop.copilot_app. Itsdesired_providers()builds, from one model catalog, both the GitHub Copilot app's provider and model rows and the plugin input of the parent PR, with identical provider ids, model ids and wire models:.plugin: the providers and models the extension serves, with the rows' names, token limits and vision, andreasoning_effortoff for Chat Completions models;.plugin_appplusOWNED_PROVIDER_IDS: the rows the extension writes to the app's model picker, and every provider id ug may have written there./ai-gateway/anthropic, and/ai-gateway/mlflow/v1, or/ai-gateway/openai/v1plus the routing header for a Model Provider Service), not at a local port.state_providers()feeds it the same catalog VS Code uses (nowvscode.copilot_models).~/.copilot/run/) givesunregister(), for revert, andstatus(). Replies are matched by their echoedrequest_id; an error without one answers the pending request (the app omits it on format errors). The app closing the connection counts as not running. Unverified app versions get a warning.databricks.<id>for a bare Model Provider Service target. That keeps them out of Copilot's catalog: the app applies its own settings to a catalog id over the row's (a Kimi K3 row with idkimi-k3gotreasoning_effort).ug configure,ug revertorug status.Review fixes: an app that refuses
get_healthcheckcounts as an unknown version, which only warns, instead of failing unregister and status.Test plan
uv run pytest tests/test_copilot_app.py tests/test_copilot_app_plugin.py tests/test_agent_vscode.py:just lint(ruff check, ruff format check, ty).This pull request and its description were written by Isaac.