AgentExecutionContextExtensions
NexusLabs.Needlr.AgentFramework¶
NexusLabs.Needlr.AgentFramework.Context¶
AgentExecutionContextExtensions Class¶
Extension methods for IAgentExecutionContextAccessor.
Inheritance System.Object 🡒 AgentExecutionContextExtensions
Methods¶
AgentExecutionContextExtensions.GetRequired(this IAgentExecutionContextAccessor) Method¶
Returns the current IAgentExecutionContext or throws if none is established. Tools should call this rather than checking Current directly — there is no valid "anonymous" execution.
public static NexusLabs.Needlr.AgentFramework.Context.IAgentExecutionContext GetRequired(this NexusLabs.Needlr.AgentFramework.Context.IAgentExecutionContextAccessor accessor);
Parameters¶
accessor IAgentExecutionContextAccessor
Returns¶
Exceptions¶
System.InvalidOperationException
Thrown when no execution context scope is active. This indicates a programming error:
the orchestration layer must call BeginScope(IAgentExecutionContext)
before invoking tools.