Help us shape the future of Go! Take the 2026 Go Developer Survey

requestctx

package
v0.1.58 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BeginResourceReadDispatch = shared.BeginResourceReadDispatch
View Source
var BeginResourceReadRelease = shared.BeginResourceReadRelease
View Source
var ConversationIDKey = shared.ConversationIDKey

Conversation identity is shared with the resource client pool. Turn/model lifecycle tracking below remains application-owned.

View Source
var HasResourceReadDispatch = shared.HasResourceReadDispatch
View Source
var ModelMessageIDKey = modelMessageIDKey("modelMessageID")
View Source
var ResolvedResourceFromContext = shared.ResolvedResourceFromContext
View Source
var ResourceDependencyFromContext = shared.ResourceDependencyFromContext
View Source
var ResourceExecutionProofFromContext = shared.ResourceExecutionProofFromContext
View Source
var ResourceReadAssociation = shared.ResourceReadAssociation
View Source
var ToolMessageIDKey = toolMessageIDKey("toolMessageID")
View Source
var UIBridgeSessionIDFromContext = shared.UIBridgeSessionIDFromContext
View Source
var UIWindowIDFromContext = shared.UIWindowIDFromContext
View Source
var WindowParametersFromContext = shared.WindowParametersFromContext
View Source
var WindowReadDecisionActive = shared.WindowReadDecisionActive
View Source
var WindowTargetFromContext = shared.WindowTargetFromContext
View Source
var WithResolvedResource = shared.WithResolvedResource
View Source
var WithResourceDependencies = shared.WithResourceDependencies
View Source
var WithResourceExecutionProof = shared.WithResourceExecutionProof
View Source
var WithResourceReadAssociation = shared.WithResourceReadAssociation
View Source
var WithResourceReadDispatch = shared.WithResourceReadDispatch
View Source
var WithUIBridgeSessionID = shared.WithUIBridgeSessionID
View Source
var WithUIWindowID = shared.WithUIWindowID
View Source
var WithWindowParameters = shared.WithWindowParameters
View Source
var WithWindowReadDecision = shared.WithWindowReadDecision
View Source
var WithWindowTarget = shared.WithWindowTarget
View Source
var WithoutWindowReadDecision = shared.WithoutWindowReadDecision

Functions

func CleanupTurn

func CleanupTurn(turnID string)

func CloneUserAsk added in v0.1.8

func CloneUserAsk(dst, src context.Context) context.Context

func ConversationIDFromContext

func ConversationIDFromContext(ctx context.Context) string

func InvocationIDFromContext added in v0.1.57

func InvocationIDFromContext(ctx context.Context) string

func IsInternalHelperAgentID added in v0.1.57

func IsInternalHelperAgentID(agentID string) bool

IsInternalHelperAgentID identifies control-plane agents that must not become the owning agent of an existing main turn or its approval continuation.

func MessageAddEventFromContext added in v0.1.8

func MessageAddEventFromContext(ctx context.Context) bool

func ModelMessageIDFromContext

func ModelMessageIDFromContext(ctx context.Context) string

func NotifyInvocationReturned added in v0.1.57

func NotifyInvocationReturned(ctx context.Context, result InvocationResult) error

func ObserveInvocation added in v0.1.57

func ObserveInvocation(ctx context.Context, invocation Invocation) (context.Context, error)

func PreferredUIClientIDFromContext added in v0.1.9

func PreferredUIClientIDFromContext(ctx context.Context) string

func PromptProfileAllowListFromContext added in v0.1.8

func PromptProfileAllowListFromContext(ctx context.Context) []string

func RequestModeFromContext

func RequestModeFromContext(ctx context.Context) string

func SetTurnModelMessageID

func SetTurnModelMessageID(turnID, msgID string)

func SetTurnTrace

func SetTurnTrace(turnID, traceID string)

func ToolMessageIDFromContext

func ToolMessageIDFromContext(ctx context.Context) string

func ToolResultPreviewLimitFromContext added in v0.1.8

func ToolResultPreviewLimitFromContext(ctx context.Context) int

func TurnModelMessageID

func TurnModelMessageID(turnID string) string

func TurnTrace

func TurnTrace(turnID string) string

func UserAskFromContext added in v0.1.8

func UserAskFromContext(ctx context.Context) string

func WithConversationID

func WithConversationID(ctx context.Context, id string) context.Context

func WithInvocationObserver added in v0.1.57

func WithInvocationObserver(ctx context.Context, observer InvocationObserver) context.Context

func WithMessageAddEvent added in v0.1.8

func WithMessageAddEvent(ctx context.Context) context.Context

