[mason] deploy/dev read agent.toml store bindings - #540
Merged
elainewang-db merged 4 commits intoSep 4, 2026
Conversation
elainewang-db
commented
Sep 3, 2026
elainewang-db
left a comment
Contributor
Author
There was a problem hiding this comment.
@qinxinw-db do you think we can just remove mason dev/deploy -m -s now that we have bind?
elainemwang
force-pushed
the
mason-deploy-reads-bindings
branch
2 times, most recently
from
September 4, 2026 00:38
f33c556 to
4ee40eb
Compare
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
force-pushed
the
mason-deploy-reads-bindings
branch
from
September 4, 2026 00:49
4ee40eb to
1871d73
Compare
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
approved these changes
Sep 4, 2026
qinxinw-db
left a comment
Contributor
There was a problem hiding this comment.
thanks this makes sense!
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
Make
agent.tomlthe single source of truth for an agent's memory and session stores, end to end.mason memory bind/mason sessions bind. Binding creates the store (idempotent) and records it inagent.toml— memory also records the store id, which the entries API is keyed by.resolve_memory_store/resolve_session_store); precedence is explicit arg →AGENT_*_STOREenv →agent.tomlbinding.mason deploy / mason devdrop the --memory/-m and --session/-s flags.app.yamlenv — the runtime readsagent.tomlat request time, so there's nothing to sync.mason deploy / mason devnow 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-storesis removed from deploy/dev (it stays on bind).Why
mason memory/sessions bindwrote the store into agent.toml, butmason deploykeyed both env-wiring and the SP access grant off the -s/-m flags — bool(session_storeormemory_store). So bind + deploy (no flags) deployed an app whose service principal was never granted store access, and every runtime store call failed withPERMISSION_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.tomlsplit-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 bindrecords 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 devwrite no store env into app.yaml.mason deploy errors(pointing at bind) when a bound store doesn't exist.