Documentation
¶
Overview ¶
Package toolcontext owns the request-scoped identity and lifecycle shared by every Memoh tool transport. It is independent of MCP, ACP, and native tool protocols so those adapters can all bind work to the same agent run.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bind ¶
Bind gives a tool callback the owning run's request-scoped values and makes it stop when either the callback or the run stops. The run context is the authoritative source of tenant, identity, trace, and other turn values; transport callback contexts contribute their independent cancellation.
Types ¶
type Session ¶
type Session struct {
BotID string
ChatID string
RuntimeID string
RuntimeToken string `json:"-"`
SessionID string
RunID string
ToolCallID string
SessionType string
RouteID string
ChannelIdentityID string
SessionToken string `json:"-"`
CurrentPlatform string
ReplyTarget string
ConversationType string
// ReasoningStoredEffort and ReasoningRequestedEffort are unresolved turn
// inputs. A tool that selects another model must resolve them against that
// model instead of inheriting the parent runtime's provider-specific result.
ReasoningStoredEffort string
ReasoningRequestedEffort string
CanRequestUserInput bool
CanListUserInput bool
IsSubagent bool
RuntimeActive bool
// RequireActiveRun declares that this session's tool surface exists only
// for the duration of a runtime turn. Workspace tool-gateway mounts set it;
// the general HTTP tool API remains available outside a turn.
RequireActiveRun bool
SupportsImageInput bool
SupportsFileInput bool
ContextBudgetMaxTokens int
ContextToolExchangePolicy *contextfrag.ToolExchangePolicy
RuntimeFence runtimefence.Fence `json:"-"`
RunContext context.Context `json:"-"`
RuntimeGuard func(context.Context) error `json:"-"`
}
Session carries request-scoped identity and runtime ownership for tool execution. Runtime-only fields remain process-local and are never serialized.