refactor(mason): keep custom Python tools code-first - #509
Merged
junchoi-db merged 2 commits intoSep 10, 2026
Merged
Conversation
junchoi-db
force-pushed
the
feat/code-first-tool-integrations
branch
from
September 2, 2026 19:06
67003a6 to
ec62704
Compare
junchoi-db
commented
Sep 2, 2026
junchoi-db
commented
Sep 2, 2026
junchoi-db
commented
Sep 2, 2026
junchoi-db
commented
Sep 2, 2026
junchoi-db
commented
Sep 2, 2026
junchoi-db
commented
Sep 2, 2026
junchoi-db
force-pushed
the
feat/code-first-tool-integrations
branch
from
September 8, 2026 20:33
5fdb7d4 to
d18bd89
Compare
junchoi-db
marked this pull request as draft
September 8, 2026 20:33
junchoi-db
marked this pull request as ready for review
September 8, 2026 21:17
elainewang-db
approved these changes
Sep 9, 2026
junchoi-db
force-pushed
the
feat/code-first-tool-integrations
branch
from
September 9, 2026 19:34
d18bd89 to
aa0acd1
Compare
sirui-sun
added a commit
to sirui-sun/databricks-ai-bridge
that referenced
this pull request
Sep 15, 2026
Rebasing onto main pulled in databricks#509 (custom Python tools are code-first), which removed the `mason tools add python` CLI command. Upstream's guard `assert "python" not in output.lower()` collides with this PR's use of the real `system.ai.python_exec` MCP service as the add-mcp example. Refine the guard to check the removed command isn't advertised (no `mason tools add python` invocation, no `python` row in the add-group command list) rather than a bare "python" substring, so the legitimate `python_exec` example is still allowed while upstream's intent is preserved. Co-authored-by: Isaac <no-reply@databricks.com>
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.
What
agent.tomlas the declarative source of truth for Databricks-managed infrastructure: sandbox, managed MCP, Unity Catalog functions, memory, session, and durability bindings.mason tools add pythonor records Python entrypoints inagent.toml.agent.tomlbindings through the existing LangGraph and OpenAI adapters.CUJ
LangGraph tools use
@tool; OpenAI Agents tools use@function_tool. Both Mason templates auto-discover decorated modules underagent/tools/, so there is no second registration step.mason tools listintentionally reports only managed bindings fromagent.toml.An older manifest row such as
source = { kind = "python", ... }now fails with guidance to remove the row; the decorated source file remains active.Architecture boundary
This PR deliberately has no generated
agent/databricks_tools.py, integration registry, AST rewriting, or runtime attachment layer. The existing framework adapters readagent.tomldirectly.Verification
Local verification on the rebased branch:
ruff check: passed.ruff format --check: passed.ty checkwith bothruntimeandruntime-openaiextras: passed.Live df1 E2E at
d18bd893:agent.toml× localmason devvs managedmason deploy× sandbox, MCP, custom Python, and UC function.agent/tools/.MASON_SANDBOX_OK, a realsystem.ai.web_searchHTTPS result,MASON_PYTHON_OK, andMASON_UC_OK:matrix.Shareable Alternative 2 CUJ and E2E report
The live deployment matrix uses LangGraph. OpenAI and durable-LangGraph auto-discovery are covered by the local template/runtime tests above.
This pull request and its description were written by Isaac.