Get the agent environment for a LangSmith tracer.
Experimental: in beta and enabled per workspace. A workspace without agent addressing rejects the runs, so tracing is lost rather than falling back to a project.
Must be one of local, development, staging or production
-- matched case-insensitively, surrounding space ignored. The endpoint
rejects anything else rather than defaulting it, so a near miss like
prod fails the whole batch.
Read from LANGSMITH_AGENT_ENVIRONMENT only. Unlike most LangSmith
variables it has no LANGCHAIN_ alias, so that the newer namespace is
the only one to learn for this. There is also no default -- an
agent-addressed run must name its environment.
Read once per process and cached; call .cache_clear() to re-read.