Skip to content

[mason] deploy/dev read agent.toml store bindings - #540

Merged
elainewang-db merged 4 commits into
databricks:mainfrom
elainemwang:mason-deploy-reads-bindings
Sep 4, 2026
Merged

[mason] deploy/dev read agent.toml store bindings#540
elainewang-db merged 4 commits into
databricks:mainfrom
elainemwang:mason-deploy-reads-bindings

Conversation

@elainewang-db

@elainewang-db elainewang-db commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What

Make agent.toml the single source of truth for an agent's memory and session stores, end to end.

  • Stores are declared only via mason memory bind / mason sessions bind. Binding creates the store (idempotent) and records it in agent.toml — memory also records the store id, which the entries API is keyed by.
  • The runtime resolves stores straight from agent.toml (resolve_memory_store / resolve_session_store); precedence is explicit arg → AGENT_*_STORE env → agent.toml binding.
  • mason deploy / mason dev drop the --memory/-m and --session/-s flags.
  • Stores are no longer written into app.yaml env — the runtime reads agent.toml at request time, so there's nothing to sync.
  • mason deploy / mason dev now only validate the bound stores exist (erroring toward bind if not) and, for deploy, grant the app's service principal access. Store creation lives in bind alone; --no-create-stores is removed from deploy/dev (it stays on bind).
  • Adds a spinner over deploy/dev's previously silent phases (app-compute wait, store checks, access grant).

Why

mason memory/sessions bind wrote the store into agent.toml, but mason deploy keyed both env-wiring and the SP access grant off the -s/-m flags — bool(session_store or memory_store). So bind + deploy (no flags) deployed an app whose service principal was never granted store access, and every runtime store call failed with PERMISSION_DENIED. The app was effectively broken unless you re-passed the store as a flag on deploy, duplicating what bind already recorded.

Routing everything through agent.toml fixes that and removes the app.yaml-vs-agent.toml split-brain: one place declares stores (bind), one place reads them (the runtime), and deploy just validates + grants.

Tests

277 unit tests pass; ruff + ty clean. Coverage added/updated for:

  • mason memory bind records the store id; resolve_memory_store returns the id (falling back to the display name for a hand-written binding).
  • store_binding(prefer="id") and the resolver precedence.
  • mason deploy / mason dev write no store env into app.yaml.
  • mason deploy errors (pointing at bind) when a bound store doesn't exist.

@elainewang-db elainewang-db left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@qinxinw-db do you think we can just remove mason dev/deploy -m -s now that we have bind?

@elainemwang
elainemwang force-pushed the mason-deploy-reads-bindings branch 2 times, most recently from f33c556 to 4ee40eb Compare September 4, 2026 00:38
Stores are declared only via `mason memory/sessions bind` (which creates them and records
the store — memory also records its id — in agent.toml). The runtime resolves them straight
from agent.toml, so:

- `mason deploy`/`mason dev` drop the `--memory/-m` and `--session/-s` flags.
- Stores are no longer written into app.yaml env; the runtime reads agent.toml at request time.
- `mason deploy`/`mason dev` only validate the bound stores exist (erroring toward `bind`) and,
  for deploy, grant the app's service principal access. Store creation lives in `bind` alone;
  `--no-create-stores` is removed from deploy/dev (it stays on `bind`).

Also adds a spinner over deploy/dev's silent phases (compute wait, store checks, access grant).

Co-authored-by: Isaac <no-reply@databricks.com>
@elainemwang
elainemwang force-pushed the mason-deploy-reads-bindings branch from 4ee40eb to 1871d73 Compare September 4, 2026 00:49
elainewang-db and others added 3 commits September 4, 2026 17:33
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Keeps control characters out of machine-readable output.

Co-authored-by: Isaac <no-reply@databricks.com>

@qinxinw-db qinxinw-db 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.

thanks this makes sense!

@elainewang-db
elainewang-db merged commit c6eb0d5 into databricks:main Sep 4, 2026
50 checks passed
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.

2 participants