func WithModelCompletionMeta

func WithModelCompletionMeta(ctx context.Context, meta ModelCompletionMeta) context.Context

func WithModelMessageID

func WithModelMessageID(ctx context.Context, messageID string) context.Context

func WithPreferredUIClientID added in v0.1.9

func WithPreferredUIClientID(ctx context.Context, clientID string) context.Context

func WithPromptProfileAllowList added in v0.1.8

func WithPromptProfileAllowList(ctx context.Context, ids []string) context.Context

func WithRequestMode

func WithRequestMode(ctx context.Context, mode string) context.Context

func WithRunMeta

func WithRunMeta(ctx context.Context, meta RunMeta) context.Context

func WithToolMessageID

func WithToolMessageID(ctx context.Context, messageID string) context.Context

func WithToolResultPreviewLimit added in v0.1.8

func WithToolResultPreviewLimit(ctx context.Context, limit int) context.Context

func WithTurnMeta

func WithTurnMeta(ctx context.Context, meta TurnMeta) context.Context

func WithUserAsk added in v0.1.8

func WithUserAsk(ctx context.Context, ask string) context.Context

func WithoutConversationTracking added in v0.1.9

func WithoutConversationTracking(ctx context.Context) context.Context

WithoutConversationTracking removes conversation / turn-local tracking keys from context for internal sidecar model calls that must not participate in transcript persistence, SSE ownership, or continuation anchoring.

Types

type Invocation added in v0.1.57

type Invocation struct {
	Detached             bool   `json:"detached,omitempty"`
	ExecutionMode        string `json:"executionMode,omitempty"`
	ID                   string `json:"id,omitempty"`
	ConversationID       string `json:"conversationId,omitempty"`
	TurnID               string `json:"turnId,omitempty"`
	Name                 string `json:"name,omitempty"`
	Description          string `json:"description,omitempty"`
	ParentConversationID string `json:"parentConversationId,omitempty"`
	ParentTurnID         string `json:"parentTurnId,omitempty"`
	ParentToolCallID     string `json:"parentToolCallId,omitempty"`
	ParentMessageID      string `json:"parentMessageId,omitempty"`
	ParentInvocationID   string `json:"parentInvocationId,omitempty"`
}

Invocation describes a real delegated Query call, not a conversation link. TurnID/ID identify one invocation even when its conversation is reused.

type InvocationObserver added in v0.1.57

type InvocationObserver interface {
	BeforeInvocation(context.Context, Invocation) error
	InvocationReturned(context.Context, InvocationResult) error
}

func InvocationObserverFromContext added in v0.1.57

func InvocationObserverFromContext(ctx context.Context) InvocationObserver

type InvocationObserverFuncs added in v0.1.57

type InvocationObserverFuncs struct {
	Before   func(context.Context, Invocation) error
	Returned func(context.Context, InvocationResult) error
}

func (InvocationObserverFuncs) BeforeInvocation added in v0.1.57

func (f InvocationObserverFuncs) BeforeInvocation(ctx context.Context, invocation Invocation) error

func (InvocationObserverFuncs) InvocationReturned added in v0.1.57

func (f InvocationObserverFuncs) InvocationReturned(ctx context.Context, result InvocationResult) error

type InvocationResult added in v0.1.57

type InvocationResult struct {
	ClientToolCalls        []clienttool.PendingCall
	ClientToolDependencies []clienttool.Dependency
	InterruptIDs           []string
	Invocation             Invocation
	NativeStatus           string
	Content                string
	Error                  string
}

type ModelCompletionMeta

type ModelCompletionMeta struct {
	Content       string
	Narration     string
	FinalResponse bool
	FinishReason  string
}

func ModelCompletionMetaFromContext

func ModelCompletionMetaFromContext(ctx context.Context) (ModelCompletionMeta, bool)

type ResourceReadDispatch added in v0.1.57

type ResourceReadDispatch = shared.ResourceReadDispatch

type ResourceReadRelease added in v0.1.57

type ResourceReadRelease = shared.ResourceReadRelease

type RunMeta

type RunMeta struct {
	RunID     string
	Iteration int
}

RunMeta captures the active persisted run identity and loop iteration.

func RunMetaFromContext

func RunMetaFromContext(ctx context.Context) (RunMeta, bool)

type TurnMeta

type TurnMeta struct {
	TurnID          string
	Assistant       string
	ConversationID  string
	ParentMessageID string
}

TurnMeta captures minimal per-turn context for downstream persistence.

func TurnMetaFromContext

func TurnMetaFromContext(ctx context.Context) (TurnMeta, bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL