Repository navigation
Conversation
Add resources.genie_agents for managing AI/BI Genie agents through the Genie Agents API. The engine tracks the bare genie_agent_id (optional on create, server-assigned when omitted; changing it recreates the agent). Updates are in place with update_mask "*"; definition is replaced as a whole. The resource is private preview, so no Python package is generated. It manages the same backend object as genie_spaces; declaring the same object under both resource types is unsupported. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
|
Commit: Regression test reportSelected 10 changed tests (limit=20, 0 not selected) 15 tests: regression=10 unreleased=0 coverage=5 failing=0
TestAccept/bundle/deployment/bind/genie_agent/DMS=: branch ✅ | main (9a9d739) ❌ | latest (v1.26.0) ❌main (9a9d739): latest (v1.26.0): same output as main (9a9d739) TestAccept/bundle/deployment/bind/genie_agent/DMS=true: branch ✅ | main (9a9d739) ❌ | latest (v1.26.0) ❌main (9a9d739): latest (v1.26.0): same output as main (9a9d739) TestAccept/bundle/invariant/no_drift/DMS=/INPUT_CONFIG=genie_agent.yml.tmpl/READPLAN=: branch ✅ | main (9a9d739) ❌ | latest (v1.26.0) ❌main (9a9d739): latest (v1.26.0): TestAccept/bundle/refschema/DMS=: branch ✅ | main (9a9d739) ❌ | latest (v1.26.0) ❌main (9a9d739): latest (v1.26.0): TestAccept/bundle/refschema/DMS=true: branch ✅ | main (9a9d739) ❌ | latest (v1.26.0) ❌main (9a9d739): latest (v1.26.0): TestAccept/bundle/resources/genie_agents/basic/DMS=: branch ✅ | main (9a9d739) ❌ | latest (v1.26.0) ❌main (9a9d739): latest (v1.26.0): same output as main (9a9d739) TestAccept/bundle/resources/genie_agents/lifecycle/DMS=: branch ✅ | main (9a9d739) ❌ | latest (v1.26.0) ❌main (9a9d739): latest (v1.26.0): TestAccept/bundle/resources/genie_agents/remote-delete/DMS=: branch ✅ | main (9a9d739) ❌ | latest (v1.26.0) ❌main (9a9d739): latest (v1.26.0): same output as main (9a9d739) TestAccept/bundle/resources/genie_agents/without-definition/DMS=: branch ✅ | main (9a9d739) ❌ | latest (v1.26.0) ❌main (9a9d739): latest (v1.26.0): same output as main (9a9d739) TestAccept/experimental/open: branch ✅ | main (9a9d739) ❌ | latest (v1.26.0) ❌main (9a9d739): latest (v1.26.0): same output as main (9a9d739) |
❌ Integration test reportCommit: fee4b38
12 interesting tests: 11 FAIL, 1 KNOWN
|
Sankalp-Mittal
left a comment
There was a problem hiding this comment.
🤖 AI review from review-factory: 2 independent reviewer models (Claude Opus 5.5, Claude Fable 5.2) with cross-verification. Only findings that reviewers agreed on are posted.
Adds a direct-engine genie_agents bundle resource with tests; reviewers flagged possible permanent drift from server-sorted lists and unvalidated real-workspace behavior.
Findings: 1 major, 1 minor, 1 nit.
| "display_name": "test_agent_[UNIQUE_NAME]", | ||
| "description": "Agent grounded in sales tables", | ||
| "warehouse_id": "[TEST_DEFAULT_WAREHOUSE_ID]", | ||
| "etag": "1" |
There was a problem hiding this comment.
major: No passing cloud run yet, and the lifecycle golden pins the fake server's etag
The adapter depends on real-API behavior that only the fake server has exercised so far, and the code comments describe that behavior as already confirmed by the cloud run:
DoCreaterelies on the Agents API reporting a missing parent folder in one of the two shapesisMissingGenieParentPathErrorrecognises. The defaultparent_pathisworkspace.resource_path, which does not exist on a first deploy, so if the shape differs every first deploy fails.DoUpdaterelies onupdate_mask: "*"semantics.responseToGenieAgentConfigcopiesparent_pathback verbatim. The siblinggenie_spacesresource (same backend object, per this PR) adds the/Workspaceprefix on read and in config because GET returns the path without it. If the Agents API does the same, every plan after deploy shows an update onparent_path.- The fake server hard-deletes on DELETE, while the real API moves the agent to trash. Whether a pinned
genie_agent_idcan be reused after destroy or an out-of-band delete is untested (remote-deleteis local only).
The PR description says the cloud lifecycle run is still pending, and the integration report on this head commit shows 11 failures in every environment (the report is truncated, so which tests failed is not visible).
Separately, the lifecycle test is Cloud = true but its golden contains "etag": "1" twice. That value is what the fake server assigns; a real etag will differ, so the cloud variant cannot match. The cloud-enabled genie_spaces tests leave etag out of their projection, and the cloud dashboard tests mask it as [ETAG].
Suggested changes:
- Drop
etagfromagent_fields(or add a Repl) so the golden is backend-independent. - Get a green cloud run of
resources/genie_agents/lifecycleand thegenie_agent.yml.tmplinvariants before merging, asbundle/direct/dresources/README.mdasks for new resource types. - Until then, reword the comments in
genie_agent.gothat say the cloud run confirms these behaviors.
Evidence: acceptance/bundle/resources/genie_agents/lifecycle/output.txt:14 and :36 contain "etag": "1"; acceptance/bundle/resources/genie_agents/script.prepare:3 projects etag; acceptance/bundle/resources/genie_agents/test.toml:2 sets Cloud = true and lifecycle/out.test.toml:1 confirms it; libs/testserver/genie_agents.go:63 sets agent.Etag = "1". bundle/direct/dresources/genie_agent.go:106-108 says the error shape "is confirmed by the lifecycle test's cloud run" and :135-136 says the lifecycle test "exercises this mask against a real workspace". bundle/direct/dresources/genie_agent.go:85 copies agent.ParentPath unchanged, while bundle/direct/dresources/genie_space.go:85 uses ensureWorkspacePrefix(space.ParentPath). libs/testserver/genie_agents.go:127 hard-deletes. acceptance/bundle/resources/genie_spaces/simple and the bind test project {title, parent_path, warehouse_id} without etag; acceptance/bundle/resources/dashboards/detect-change/output.txt:36 shows [ETAG_1]. bundle/direct/dresources/README.md Testing section: "For new resource types, run at least one test on a live cloud environment."
Agreed by 2 reviewer model(s).
| } | ||
| }' --genie-agent-id "$AGENT" | agent_fields | ||
|
|
||
| trace $CLI bundle deployment bind agent1 "$AGENT" --auto-approve |
There was a problem hiding this comment.
minor: Bind test never plans, deploys or destroys after binding
The script runs bind, summary, unbind, summary. It never checks that the first bundle plan after bind is clean, that bundle deploy then updates the bound agent in place rather than recreating it, or that bundle destroy after unbind leaves the agent alone. The genie_space bind test checks all of these (bind, plan, deploy, get, unbind, destroy, get again). bundle/direct/dresources/README.md describes bind tests as verifying "that binding an existing resource and then deploying/destroying works correctly".
This matters for agents in particular: genie_agent_id is a provided_id_fields entry (bundle/direct/dresources/configs/genie_agents.yml:5), so a local-vs-state difference on it plans a recreate (classifyIDField, bundle/direct/bundle_plan.go:718-722), and recreating an agent loses its conversation history. Bind also has resource-specific logic in bundle/direct/bind.go (it copies the etag for dashboards and genie_spaces and fills state from config). A regression in how bind seeds state for this resource would not be caught by the current test.
Please extend the script to cover bundle plan, bundle deploy, unbind, bundle destroy, and a final get-genie-agent.
Evidence: acceptance/bundle/deployment/bind/genie_agent/script:16-20 contains only bind, summary, unbind, summary. acceptance/bundle/deployment/bind/genie_space/script runs bundle plan, bundle deploy, genie get-space, unbind, bundle destroy --auto-approve and a final genie get-space.
Agreed by 2 reviewer model(s).
| Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed. | ||
| "parent_path": | ||
| "description": |- | ||
| Workspace folder in which to create the Genie Agent. If omitted, the caller's home folder is used. On update, setting it moves the agent and clearing it does not. |
There was a problem hiding this comment.
nit: parent_path description gives the API default, not the bundle default
The schema description, and the matching Go doc comment, say that when parent_path is omitted "the caller's home folder is used" and that clearing it on update does not move the agent. That is the raw API behavior.
In a bundle, an omitted parent_path defaults to ${workspace.resource_path}, so a bundle user never gets the home folder and can never send an empty value. Please describe the bundle behavior instead, since this text is what users see in the JSON schema.
Evidence: bundle/internal/schema/annotations.yml:1017 and bundle/config/resources/genie_agent.go:35-37 carry the home-folder wording, which is emitted into bundle/schema/jsonschema.json:1264. bundle/config/mutator/resourcemutator/resource_mutator.go:56 sets the default resources.genie_agents.*.parent_path to b.Config.Workspace.ResourcePath. acceptance/bundle/resources/genie_agents/basic/output.txt shows the pre-deploy summary with "parent_path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/resources" for a config that does not set it.
Agreed by 2 reviewer model(s).
Changes
Adds
resources.genie_agentsto bundles on the direct deployment engine, backed by the Genie Agents API (w.GenieAgentsin the Go SDK).genie_agent_id. It is optional on create (server-assigned when omitted); changing it recreates the agent.update_mask: "*";definitionis replaced as a whole.permissionsthrough the generic Permissions API (object typegenie)..nextchanges/bundles/genie_agents.md.Why
Genie agents can be managed through the API and Terraform but not through bundles. This lets users declare Genie agents next to the rest of their bundle resources.
genie_agentssits alongside the existinggenie_spacesresource and manages the same backend object. Declaring the same object under both resource types is unsupported.Tests
Acceptance tests against the test server:
resources/genie_agents/{basic,lifecycle,remote-delete,without-definition},deployment/bind/genie_agent, plus the invariant matrix entry and refschema output. Unit tests cover resource registration and state loading. Cloud integration tests (lifecycle) are pending maintainer approval.This pull request and its description were written by Isaac.