Documentation
¶
Index ¶
- Constants
- Variables
- func IsEligibleNoStoreCreate(decoded *DecodedCreate) bool
- func Mount(mux *http.ServeMux, opts lipsdk.FrontendMountOptions) error
- func NewWSLocalStore(scope lipcont.Scope, limits lipcont.StorageLimits) lipcont.Store
- func RegisterClaims(reg *httpcontract.RouteRegistry, cfg Config) ([]httpcontract.RouteClaim, error)
- func RegisterClaimsForOwner(reg *httpcontract.RouteRegistry, cfg Config, ownerID string) ([]httpcontract.RouteClaim, error)
- func RouteClaims(cfg Config) ([]httpcontract.RouteClaim, error)
- func RouteClaimsForOwner(cfg Config, ownerID string) ([]httpcontract.RouteClaim, error)
- func RouteDiagnostics(cfg Config) []httpcontract.RouteDiagnostic
- type Authorizer
- type CompactOperation
- type CompactResourceIDSource
- type Config
- type ContinuationConfig
- type ContinuationRecorderFactory
- type ContinuationResolver
- type CreateEncodeState
- type DecodeCompactOptions
- type DecodeCreateOptions
- type DecodedCompact
- type DecodedCreate
- type Diagnostics
- type ExecutorView
- type Handler
- type HandlerConfig
- type Profile
- type ResponseClock
- type ResponseIDSource
- type SessionRunner
- type SessionRunnerConfig
- type WSCounterSnapshot
- type WSCounters
- type WSLocalContinuationConfig
- type WSSession
- func (s *WSSession) Auth() sdkauth.Decision
- func (s *WSSession) Close() error
- func (s *WSSession) ContinuationScope() lipcont.Scope
- func (s *WSSession) LocalStore() lipcont.Store
- func (s *WSSession) Origin() string
- func (s *WSSession) PeerClosed() <-chan struct{}
- func (s *WSSession) Run(ctx context.Context, runner WSSessionRunner) error
- func (s *WSSession) SetLocalContinuation(store lipcont.Store, scope lipcont.Scope)
- func (s *WSSession) StartedAt() time.Time
- func (s *WSSession) WriteJSON(v any) error
- func (s *WSSession) WriteText(data []byte) error
- type WSSessionRunner
- type WebSocketConfig
- type WebSocketHandler
- type WebSocketHandlerConfig
- type WireErrors
- func (WireErrors) WriteAdmissionReject(w http.ResponseWriter, d decodeqos.Decision) error
- func (WireErrors) WriteBodyTooLarge(w http.ResponseWriter) error
- func (WireErrors) WriteEncodeFailed(w http.ResponseWriter) error
- func (WireErrors) WriteExecuteError(w http.ResponseWriter, out execerr.Outcome) error
- func (WireErrors) WriteExecutorNotConfigured(w http.ResponseWriter) error
- func (WireErrors) WriteHookError(w http.ResponseWriter, err error) error
- func (WireErrors) WriteInvalidJSON(w http.ResponseWriter) error
- func (WireErrors) WriteInvalidRequest(w http.ResponseWriter) error
- func (WireErrors) WritePreflightCanceled(w http.ResponseWriter) error
- func (WireErrors) WriteReadBodyFailed(w http.ResponseWriter) error
Constants ¶
const ( ID = "openresponses" DefaultProfile = "2026-04-24" DefaultBasePath = "/openresponses/v1" DefaultPersistentStore = "standard" DefaultTTL = "24h" DefaultMaxChainDepth = 64 DefaultMaxMaterializedBytes = 67108864 // 64 MiB DefaultMaxConnectionAge = "60m" DefaultIdleTimeout = "5m" DefaultMaxQueuedTurns = 1 DefaultMaxQueuedBytes = 8 * 1024 * 1024 // 8 MiB: one full-size turn envelope MaxAllowedWSConnectionAgeDur = 60 * time.Minute MaxAllowedChainDepth = 1024 MaxAllowedMaterializedBytes = 256 << 20 MaxAllowedQueuedTurns = 1024 MaxAllowedQueuedBytes = 256 << 20 // 256 MiB ceiling for the per-session queued-byte bound )
const ( RouteOperationCreate httpcontract.RouteKind = "openresponses_create" RouteOperationCompact httpcontract.RouteKind = "openresponses_compact" RouteOperationWebSocket httpcontract.RouteKind = "openresponses_websocket" )
const ProfileID = "openresponses_v1"
ProfileID is the static identifier for the certified OpenResponses fast-path profile (Requirements 4, 17).
Variables ¶
var ErrCompactDecode = errors.New("openresponses: compact decode failed")
Functions ¶
func IsEligibleNoStoreCreate ¶
func IsEligibleNoStoreCreate(decoded *DecodedCreate) bool
IsEligibleNoStoreCreate reports whether the decoded request belongs to the certified bounded no-store subset (Task 17.1, Requirement 17.4):
- HTTP create (not compaction)
- explicit store: false (ExplicitStore != nil && !*ExplicitStore)
- no previous_response_id (PreviousResponseID == "")
Missing store field returns false because current decode defaults store=true, requiring canonical storage/reservation processing.
func Mount ¶
func Mount(mux *http.ServeMux, opts lipsdk.FrontendMountOptions) error
Mount registers the OpenResponses API handler and route claims on mux.
func NewWSLocalStore ¶
NewWSLocalStore builds a connection-scoped bounded continuation store. The store accepts terminal records without a prior reservation so the incremental recorder can persist completed turns under the proxy-issued response ID.
func RegisterClaims ¶
func RegisterClaims(reg *httpcontract.RouteRegistry, cfg Config) ([]httpcontract.RouteClaim, error)
RegisterClaims validates and atomically adds this frontend's claims to a registry. No handler is mounted by this operation.
func RegisterClaimsForOwner ¶
func RegisterClaimsForOwner(reg *httpcontract.RouteRegistry, cfg Config, ownerID string) ([]httpcontract.RouteClaim, error)
RegisterClaimsForOwner is the composition-root form when a frontend instance has an operator-assigned owner ID.
func RouteClaims ¶
func RouteClaims(cfg Config) ([]httpcontract.RouteClaim, error)
RouteClaims calculates the normalized route claims for an OpenResponses frontend config.
func RouteClaimsForOwner ¶
func RouteClaimsForOwner(cfg Config, ownerID string) ([]httpcontract.RouteClaim, error)
RouteClaimsForOwner returns claims with an explicit immutable owner identity.
func RouteDiagnostics ¶
func RouteDiagnostics(cfg Config) []httpcontract.RouteDiagnostic
RouteDiagnostics returns stable, sanitized diagnostics for this validated config.
Types ¶
type Authorizer ¶
type Authorizer interface {
Authenticate(ctx context.Context, meta sdkauth.InboundCallMeta) (sdkauth.Decision, error)
}
Authorizer performs request-path authentication checks before body parsing or continuation store work.
type CompactOperation ¶
type CompactOperation struct {
Call *lipapi.Call
Requirements lipapi.ProtocolRequirements
}
CompactOperation is the narrow value handed to the compact executor seam. Keeping the call and its complete admission requirements together prevents a later execution slice from reconstructing requirements from wire data.
func CompactOperationFromDecoded ¶
func CompactOperationFromDecoded(decoded *DecodedCompact) (CompactOperation, error)
type CompactResourceIDSource ¶
type CompactResourceIDSource interface {
NewCompactResourceID() string
}
CompactResourceIDSource issues identifiers for the standalone compaction resource. These are deliberately separate from proxy response IDs because a compact result is not a continuation record.
type Config ¶
type Config struct {
Profile string `yaml:"profile"`
BasePath string `yaml:"base_path"`
Continuation ContinuationConfig `yaml:"continuation"`
WebSocket WebSocketConfig `yaml:"websocket"`
ExposeLipUsageExtensions bool `yaml:"expose_lip_usage_extensions"`
// contains filtered or unexported fields
}
Config represents the strict configuration for the OpenResponses frontend plugin.
func DecodeConfig ¶
DecodeConfig decodes a YAML node into Config with strict unknown field checks and validation.
type ContinuationConfig ¶
type ContinuationConfig struct {
PersistentStore string `yaml:"persistent_store"`
TTL string `yaml:"ttl"`
MaxChainDepth int `yaml:"max_chain_depth"`
MaxMaterializedBytes int64 `yaml:"max_materialized_bytes"`
}
ContinuationConfig configures proxy-owned continuation behavior.
type ContinuationRecorderFactory ¶
type ContinuationRecorderFactory interface {
NewRecorder(store lipcont.Store, record lipcont.ContinuationRecord) lipcont.StreamObserver
}
ContinuationRecorderFactory creates the observer for one reserved response. The observer is deliberately best-effort: terminal persistence is not part of the downstream output commitment.
type ContinuationResolver ¶
type ContinuationResolver interface {
ResolveParent(ctx context.Context, scope lipcont.Scope, parentID string, baseCall lipapi.Call) (lipapi.Call, lipcont.ContinuationRecord, error)
}
ContinuationResolver defines a narrow injected seam for resolving parent continuation state.
func NewStoreContinuationResolver ¶
func NewStoreContinuationResolver(store lipcont.Store, bounds lipcont.Bounds) ContinuationResolver
NewStoreContinuationResolver constructs a ContinuationResolver backed by a lipcont.Store.
type CreateEncodeState ¶
type CreateEncodeState struct {
// contains filtered or unexported fields
}
CreateEncodeState is per-request OpenResponses create state carried through Extra.
type DecodeCompactOptions ¶
type DecodeCompactOptions struct {
DefaultRouteSelector string
RoutePrefixes []string
RouteSelector string
Headers http.Header
Auth Authorizer
MaxBodyBytes int64
Limits proto.Limits
Method string
Path string
RemoteAddr string
HTTPHeaders lipsdk.HTTPHeaders
}
DecodeCompactOptions supplies context and dependencies for authenticating and decoding a compact request.
type DecodeCreateOptions ¶
type DecodeCreateOptions struct {
DefaultRouteSelector string
RoutePrefixes []string
RouteSelector string
Headers http.Header
Auth Authorizer
MaxBodyBytes int64
Limits proto.Limits
Method string
Path string
RemoteAddr string
HTTPHeaders lipsdk.HTTPHeaders
}
DecodeCreateOptions supplies context and dependencies for authenticating and decoding a create request.
type DecodedCompact ¶
type DecodedCompact struct {
Call *lipapi.Call
Requirements lipapi.ProtocolRequirements
RouteSelector string
Model string
AuthDecision sdkauth.Decision
}
DecodedCompact holds the outcome of authenticated compact request decoding.
func AuthenticateAndDecodeCompact ¶
func AuthenticateAndDecodeCompact(ctx context.Context, body []byte, opts DecodeCompactOptions) (*DecodedCompact, error)
AuthenticateAndDecodeCompact performs authentication checks FIRST, then decodes the request body into an item-authoritative canonical lipapi.Call with context.compaction operation and protocol requirements.
func DecodeCompactRequest ¶
func DecodeCompactRequest(ctx context.Context, body []byte, opts DecodeCompactOptions) (*DecodedCompact, error)
DecodeCompactRequest is the compact endpoint's decode seam.
The protocol package owns strict JSON bounds, duplicate-key detection, and wire-to-item conversion. The frontend adds authentication, route/model authority, compact-only field validation, and the canonical invocation metadata through AuthenticateAndDecodeCompact.
type DecodedCreate ¶
type DecodedCreate struct {
Call *lipapi.Call
Requirements lipapi.ProtocolRequirements
Stream bool
RouteSelector string
Model string
PreviousResponseID string
Store bool
ExplicitStore *bool
AuthDecision sdkauth.Decision
}
DecodedCreate holds the outcome of authenticated create request decoding.
func AuthenticateAndDecodeCreate ¶
func AuthenticateAndDecodeCreate(ctx context.Context, body []byte, opts DecodeCreateOptions) (*DecodedCreate, error)
AuthenticateAndDecodeCreate performs authentication checks FIRST, then decodes the request body into an item-authoritative canonical lipapi.Call with protocol requirements and invocation metadata.
type Diagnostics ¶
type Diagnostics struct {
Profile string `json:"profile"`
BasePath string `json:"base_path"`
WebSocketEnabled bool `json:"websocket_enabled"`
WebSocketMaxQueuedTurns int `json:"websocket_max_queued_turns"`
WebSocketMaxQueuedBytes int64 `json:"websocket_max_queued_bytes"`
WebSocketDevelopmentMode bool `json:"websocket_development_mode"`
WebSocketAllowAnyOrigin bool `json:"websocket_allow_any_origin"`
AllowedOrigins []string `json:"allowed_origins"`
ContinuationStore string `json:"continuation_store"`
ContinuationTTL string `json:"continuation_ttl"`
RouteClaims []httpcontract.RouteClaim `json:"route_claims"`
}
Diagnostics holds sanitized operator-visible diagnostic metadata for OpenResponses frontend.
func SanitizedDiagnostics ¶
func SanitizedDiagnostics(cfg Config, ownerID string) Diagnostics
SanitizedDiagnostics produces sanitized diagnostic information for a Config and owner ID. It never fails: even a malformed config still yields sanitized values for display. Route claims are best-effort — a claims error (e.g. invalid config) yields nil claims rather than hiding the sanitized diagnostic view.
type ExecutorView ¶
type ExecutorView interface {
Execute(ctx context.Context, call *lipapi.Call) (lipapi.EventStream, error)
}
ExecutorView is the canonical event-stream executor used by create.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler wires OpenResponses HTTP requests to auth → decode → executor. Direct handlers require an authenticated transport context by default; callers must explicitly opt into anonymous access with AllowUnauthenticated.
func NewHandler ¶
func NewHandler(cfg HandlerConfig) *Handler
NewHandler creates a new OpenResponses HTTP handler.
func (*Handler) ServeHTTP ¶
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP handles HTTP requests for OpenResponses endpoints.
func (*Handler) Spec ¶
func (h *Handler) Spec() *frontendpipe.Spec[createEncodeState]
Spec returns the configured frontendpipe.Spec for this handler.
type HandlerConfig ¶
type HandlerConfig struct {
Authorizer Authorizer
RequireAuthentication bool
AllowUnauthenticated bool
Executor ExecutorView
// ContinuationResolver is the narrow injected seam for resolving parent continuation state.
ContinuationResolver ContinuationResolver
// ContinuationStore is the injected protocol-neutral store port for continuation
// state. When nil, continuation features degrade gracefully.
ContinuationStore lipcont.Store
DefaultRouteSelector string
RoutePrefixes []string
MaxRequestBodyBytes int64
ProtocolLimits proto.Limits
DecodeAdmission lipsdk.DecodeAdmission
TrafficPorts traffic.PortBundle
PreRequestKeepalive lipsdk.FrontendKeepaliveConfig
Config Config
HTTPHeaders lipsdk.HTTPHeaders
StreamKeepaliveInterval time.Duration
ResponseIDSource ResponseIDSource
CompactResourceIDSource CompactResourceIDSource
ResponseClock ResponseClock
// RecorderFactory is the narrow seam for incremental terminal recording.
// A nil factory uses the standard core recorder.
RecorderFactory ContinuationRecorderFactory
// Profile optionally enables large-payload fast-path candidate evaluation (Task 17).
Profile frontendpipe.FrontendProfile
// LargePayload configures the large-payload fast-path candidate limits (Task 17).
LargePayload frontendpipe.LargePayloadConfig
}
HandlerConfig configures the HTTP handler for OpenResponses.
type Profile ¶
type Profile struct{}
Profile implements frontendpipe.FrontendProfile for OpenResponses create (POST /openresponses/v1/responses).
func NewProfile ¶
func NewProfile() *Profile
NewProfile returns an initialized OpenResponses frontend profile.
func (*Profile) CompileProof ¶
func (p *Profile) CompileProof(ctx context.Context, in frontendpipe.ProofInput) (frontendpipe.ProofOutput, error)
CompileProof compiles protocol proof and response seeds from the captured request replay under decode admission (Requirements 4, 14, 16, 17). Uses the streaming proof pass without allocating or retaining the full request body.
type ResponseClock ¶
ResponseClock supplies proxy-owned response timestamps.
type ResponseIDSource ¶
type ResponseIDSource interface {
NewResponseID() string
}
ResponseIDSource issues proxy-owned response identifiers.
type SessionRunner ¶
type SessionRunner struct {
// contains filtered or unexported fields
}
SessionRunner implements WSSessionRunner: it processes each client text frame as a strict response.create envelope and executes accepted turns sequentially on the session pump goroutine. At most one turn is in flight; the transport queue is bounded by the session's max_queued_turns, and every write happens on the pump goroutine so data writes never race the pinger's control frames.
func NewSessionRunner ¶
func NewSessionRunner(cfg SessionRunnerConfig) *SessionRunner
NewSessionRunner constructs a turn runner for one frontend instance. The runner is stateless across sessions and safe to share between connections.
func (*SessionRunner) HandleMessage ¶
HandleMessage processes one client text frame. It returns nil for handled turns (including classified turn errors) and returns an error only for fatal conditions that must terminate the session: a dead peer or a canceled session.
type SessionRunnerConfig ¶
type SessionRunnerConfig struct {
// Executor is the canonical event-stream executor shared with the HTTP
// frontend. A nil executor makes every accepted turn fail with a classified
// operation_not_implemented error without killing the connection.
Executor ExecutorView
// DefaultRouteSelector and RoutePrefixes mirror the HTTP decode options so a
// WebSocket turn resolves its canonical route the same way a POST does.
DefaultRouteSelector string
RoutePrefixes []string
// MaxMessageBytes bounds one turn envelope during decode. Zero uses the
// protocol request limit, which also bounds the transport read.
MaxMessageBytes int64
// ProtocolLimits bounds the shared OpenResponses request codec.
ProtocolLimits proto.Limits
// ResponseIDSource and ResponseClock are proxy-owned envelope metadata shared
// with the non-streaming/SSE handlers.
ResponseIDSource ResponseIDSource
ResponseClock ResponseClock
// MaterializeBounds bound parent-chain reconstruction for a continued turn.
// Zero uses the contract defaults.
MaterializeBounds lipcont.Bounds
// RecorderFactory is the narrow seam for incremental terminal recording into
// the connection-local store. A nil factory uses the standard core recorder.
RecorderFactory ContinuationRecorderFactory
}
SessionRunnerConfig supplies the Task 6.2/6.3 turn-execution dependencies. The runner reuses the exact same injected executor and protocol state machine as the HTTP/SSE handler; connection-local continuation state lives on the session.
type WSCounterSnapshot ¶
type WSCounterSnapshot struct {
SessionsOpened int64
SessionsClosed int64
AuthRejected int64
OriginRejected int64
HandshakeRejected int64
MethodRejected int64
AgeExpired int64
IdleClosed int64
}
WSCounterSnapshot is a point-in-time view of the WebSocket transport counters.
type WSCounters ¶
type WSCounters struct {
// contains filtered or unexported fields
}
WSCounters tracks authenticated-upgrade and session-lifecycle outcomes. A counter is incremented only after a decision is made; a rejected attempt never allocates session state, so SessionsOpened stays at zero for every failure.
func (*WSCounters) Snapshot ¶
func (c *WSCounters) Snapshot() WSCounterSnapshot
Snapshot returns a consistent point-in-time view of all counters.
type WSLocalContinuationConfig ¶
type WSLocalContinuationConfig struct {
Enabled bool
// Limits bound one connection's retained terminal records.
Limits lipcont.StorageLimits
// MaterializeBounds bound parent-chain reconstruction for a continued turn.
MaterializeBounds lipcont.Bounds
// StoreFactory builds the per-connection store. A nil factory uses the
// bounded in-memory connection-local store; tests inject tracking wrappers.
StoreFactory func(scope lipcont.Scope) lipcont.Store
}
WSLocalContinuationConfig bounds the connection-local store:false continuation state allocated for one authenticated WebSocket session. State is connection- scoped, never written to a durable store, and released when the session closes. Reconnects therefore allocate an empty store and every store:false response ID from an earlier connection is indistinguishable from a missing parent.
func DefaultWSLocalContinuation ¶
func DefaultWSLocalContinuation(cfg Config) WSLocalContinuationConfig
DefaultWSLocalContinuation derives connection-local continuation bounds from a validated frontend config. Zero continuation fields fall back to profile defaults so tests and the default frontend config stay consistent.
type WSSession ¶
type WSSession struct {
// contains filtered or unexported fields
}
WSSession is the bounded connection shell established by an authenticated handshake. It owns the socket, its limits, its deadlines, and closes it exactly once. Run drives one read pump and one pinger goroutine; both are owned and joined before Run returns, so no goroutine escapes the session.
func (*WSSession) ContinuationScope ¶
ContinuationScope returns the authoritative connection scope isolating this session's local continuation records.
func (*WSSession) LocalStore ¶
LocalStore returns the connection-local continuation store, or nil when local continuation is disabled for this session.
func (*WSSession) Origin ¶
Origin returns the normalized request Origin, or "" when the client sent none.
func (*WSSession) PeerClosed ¶
func (s *WSSession) PeerClosed() <-chan struct{}
PeerClosed returns a channel that is closed when the peer or transport fails. Turn runners select on it (directly or through a derived context) to propagate disconnects into in-flight executor reads.
func (*WSSession) Run ¶
func (s *WSSession) Run(ctx context.Context, runner WSSessionRunner) error
Run starts the bounded session pumps and blocks until the session terminates: on context cancellation, connection-age expiry, peer close/error, or a runner error. It owns both pump goroutines and joins them before returning. The read pump forwards text messages to the bounded queue; the pinger emits periodic pings so a silent-but-live peer is kept alive and a dead peer is detected within the idle window.
func (*WSSession) SetLocalContinuation ¶
SetLocalContinuation attaches the connection-scoped continuation store. It is called once, after a successful upgrade and authorization.
type WSSessionRunner ¶
type WSSessionRunner interface {
HandleMessage(ctx context.Context, s *WSSession, data []byte) error
}
WSSessionRunner processes the message stream of an established session. The sequential-turn runner (SessionRunner, Task 6.2) executes one accepted turn at a time on the session pump goroutine; a nil runner keeps the bounded keepalive shell alive without turn execution. HandleMessage runs on the session pump goroutine (the request handler goroutine). The runner must not start goroutines it does not own and join; returning an error terminates the session.
type WebSocketConfig ¶
type WebSocketConfig struct {
Enabled bool `yaml:"enabled"`
MaxConnectionAge string `yaml:"max_connection_age"`
IdleTimeout string `yaml:"idle_timeout"`
MaxQueuedTurns int `yaml:"max_queued_turns"`
MaxQueuedBytes int64 `yaml:"max_queued_bytes"`
AllowedOrigins []string `yaml:"allowed_origins"`
DevelopmentMode bool `yaml:"development_mode"`
AllowAnyOrigin bool `yaml:"allow_any_origin"`
}
WebSocketConfig configures client-facing WebSocket session behavior.
Origin policy is strict by default: browser origins are accepted only when explicitly allowlisted. Relaxing it is development-only and requires both an explicit development_mode and an explicit allow_any_origin; the validator rejects allow_any_origin without development_mode, and the runtime policy never relaxes unless both are set, so a config can never be accidentally origin-open.
func (WebSocketConfig) IsEnabled ¶
func (w WebSocketConfig) IsEnabled() bool
WSEnabled returns true if WebSocket transport is enabled (defaults to true).
type WebSocketHandler ¶
type WebSocketHandler struct {
// contains filtered or unexported fields
}
WebSocketHandler serves the OpenResponses `GET <base_path>/responses` upgrade.
func NewWebSocketHandler ¶
func NewWebSocketHandler(cfg WebSocketHandlerConfig) *WebSocketHandler
NewWebSocketHandler creates a bounded, strict WebSocket upgrade handler.
func (*WebSocketHandler) Counters ¶
func (h *WebSocketHandler) Counters() *WSCounters
Counters returns the transport counters for this handler.
func (*WebSocketHandler) ServeHTTP ¶
func (h *WebSocketHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP performs strict validation, authentication, and origin checks before any upgrade or session-state allocation. Session state is created only after auth, origin, and a valid handshake all succeed.
type WebSocketHandlerConfig ¶
type WebSocketHandlerConfig struct {
// Authorizer is evaluated before the upgrade and before any session state is
// allocated. When nil, the handler requires an authenticated transport context
// unless AllowUnauthenticated is explicitly set.
Authorizer Authorizer
RequireAuthentication bool
AllowUnauthenticated bool
// Config is the validated frontend configuration supplying the WebSocket policy.
Config Config
// Runner processes established sessions (Task 6.2). A nil runner keeps the
// bounded keepalive shell alive without turn execution.
Runner WSSessionRunner
// ShutdownCtx, when non-nil, is a runtime-owned context that cancels when the
// frontend begins shutdown. Every session observes it and closes exactly once.
ShutdownCtx context.Context
// MaxMessageBytes overrides the default per-message bound; zero uses the default.
MaxMessageBytes int64
// LocalContinuation configures connection-local store:false continuation.
// A nil value enables the profile defaults derived from Config.
LocalContinuation *WSLocalContinuationConfig
// WriteTextWrapper, when non-nil, wraps the socket data-frame writer for every
// session this handler establishes. next writes one text frame to the socket.
// A wrapper may count frames and return an error on the Nth write to force a
// deterministic writer failure; production leaves it nil.
WriteTextWrapper func(next func(data []byte) error) func(data []byte) error
}
WebSocketHandlerConfig configures the OpenResponses WebSocket upgrade/transport handler.
type WireErrors ¶
type WireErrors struct{}
WireErrors implements frontendpipe.WireErrors for OpenResponses envelopes.
func (WireErrors) WriteAdmissionReject ¶
func (WireErrors) WriteAdmissionReject(w http.ResponseWriter, d decodeqos.Decision) error
func (WireErrors) WriteBodyTooLarge ¶
func (WireErrors) WriteBodyTooLarge(w http.ResponseWriter) error
func (WireErrors) WriteEncodeFailed ¶
func (WireErrors) WriteEncodeFailed(w http.ResponseWriter) error
func (WireErrors) WriteExecuteError ¶
func (WireErrors) WriteExecuteError(w http.ResponseWriter, out execerr.Outcome) error
func (WireErrors) WriteExecutorNotConfigured ¶
func (WireErrors) WriteExecutorNotConfigured(w http.ResponseWriter) error
func (WireErrors) WriteHookError ¶
func (WireErrors) WriteHookError(w http.ResponseWriter, err error) error
func (WireErrors) WriteInvalidJSON ¶
func (WireErrors) WriteInvalidJSON(w http.ResponseWriter) error
func (WireErrors) WriteInvalidRequest ¶
func (WireErrors) WriteInvalidRequest(w http.ResponseWriter) error
func (WireErrors) WritePreflightCanceled ¶
func (WireErrors) WritePreflightCanceled(w http.ResponseWriter) error
func (WireErrors) WriteReadBodyFailed ¶
func (WireErrors) WriteReadBodyFailed(w http.ResponseWriter) error
Source Files
¶
- allowed_tools.go
- compact.go
- compact_decode.go
- config.go
- continuation.go
- continuation_storage.go
- decode.go
- diagnostics.go
- drive.go
- handler.go
- handler_pipe.go
- mount.go
- nonstreaming.go
- observed_stream.go
- profile.go
- protocol_limits.go
- streaming.go
- websocket_continuation.go
- websocket_handler.go
- websocket_queue.go
- websocket_session.go
- websocket_turn.go
- wire_errors.go