Model Selection Context Holder
Makes the ModelSelectionContext for the current call available to model resolution without threading it through every LLM API. Applications set it at their request boundary - a servlet filter, an interceptor, or around the code that starts an agent process.
The platform propagates the context across the threads it starts itself - a background agent run, parallel actions, OperationContext.parallelMap - because losing it there does not fail loudly: role resolution would quietly fall back to deployment configuration and serve a model the deployment is billed for. It does not reach threads the application spawns on its own. Capture it with get and re-establish it with with inside such a thread.
Functions
The context for the current thread, or ModelSelectionContext.EMPTY if none was set.