Skip to content

feat(mason): add code-first Python tools - #491

Open
junchoi-db wants to merge 1 commit into
databricks:mainfrom
junchoi-db:research/custom-tool-code-first
Open

feat(mason): add code-first Python tools#491
junchoi-db wants to merge 1 commit into
databricks:mainfrom
junchoi-db:research/custom-tool-code-first

Conversation

@junchoi-db

@junchoi-db junchoi-db commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

What

https://metric-reports-viewer-6051921418418893.staging.aws.databricksapps.com/20260829_mason-code-first-custom-tool-df1-e2e.html
Screenshot 2026-08-30 at 6 00 45 PM

  • replaces Python tool scaffolding with code-first, framework-native @tool authoring
  • makes exact agent.toml entrypoints the only activation source
  • adds mason tools check/run, non-blocking MASON001 undeclared-tool warnings, and dev/deploy preflight validation
  • extends the E2E matrix to prove warning, error, direct-run, local-dev, deployed execution, and cleanup behavior

Why

Writing customer code and also running a CLI generator duplicated ownership. This flow keeps behavior and schema in typed Python, exposure in agent.toml, and uses the CLI for validation, execution, development, and deployment.

Design doc

Proof of work

  • df1 validation/dev/deploy E2E: 16/16 semantic rows passed, covering CLI and direct-agent.toml authoring across mason dev and deployed Apps for sandbox, managed MCP, the custom Python tool, and a UC function
  • Validation probes: 4/4 passed — non-blocking MASON001, broken-entrypoint rejection, valid contract check, and direct custom-tool run
  • Custom Python tool: MASON_PYTHON_OK through both dev lanes and both deployed App lanes
  • Cleanup: 3/3 passed; both Apps were subsequently observed absent and the UC function was absent from information_schema.routines
  • Metric report
  • Dogfood Volume path: dbfs:/Volumes/jun_choi_test/reports/metric_reports/20260829_mason-code-first-custom-tool-df1-e2e.html
  • Published HTML round-trip: byte-identical SHA-256 2a374ea79789365f2a6d75d69344ab9740ba28d6f45b13a456120b0de09f8a9e

Testing

  • Mason unit tests: 228 passed; JUnit reports errors=0 failures=0 skipped=0 tests=228
  • Ruff check and format: passed
  • Ty: passed
  • Packaged/generated runtime copies: byte-identical
  • Wheel build: passed (sha256 7351535f35e6dd6d35c8c1627ab507a06dd1433ce79ec9c400ff90dfaba0e0de)
  • Generated template: 19 passed across all tests runnable in this environment
  • Environment limitation: five unchanged thread-bridge tests cannot execute because a minimal asyncio.to_thread(lambda: 1) hangs in both project virtual environments; plain threads and plain asyncio both pass
  • GitHub Actions: 49/50 checks pass, including both Mason test jobs, Mason Ruff, Mason formatting, and Mason typechecking. The sole OpenAI typecheck failure is baseline: the exact CI command on base SHA bffee76 produces the same eight httpx/httpx2 errors and two warnings.

This pull request and its description were written by Isaac.

Comment thread integrations/mason/src/databricks_mason/deploy.py
Comment thread integrations/mason/src/databricks_mason/init.py
@junchoi-db
junchoi-db marked this pull request as ready for review August 31, 2026 00:30
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