Documentation
¶
Overview ¶
Package orchestratorcontext provides context-scoped access to the running agent's identity. By injecting an Agent into ctx early in the pipeline (e.g. at Bootstrap / Start), any downstream code can retrieve the agent identity without explicit function parameters.
Usage:
ctx = orchestratorcontext.WithAgent(ctx, orchestratorcontext.Agent{Name: "my-bot"})
…
name := orchestratorcontext.AgentNameFromContext(ctx) // "my-bot"
Index ¶
Constants ¶
const DefaultAgentName = "Genie"
DefaultAgentName is returned when no Agent has been set on the context.
Variables ¶
This section is empty.
Functions ¶
func AgentNameFromContext ¶
AgentNameFromContext is a convenience function that returns the agent's Name from ctx, defaulting to DefaultAgentName.
func IsInternalTask ¶
IsInternalTask returns true if the context was marked with WithInternalTask. This is intended as a marker that upstream code (e.g. the app layer) can inspect to adjust behavior for background system events, such as configuring the orchestrator to skip semantic cache and classification when needed.
func WithInternalTask ¶
WithInternalTask marks the context as carrying an internal task (cron trigger, heartbeat, webhook event). Callers can use IsInternalTask to detect these system-initiated requests and, for example, set CodeQuestion.SkipClassification so the orchestrator bypasses the semantic cache and classification pipeline when appropriate.
Types ¶
type Agent ¶
type Agent struct {
Name string
}
Agent holds the identity of the currently running agent. For now it only carries a Name; additional fields (e.g. Version, Description) can be added later without breaking callers.
func AgentFromContext ¶
AgentFromContext extracts the Agent from ctx. If no Agent was set on the context, it returns an Agent whose Name is DefaultAgentName.