MentorAgent Docs
Menu

ReferencePackage: Novior.MentorAgent.Abstractions

IMentorTenant interface

The IMentorTenant interface of Novior.MentorAgent.Abstractions.Interfaces: The tenant of the current request, as the IMentorTenantResolver named it. Scoped…

View as Markdown
On this page

The tenant of the current request, as the IMentorTenantResolver named it. Scoped: inject it into an action, a policy, or a service the governor resolves from MentorActionRequest.Services.

Namespace: Novior.MentorAgent.Abstractions.Interfaces. Package: Novior.MentorAgent.Abstractions.

public interface IMentorTenant

Terminal
dotnet add package Novior.MentorAgent.Abstractions

string? Id { get; }

The tenant's identifier; null when the application registers no IMentorTenantResolver and serves a single tenant.

In a turn, the tenant resolved when the turn started; during a call to the MCP server, the call's own. With a resolver registered, reading it in a scope where nothing was resolved yet — before the first turn of a circuit, say, or in the build of WarmUpAtStartup, which serves nobody — throws InvalidOperationException: it never reads as the single tenant. IMentorTenant.GetIdAsync resolves it there.

ValueTask<string?> GetIdAsync(CancellationToken cancellationToken = default)

The tenant's identifier, as IMentorTenant.Id; in a scope that had no turn yet — a page that only reads the memory or the dashboard — it asks the IMentorTenantResolver first, with the scope's user, under the same rules as a turn.

Exceptions

  • InvalidOperationException: The resolver names no tenant for this scope, or another than its own.