Skip to content

feat(databricks): add Genie agent operations to the Databricks block - #8343

Merged
waleedlatif1 merged 2 commits into
stagingfrom
feat/databricks-genie
Sep 26, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
feat/databricks-genie

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Add 14 Genie operations to the Databricks block. They use the existing workspace host and PAT, so no new credential.
  • Ask Genie starts a conversation, or continues one when given a conversationId. It polls until Genie reaches a terminal state and fetches the result rows. It returns the answer, clarifying question, SQL, query description, thoughts, suggested questions, visualizations and rows.
  • The TEXT_ATTACHMENT_PURPOSE_ANSWER text is used as the answer; a FOLLOW_UP_QUESTION text is surfaced separately.
  • Chat mode also covers:
    • get and list messages
    • get and re-execute a query result
    • download a visualization as a PNG file (binary download)
    • send feedback
    • delete a message
    • list and delete conversations (list includes agentType)
  • Spaces: list spaces and get a space, with the optional serialized config.
  • Agent mode (preview): Ask Genie Agent reads the SSE stream from /genie/agents/{id}/responses and returns the final report, the SQL it ran, and every output item. List items pages through the conversation history.
  • The question text is declared as model input (request.modelInput), because Genie sends it to an LLM.
  • Reads retry on 429/5xx, since Genie enforces throughput limits.
  • Path IDs go through safeUrlPathSegment.
  • Three Slack-orchestration templates (thread-scoped analyst, space router, KPI digest) and two skills.
  • Not included:
    • space create/update/trash
    • eval runs
    • comments
    • full-result downloads
    • deprecated query endpoints
    • agent-mode cancel, which needs the in-flight response ID that a blocking call never exposes

Type of Change

  • New feature

Testing

  • Checked every request and response field against the Databricks Genie API reference and the generated Python SDK. An independent audit pass also checked them against the docs.
  • Ran the tools against the documented example payloads: start conversation, the message variants, query results, the SSE stream (spec framing and the docs' own framing), system-error and failed responses, and list items. Also ran the Ask polling loop end to end with mocked nested tools.
  • bun run lint, type-check, check-block-registry, check:audits (51/51), docs-manifest:check, canvas sentences 26/26, and the blocks/tools vitest suites (131 passing).
  • Not run against a live Databricks workspace.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Sep 26, 2026 9:40pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Adds Genie agent operations to the Databricks integration.

The PR appears safe to merge based on the reviewed changes and the resolved prior findings.

Summary

The PR adds Databricks Genie chat and agent operations, registers them with the Databricks block, and documents their inputs and outputs. Since the previous review, it also handles thrown polling errors, moves shared output schemas, and corrects the Genie documentation tables.

  • The previously reported polling failure is fixed.
  • The previously reported documentation mismatch is fixed.
  • The testing request was withdrawn in its existing thread.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Databricks block] --> B[Genie chat tools]
  A --> C[Genie agent tools]
  B --> D[Poll message]
  D --> E[Fetch query rows]
  C --> F[Read final response stream]
Loading

Reviews (2) · Last reviewed commit: "fix(databricks): fail Genie asks on nest..."

Comment thread apps/sim/tools/databricks/genie_ask.ts Outdated
Comment thread apps/docs/content/docs/integrations/databricks.mdx Outdated
Comment thread apps/sim/tools/databricks/genie_ask.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 24 files

Confidence score: 4/5

  • In apps/sim/tools/databricks/genie_list_spaces.ts, parsing the response before checking response.ok can hide an empty or non-JSON gateway failure behind a JSON parse error; check response.ok first and use readDatabricksError to report the failure.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/tools/databricks/genie_list_spaces.ts">

<violation number="1" location="apps/sim/tools/databricks/genie_list_spaces.ts:57">
P2: This parses the response as JSON before checking `response.ok`, so an empty or non-JSON gateway error hides the actual failure behind a JSON parse exception. Check `response.ok` first and use `readDatabricksError` for failed responses, as the other Databricks mutation tools do.</violation>
</file>

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread apps/sim/tools/databricks/genie_list_messages.ts Outdated
Comment thread apps/sim/tools/databricks/genie_list_messages.ts
Comment thread apps/sim/tools/databricks/genie_ask.ts
Comment thread apps/sim/tools/databricks/genie_get_message.ts
Comment thread apps/sim/tools/databricks/genie_list_conversations.ts Outdated
Comment thread apps/sim/tools/databricks/genie_agent_ask.ts
Comment thread apps/sim/tools/databricks/genie_download_visualization.ts
Comment thread apps/sim/tools/databricks/utils.ts Outdated
Comment thread apps/sim/tools/databricks/genie_list_spaces.ts
Comment thread apps/sim/tools/databricks/genie_ask.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 24 files

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/tools/databricks/utils.ts
Comment thread apps/sim/tools/databricks/utils.ts
@waleedlatif1
waleedlatif1 merged commit c2cce49 into staging Sep 26, 2026
32 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/databricks-genie branch September 26, 2026 21:55

This branch was successfully deployed

1 active deployment
Preview — efcd0a8d Deployed Sep 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant