Workspace precedence: route overlapping capabilities through the engine when a workspace declares them
Goal
When a workspace declares an integration and the local engine serves it, the model deterministically uses the engine path for that capability — without losing native reach for everything else.
Design (for technical review before implementation)
- Per-session precedence derived from what actually materialised at attach, not what was declared.
- Type-scoped shadowing. For each materialised warehouse integration, local connections of that driver type are marked shadowed in
warehouse_list, andsql_execute/sql_explain/sql_optimize/schema_inspecton them return a redirect naming the engine tool — no execution, no fallback. Other driver types (DuckDB, MySQL, Trino, …) are untouched. - A session permission ruleset denies native tools that are fully duplicated by a materialised integration (expected to be empty in practice; the mechanism exists for the rare full shadow).
- Tool descriptions carry the workspace name on both sides.
- Escape hatch:
--integrations=local(or a session command) turns shadowing off. - Inventory line: "Snowflake routed through
; N local connections shadowed."
Known trade-off
Type-scoped, not identity-scoped: a different Snowflake account configured locally is shadowed too. The escape hatch covers it; per-connection identity is a follow-up once a mapping from workspace integration to local connection exists.
Verification
Pre-merge E2E with a workspace that has a live Snowflake connection: shadowing marks, redirect on sql_execute, model picks the engine tool unprompted, DuckDB unaffected, escape hatch restores native, removing the connection removes the shadowing.
Filed by mistake — tracked internally.