proxy

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 21 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package proxy supplies transport adapters for the independent Reflow core.

Index

Constants

View Source
const MaxRequestBytes = 16 << 20

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Upstream string
	Fold     core.Config
	Client   *http.Client
	// FullReplay uses known complete history instead of a parent response ID.
	// Embedded hosts may open a fresh upstream WebSocket for every HTTP round.
	FullReplay    bool
	EnableMetrics bool
	// WebSocketStream supplies stream=true to gateways that reuse HTTP request
	// bodies for socket turns. Standard Responses WebSockets omit that field.
	WebSocketStream bool
}

type FoldDecisions

type FoldDecisions struct {
	Continue                    int64 `json:"continue"`
	RuleNotMatched              int64 `json:"rule_not_matched"`
	NoEncryptedContent          int64 `json:"no_encrypted_content"`
	MaxContinue                 int64 `json:"max_continue"`
	UnresolvedParent            int64 `json:"unresolved_parent"`
	UpstreamToolAlreadyExecuted int64 `json:"upstream_tool_already_executed"`
	UpstreamTerminal            int64 `json:"upstream_terminal"`
	Other                       int64 `json:"other"`
}

Fixed labels from actual core decisions. These counters do not decide whether to continue, and never copy arbitrary upstream strings or identifiers.

type Metrics

type Metrics struct {
	Enabled                 bool          `json:"enabled"`
	Scope                   string        `json:"scope"`
	Requests                int64         `json:"requests"`
	Continuations           int64         `json:"continuations"`
	ContinuedToolResponses  int64         `json:"continued_tool_responses"`
	ContinuedToolCalls      int64         `json:"continued_tool_calls"`
	ContinuedToolResults    int64         `json:"continued_tool_results"`
	ToolTrackingDrops       int64         `json:"tool_tracking_drops"`
	Warmups                 int64         `json:"warmups"`
	Completed               int64         `json:"completed"`
	Failed                  int64         `json:"failed"`
	UsageReports            int64         `json:"usage_reports"`
	ParseErrors             int64         `json:"parse_errors"`
	UnsupportedResponses    int64         `json:"unsupported_responses"`
	InputTokens             int64         `json:"input_tokens"`
	OutputTokens            int64         `json:"output_tokens"`
	CachedTokens            int64         `json:"cached_tokens"`
	CacheWriteTokens        int64         `json:"cache_write_tokens"`
	ReasoningTokens         int64         `json:"reasoning_tokens"`
	UsageComplete           bool          `json:"usage_complete"`
	DiagnosticsVersion      int           `json:"diagnostics_version,omitempty"`
	FoldDecisions           FoldDecisions `json:"fold_decisions"`
	ReasoningTokenSamples   []int64       `json:"reasoning_token_samples,omitempty"`
	ReasoningSampleDrops    int64         `json:"reasoning_sample_drops"`
	ReasoningMissingReports int64         `json:"reasoning_missing_reports"`
}

Metrics contains process totals only: no models, accounts, identifiers or payloads. Usage is what observed streaming Responses replies reported, not a monetary charge or an estimate of unreported canceled work.

type ReplayCache

type ReplayCache struct {
	// contains filtered or unexported fields
}

ReplayCache contains only bounded in-memory state. Scopes include the credential and account fingerprint, never a user-supplied session id alone.

func NewReplayCache

func NewReplayCache() *ReplayCache

func (*ReplayCache) Remember

func (c *ReplayCache) Remember(scope string, r core.Result) func()

Remember returns an idempotent rollback that cannot remove a newer revision.

func (*ReplayCache) Resolve

func (c *ReplayCache) Resolve(scope string, body core.Object) (wire, replay core.Object)

type Server

type Server struct {
	// contains filtered or unexported fields
}

func New

func New(config Config) (*Server, error)

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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