add managed CodingAgentConfig read client, normalize, and local persist - #262
Open
asujithan wants to merge 4 commits into
Open
add managed CodingAgentConfig read client, normalize, and local persist#262asujithan wants to merge 4 commits into
asujithan wants to merge 4 commits into
Conversation
Comment on lines
+234
to
+237
| Returns ``(config, reason)``: | ||
| - ``(config, None)`` — the normalized manifest for the workspace's single config; | ||
| - ``(None, None)`` — no managed config is defined for the workspace (not an error); | ||
| - ``(None, reason)`` — the read failed; ``reason`` says why. |
Collaborator
There was a problem hiding this comment.
I think if no config exists it will throw NOT_FOUND error? https://sourcegraph.prod.databricks-corp.com/databricks-eng/universe/-/blob/ai-gateway-api/dbv2/main/CodingAgentConfigEntityStore.scala?L118-131 - we should catch that
AarushiShah-db
approved these changes
Aug 4, 2026
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.
Changes
Developer-read side of [Coding Gateway Configuration Management]). Adds the data layer that lets a developer's ucode pull the org admin's CodingAgentConfig and stores it locally to ~/.ucode/managed-state.json, so later PRs can reconcile it against local state and apply it to agents.
This PR is the foundation only — no CLI wiring or agent application yet (those are follow-up PRs). Nothing here runs during a real
ucode/ucode configurecommand; it's exercised by tests.Changes
databricks.py:fetch_managed_coding_agent_configs(workspace, token)— reads the workspace's config via the non-admin List endpoint (GET /api/ai-gateway/v2/coding-agent-configs), returning raw manifest dicts or an actionable reason. Workspace is resolved server-side, so no id is needed.managed_config.py(new):normalize_managed_config— proto-JSON → ucode-native shape (mapsCODING_AGENT_*/MCP_SERVER_TYPE_*enums to ucode tool/type names; drops agents/types this build doesn't recognize).get_managed_config— fetch + normalize, with a 3-way return (config / no-config / error).save/load/delete_managed_state— persist to~/.ucode/managed-state.json(0600; load is workspace-scoped so a stale file is ignored).Test Plan
Not in this PR (follow-ups )
ucode configuregating + bare-ucodePath A wiring.managed-state.json(0600 is an interim best-effort; real enforcement needs a privileged path + elevation and is its own change).