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

Merged
WA
1mo ago
+3081-16

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)