apps/edge/internal/service/single_request.go:21:	ErrSingleRequestTerminal            = errors.New("single-request: execution is terminal")
apps/edge/internal/service/single_request.go:47:// SingleRequestTerminalKind is the closed public terminal vocabulary carried
apps/edge/internal/service/single_request.go:50:type SingleRequestTerminalKind string
apps/edge/internal/service/single_request.go:53:	SingleRequestTerminalEndTurn   SingleRequestTerminalKind = "end_turn"
apps/edge/internal/service/single_request.go:54:	SingleRequestTerminalLength    SingleRequestTerminalKind = "length"
apps/edge/internal/service/single_request.go:55:	SingleRequestTerminalError     SingleRequestTerminalKind = "error"
apps/edge/internal/service/single_request.go:56:	SingleRequestTerminalCancelled SingleRequestTerminalKind = "cancelled"
apps/edge/internal/service/single_request.go:59:// SingleRequestTerminalErrorClass is the closed caller-safe failure class.
apps/edge/internal/service/single_request.go:62:type SingleRequestTerminalErrorClass string
apps/edge/internal/service/single_request.go:65:	SingleRequestTerminalErrorProvider         SingleRequestTerminalErrorClass = "provider"
apps/edge/internal/service/single_request.go:66:	SingleRequestTerminalErrorValidation       SingleRequestTerminalErrorClass = "validation"
apps/edge/internal/service/single_request.go:67:	SingleRequestTerminalErrorTimeout          SingleRequestTerminalErrorClass = "timeout"
apps/edge/internal/service/single_request.go:68:	SingleRequestTerminalErrorBudget           SingleRequestTerminalErrorClass = "budget"
apps/edge/internal/service/single_request.go:69:	SingleRequestTerminalErrorRepetition       SingleRequestTerminalErrorClass = "repetition"
apps/edge/internal/service/single_request.go:70:	SingleRequestTerminalErrorMalformed        SingleRequestTerminalErrorClass = "malformed"
apps/edge/internal/service/single_request.go:71:	SingleRequestTerminalErrorContext          SingleRequestTerminalErrorClass = "context"
apps/edge/internal/service/single_request.go:72:	SingleRequestTerminalErrorInternalTool     SingleRequestTerminalErrorClass = "internal_tool"
apps/edge/internal/service/single_request.go:73:	SingleRequestTerminalErrorWorkspaceCleanup SingleRequestTerminalErrorClass = "workspace_cleanup"
apps/edge/internal/service/single_request.go:76:// SingleRequestTerminalDisposition is a copy-safe terminal candidate. The
apps/edge/internal/service/single_request.go:77:// zero value is accepted only on legacy SingleRequestResult values, where the
apps/edge/internal/service/single_request.go:79:type SingleRequestTerminalDisposition struct {
apps/edge/internal/service/single_request.go:80:	Kind       SingleRequestTerminalKind
apps/edge/internal/service/single_request.go:81:	ErrorClass SingleRequestTerminalErrorClass
apps/edge/internal/service/single_request.go:85:func (d SingleRequestTerminalDisposition) Validate() error {
apps/edge/internal/service/single_request.go:87:	case SingleRequestTerminalEndTurn, SingleRequestTerminalLength, SingleRequestTerminalCancelled:
apps/edge/internal/service/single_request.go:92:	case SingleRequestTerminalError:
apps/edge/internal/service/single_request.go:94:		case SingleRequestTerminalErrorProvider, SingleRequestTerminalErrorValidation,
apps/edge/internal/service/single_request.go:95:			SingleRequestTerminalErrorTimeout, SingleRequestTerminalErrorBudget,
apps/edge/internal/service/single_request.go:96:			SingleRequestTerminalErrorRepetition, SingleRequestTerminalErrorMalformed,
apps/edge/internal/service/single_request.go:97:			SingleRequestTerminalErrorContext, SingleRequestTerminalErrorInternalTool,
apps/edge/internal/service/single_request.go:98:			SingleRequestTerminalErrorWorkspaceCleanup:
apps/edge/internal/service/single_request.go:108:type SingleRequestResult struct {
apps/edge/internal/service/single_request.go:110:	Terminal SingleRequestTerminalDisposition
apps/edge/internal/service/single_request.go:117:	Result    *SingleRequestResult
apps/edge/internal/service/single_request.go:118:	Terminal  *SingleRequestTerminalDisposition
apps/edge/internal/service/single_request.go:129:	Result     *SingleRequestResult
apps/edge/internal/service/single_request.go:130:	Terminal   *SingleRequestTerminalDisposition
apps/edge/internal/service/single_request.go:155:	Wait() (SingleRequestResult, error)
apps/edge/internal/service/single_request.go:166:	result          *SingleRequestResult
apps/edge/internal/service/single_request.go:167:	terminal        *SingleRequestTerminalDisposition
apps/edge/internal/service/single_request.go:360:		return ErrSingleRequestTerminal
apps/edge/internal/service/single_request.go:394:	if !validTransition && candidate != nil && candidate.Terminal.Kind == SingleRequestTerminalLength && env.Stage == SingleRequestStateFinalizing {
apps/edge/internal/service/single_request.go:413:				disposition := SingleRequestTerminalDisposition{Kind: SingleRequestTerminalError, ErrorClass: SingleRequestTerminalErrorMalformed}
apps/edge/internal/service/single_request.go:440:		h.terminal = cloneSingleRequestTerminal(&candidate.Terminal)
apps/edge/internal/service/single_request.go:520:func (h *singleRequestHandle) Wait() (SingleRequestResult, error) {
apps/edge/internal/service/single_request.go:528:	var res SingleRequestResult
apps/edge/internal/service/single_request.go:542:	disposition := SingleRequestTerminalDisposition{Kind: SingleRequestTerminalCancelled}
apps/edge/internal/service/single_request.go:546:func (h *singleRequestHandle) cancelLockedWithTerminal(terminal *SingleRequestTerminalDisposition) {
apps/edge/internal/service/single_request.go:550:	if terminal == nil || terminal.Validate() != nil || terminal.Kind != SingleRequestTerminalCancelled {
apps/edge/internal/service/single_request.go:551:		fallback := SingleRequestTerminalDisposition{Kind: SingleRequestTerminalCancelled}
apps/edge/internal/service/single_request.go:560:		h.terminal = cloneSingleRequestTerminal(terminal)
apps/edge/internal/service/single_request.go:591:func (h *singleRequestHandle) failLockedWithTerminal(err error, terminal *SingleRequestTerminalDisposition) {
apps/edge/internal/service/single_request.go:595:func (h *singleRequestHandle) failLockedWithTerminalAndObservation(err error, terminal *SingleRequestTerminalDisposition, errorClass singleRequestErrorClass) {
apps/edge/internal/service/single_request.go:599:	if terminal == nil || terminal.Validate() != nil || terminal.Kind != SingleRequestTerminalError {
apps/edge/internal/service/single_request.go:612:		h.terminal = cloneSingleRequestTerminal(terminal)
apps/edge/internal/service/single_request.go:720:			h.terminal = &SingleRequestTerminalDisposition{
apps/edge/internal/service/single_request.go:721:				Kind:       SingleRequestTerminalError,
apps/edge/internal/service/single_request.go:722:				ErrorClass: SingleRequestTerminalErrorWorkspaceCleanup,
apps/edge/internal/service/single_request.go:795:func (h *singleRequestHandle) validateEnvelopeTerminalLocked(env SingleRequestEnvelope) (*SingleRequestResult, *SingleRequestTerminalDisposition, error) {
apps/edge/internal/service/single_request.go:810:		terminal := cloneSingleRequestTerminal(env.Terminal)
apps/edge/internal/service/single_request.go:815:		if terminal.Validate() != nil || terminal.Kind != SingleRequestTerminalError {
apps/edge/internal/service/single_request.go:823:		terminal := cloneSingleRequestTerminal(env.Terminal)
apps/edge/internal/service/single_request.go:825:			terminal = &SingleRequestTerminalDisposition{Kind: SingleRequestTerminalCancelled}
apps/edge/internal/service/single_request.go:827:		if terminal.Validate() != nil || terminal.Kind != SingleRequestTerminalCancelled {
apps/edge/internal/service/single_request.go:838:		candidate := cloneSingleRequestResult(env.Result)
apps/edge/internal/service/single_request.go:840:			candidate.Terminal.Kind = SingleRequestTerminalEndTurn
apps/edge/internal/service/single_request.go:843:			(candidate.Terminal.Kind != SingleRequestTerminalEndTurn && candidate.Terminal.Kind != SingleRequestTerminalLength) {
apps/edge/internal/service/single_request.go:846:		return candidate, cloneSingleRequestTerminal(&candidate.Terminal), nil
apps/edge/internal/service/single_request.go:858:func cloneSingleRequestResult(result *SingleRequestResult) *SingleRequestResult {
apps/edge/internal/service/single_request.go:862:	return &SingleRequestResult{Output: result.Output, Terminal: result.Terminal}
apps/edge/internal/service/single_request.go:865:func cloneSingleRequestTerminal(terminal *SingleRequestTerminalDisposition) *SingleRequestTerminalDisposition {
apps/edge/internal/service/single_request.go:880:		progress.Result = cloneSingleRequestResult(h.result)
apps/edge/internal/service/single_request.go:883:		progress.Terminal = cloneSingleRequestTerminal(h.terminal)
apps/edge/internal/service/single_request.go:992:func singleRequestTerminalDispositionFromError(err error, observed singleRequestErrorClass) SingleRequestTerminalDisposition {
apps/edge/internal/service/single_request.go:993:	errorClass := SingleRequestTerminalErrorProvider
apps/edge/internal/service/single_request.go:996:		errorClass = SingleRequestTerminalErrorValidation
apps/edge/internal/service/single_request.go:998:		errorClass = SingleRequestTerminalErrorTimeout
apps/edge/internal/service/single_request.go:1000:		errorClass = SingleRequestTerminalErrorBudget
apps/edge/internal/service/single_request.go:1002:		errorClass = SingleRequestTerminalErrorInternalTool
apps/edge/internal/service/single_request.go:1004:		errorClass = SingleRequestTerminalErrorWorkspaceCleanup
apps/edge/internal/service/single_request.go:1006:		errorClass = SingleRequestTerminalErrorBudget
apps/edge/internal/service/single_request.go:1008:		errorClass = SingleRequestTerminalErrorInternalTool
apps/edge/internal/service/single_request.go:1010:		errorClass = SingleRequestTerminalErrorWorkspaceCleanup
apps/edge/internal/service/single_request.go:1012:		errorClass = SingleRequestTerminalErrorTimeout
apps/edge/internal/service/single_request.go:1017:		errorClass = SingleRequestTerminalErrorValidation
apps/edge/internal/service/single_request.go:1019:	return SingleRequestTerminalDisposition{Kind: SingleRequestTerminalError, ErrorClass: errorClass}
apps/edge/internal/service/single_request.go:1025:func singleRequestObservationErrorClass(terminal SingleRequestTerminalDisposition, err error) singleRequestErrorClass {
apps/edge/internal/service/single_request.go:1027:	case SingleRequestTerminalErrorValidation, SingleRequestTerminalErrorContext, SingleRequestTerminalErrorMalformed:
apps/edge/internal/service/single_request.go:1029:	case SingleRequestTerminalErrorTimeout:
apps/edge/internal/service/single_request.go:1031:	case SingleRequestTerminalErrorBudget, SingleRequestTerminalErrorRepetition:
apps/edge/internal/service/single_request.go:1033:	case SingleRequestTerminalErrorInternalTool:
apps/edge/internal/service/single_request.go:1035:	case SingleRequestTerminalErrorWorkspaceCleanup:
apps/edge/internal/service/single_request.go:1037:	case SingleRequestTerminalErrorProvider:
apps/edge/internal/service/single_request_artifact.go:123:		return nil, ErrSingleRequestTerminal
apps/edge/internal/service/single_request_artifact_test.go:102:			envelope.Result = &SingleRequestResult{Output: "artifact lifecycle complete"}
apps/edge/internal/service/single_request_artifact_test.go:179:				final.Result = &SingleRequestResult{Output: "ready after artifact"}
apps/edge/internal/service/single_request_cleanup_test.go:193:		return submitToFinalizing(req, ctrl, &SingleRequestResult{Output: "no workspace"})
apps/edge/internal/service/single_request_observation_test.go:329:		return submitToFinalizing(req, ctrl, &SingleRequestResult{Output: "success"})
apps/edge/internal/service/single_request_observation_test.go:762:		Result: &SingleRequestResult{Output: "final result"},
apps/edge/internal/service/single_request_observation_test.go:774:			return submitToFinalizing(req, ctrl, &SingleRequestResult{Output: "success"})
apps/edge/internal/service/single_request_observation_test.go:796:			return submitToFinalizing(req, ctrl, &SingleRequestResult{Output: "candidate"})
apps/edge/internal/service/single_request_test.go:41:func submitToFinalizing(req SingleRequestRequest, ctrl SingleRequestController, result *SingleRequestResult) error {
apps/edge/internal/service/single_request_test.go:76:func waitForExecution(t *testing.T, handle SingleRequestExecution) (SingleRequestResult, error) {
apps/edge/internal/service/single_request_test.go:79:		result SingleRequestResult
apps/edge/internal/service/single_request_test.go:92:		return SingleRequestResult{}, nil
apps/edge/internal/service/single_request_test.go:120:	result := &SingleRequestResult{Output: "accepted result"}
apps/edge/internal/service/single_request_test.go:156:		if err := submitToFinalizing(req, ctrl, &SingleRequestResult{Output: "candidate"}); err != nil {
apps/edge/internal/service/single_request_test.go:259:			env.Result = &SingleRequestResult{Output: "stale candidate"}
apps/edge/internal/service/single_request_test.go:321:		final.Result = &SingleRequestResult{Output: "raw executor result"}
apps/edge/internal/service/single_request_test.go:373:func TestSingleRequestTerminalRaces(t *testing.T) {
apps/edge/internal/service/single_request_test.go:377:			if err := submitToFinalizing(req, ctrl, &SingleRequestResult{Output: "candidate"}); err != nil {
apps/edge/internal/service/single_request_test.go:417:func TestSingleRequestTerminalDispositionValidationAndLegacyNormalization(t *testing.T) {
apps/edge/internal/service/single_request_test.go:418:	for _, invalid := range []SingleRequestTerminalDisposition{
apps/edge/internal/service/single_request_test.go:420:		{Kind: SingleRequestTerminalEndTurn, ErrorClass: SingleRequestTerminalErrorProvider},
apps/edge/internal/service/single_request_test.go:421:		{Kind: SingleRequestTerminalError},
apps/edge/internal/service/single_request_test.go:422:		{Kind: SingleRequestTerminalError, ErrorClass: "raw-private-value"},
apps/edge/internal/service/single_request_test.go:431:		return submitToFinalizing(req, ctrl, &SingleRequestResult{Output: "legacy output"})
apps/edge/internal/service/single_request_test.go:434:	var terminal *SingleRequestTerminalDisposition
apps/edge/internal/service/single_request_test.go:439:			if progress.Result == nil || progress.Result.Terminal.Kind != SingleRequestTerminalEndTurn {
apps/edge/internal/service/single_request_test.go:444:	terminal.Kind = SingleRequestTerminalLength
apps/edge/internal/service/single_request_test.go:449:	if err != nil || result.Terminal.Kind != SingleRequestTerminalEndTurn {
apps/edge/internal/service/single_request_test.go:454:func TestSingleRequestTerminalDispositionEarlyLengthOnly(t *testing.T) {
apps/edge/internal/service/single_request_test.go:464:				Result:    &SingleRequestResult{Terminal: SingleRequestTerminalDisposition{Kind: SingleRequestTerminalLength}},
apps/edge/internal/service/single_request_test.go:471:				if progress.Stage != SingleRequestStateFinalizing || progress.Terminal.Kind != SingleRequestTerminalLength {
apps/edge/internal/service/single_request_test.go:480:		if err != nil || result.Terminal.Kind != SingleRequestTerminalLength || terminalCount != 1 {
apps/edge/internal/service/single_request_test.go:494:				Result:    &SingleRequestResult{Output: "invalid early success", Terminal: SingleRequestTerminalDisposition{Kind: SingleRequestTerminalEndTurn}},
apps/edge/internal/service/single_request_test.go:497:		var terminal *SingleRequestTerminalDisposition
apps/edge/internal/service/single_request_test.go:504:		want := SingleRequestTerminalDisposition{Kind: SingleRequestTerminalError, ErrorClass: SingleRequestTerminalErrorValidation}
apps/edge/internal/service/single_request_test.go:511:func TestSingleRequestTerminalDispositionFailureAndCancelPropagation(t *testing.T) {
apps/edge/internal/service/single_request_test.go:515:		terminal SingleRequestTerminalDisposition
apps/edge/internal/service/single_request_test.go:517:		{name: "provider", stage: SingleRequestStateFailed, terminal: SingleRequestTerminalDisposition{Kind: SingleRequestTerminalError, ErrorClass: SingleRequestTerminalErrorProvider}},
apps/edge/internal/service/single_request_test.go:518:		{name: "timeout", stage: SingleRequestStateFailed, terminal: SingleRequestTerminalDisposition{Kind: SingleRequestTerminalError, ErrorClass: SingleRequestTerminalErrorTimeout}},
apps/edge/internal/service/single_request_test.go:519:		{name: "budget", stage: SingleRequestStateFailed, terminal: SingleRequestTerminalDisposition{Kind: SingleRequestTerminalError, ErrorClass: SingleRequestTerminalErrorBudget}},
apps/edge/internal/service/single_request_test.go:520:		{name: "repetition", stage: SingleRequestStateFailed, terminal: SingleRequestTerminalDisposition{Kind: SingleRequestTerminalError, ErrorClass: SingleRequestTerminalErrorRepetition}},
apps/edge/internal/service/single_request_test.go:521:		{name: "malformed", stage: SingleRequestStateFailed, terminal: SingleRequestTerminalDisposition{Kind: SingleRequestTerminalError, ErrorClass: SingleRequestTerminalErrorMalformed}},
apps/edge/internal/service/single_request_test.go:522:		{name: "context", stage: SingleRequestStateFailed, terminal: SingleRequestTerminalDisposition{Kind: SingleRequestTerminalError, ErrorClass: SingleRequestTerminalErrorContext}},
apps/edge/internal/service/single_request_test.go:523:		{name: "cancel", stage: SingleRequestStateCancelled, terminal: SingleRequestTerminalDisposition{Kind: SingleRequestTerminalCancelled}},
apps/edge/internal/service/single_request_test.go:539:			var got *SingleRequestTerminalDisposition
apps/edge/internal/service/single_request_test.go:561:func TestSingleRequestTerminalDispositionCleanupConversionBeforeFreeze(t *testing.T) {
apps/edge/internal/service/single_request_test.go:568:		return submitToFinalizing(req, ctrl, &SingleRequestResult{
apps/edge/internal/service/single_request_test.go:570:			Terminal: SingleRequestTerminalDisposition{Kind: SingleRequestTerminalLength},
apps/edge/internal/service/single_request_test.go:577:	var got *SingleRequestTerminalDisposition
apps/edge/internal/service/single_request_test.go:583:	want := SingleRequestTerminalDisposition{Kind: SingleRequestTerminalError, ErrorClass: SingleRequestTerminalErrorWorkspaceCleanup}
apps/edge/internal/service/single_request_test.go:589:func TestSingleRequestTerminalDispositionPostFreezeWinnerStability(t *testing.T) {
apps/edge/internal/service/single_request_test.go:591:		return submitToFinalizing(req, ctrl, &SingleRequestResult{Output: "candidate", Terminal: SingleRequestTerminalDisposition{Kind: SingleRequestTerminalEndTurn}})
apps/edge/internal/service/single_request_test.go:599:		if progress.Terminal == nil || progress.Terminal.Kind != SingleRequestTerminalEndTurn {
apps/edge/internal/service/single_request_test.go:602:		progress.Terminal.Kind = SingleRequestTerminalLength
apps/edge/internal/service/single_request_test.go:614:	frozen := cloneSingleRequestTerminal(internal.terminal)
apps/edge/internal/service/single_request_test.go:616:	if frozen == nil || frozen.Kind != SingleRequestTerminalEndTurn {
apps/edge/internal/service/single_request_tool_loop.go:190:				SingleRequestTerminalDisposition{Kind: SingleRequestTerminalError, ErrorClass: SingleRequestTerminalErrorTimeout},
apps/edge/internal/service/single_request_tool_loop.go:286:func (h *singleRequestHandle) failInternalWorkspaceToolWithTerminal(err error, terminal SingleRequestTerminalDisposition, errorClass singleRequestErrorClass) {
apps/edge/internal/service/single_request_tool_loop_test.go:69:			envelope.Result = &SingleRequestResult{Output: "private tools completed"}
apps/edge/internal/openai/anthropic_handler.go:58:// singleRequestAnthropicTerminalPolicy is the one buffered/SSE projection of
apps/edge/internal/openai/anthropic_handler.go:61:type singleRequestAnthropicTerminalPolicy struct {
apps/edge/internal/openai/anthropic_handler.go:70:func singleRequestAnthropicPolicy(disposition edgeservice.SingleRequestTerminalDisposition) singleRequestAnthropicTerminalPolicy {
apps/edge/internal/openai/anthropic_handler.go:72:		disposition.Kind = edgeservice.SingleRequestTerminalEndTurn
apps/edge/internal/openai/anthropic_handler.go:75:		disposition = edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorProvider}
apps/edge/internal/openai/anthropic_handler.go:78:	case edgeservice.SingleRequestTerminalEndTurn:
apps/edge/internal/openai/anthropic_handler.go:79:		return singleRequestAnthropicTerminalPolicy{status: http.StatusOK, stopReason: "end_turn"}
apps/edge/internal/openai/anthropic_handler.go:80:	case edgeservice.SingleRequestTerminalLength:
apps/edge/internal/openai/anthropic_handler.go:81:		return singleRequestAnthropicTerminalPolicy{status: http.StatusOK, stopReason: "max_tokens"}
apps/edge/internal/openai/anthropic_handler.go:82:	case edgeservice.SingleRequestTerminalCancelled:
apps/edge/internal/openai/anthropic_handler.go:83:		return singleRequestAnthropicTerminalPolicy{silent: true}
apps/edge/internal/openai/anthropic_handler.go:84:	case edgeservice.SingleRequestTerminalError:
apps/edge/internal/openai/anthropic_handler.go:86:		case edgeservice.SingleRequestTerminalErrorValidation:
apps/edge/internal/openai/anthropic_handler.go:87:			return singleRequestAnthropicTerminalPolicy{status: http.StatusBadRequest, errorType: "invalid_request_error", message: "single-request execution was rejected", errorTerminal: true}
apps/edge/internal/openai/anthropic_handler.go:88:		case edgeservice.SingleRequestTerminalErrorContext:
apps/edge/internal/openai/anthropic_handler.go:89:			return singleRequestAnthropicTerminalPolicy{status: http.StatusBadRequest, errorType: "invalid_request_error", message: "single-request context limit exceeded", errorTerminal: true}
apps/edge/internal/openai/anthropic_handler.go:90:		case edgeservice.SingleRequestTerminalErrorTimeout:
apps/edge/internal/openai/anthropic_handler.go:91:			return singleRequestAnthropicTerminalPolicy{status: http.StatusBadGateway, errorType: "api_error", message: "single-request execution timed out", errorTerminal: true}
apps/edge/internal/openai/anthropic_handler.go:93:			return singleRequestAnthropicTerminalPolicy{status: http.StatusBadGateway, errorType: "api_error", message: "single-request execution failed", errorTerminal: true}
apps/edge/internal/openai/anthropic_handler.go:96:		return singleRequestAnthropicTerminalPolicy{status: http.StatusBadGateway, errorType: "api_error", message: "single-request execution failed", errorTerminal: true}
apps/edge/internal/openai/anthropic_handler.go:335:				writeErr := writeAnthropicSingleRequestTerminal(w, requestID, dispatch.SingleRequest.PublicModel, *progress.Result)
apps/edge/internal/openai/anthropic_handler.go:339:				writeAnthropicSingleRequestError(w, singleRequestProgressTerminal(progress, edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorProvider}))
apps/edge/internal/openai/anthropic_handler.go:354:func singleRequestProgressTerminal(progress edgeservice.SingleRequestProgress, fallback edgeservice.SingleRequestTerminalDisposition) edgeservice.SingleRequestTerminalDisposition {
apps/edge/internal/openai/anthropic_handler.go:361:func writeAnthropicSingleRequestError(w http.ResponseWriter, disposition edgeservice.SingleRequestTerminalDisposition) {
apps/edge/internal/openai/anthropic_handler.go:362:	policy := singleRequestAnthropicPolicy(disposition)
apps/edge/internal/openai/anthropic_handler.go:367:		policy = singleRequestAnthropicPolicy(edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorProvider})
apps/edge/internal/openai/anthropic_handler.go:372:// writeAnthropicSingleRequestTerminal encodes before committing headers and
apps/edge/internal/openai/anthropic_handler.go:375:func writeAnthropicSingleRequestTerminal(w http.ResponseWriter, requestID, publicModel string, result edgeservice.SingleRequestResult) error {
apps/edge/internal/openai/anthropic_handler.go:376:	policy := singleRequestAnthropicPolicy(result.Terminal)
apps/edge/internal/openai/anthropic_handler.go:381:	if result.Terminal.Kind == edgeservice.SingleRequestTerminalLength {
apps/edge/internal/openai/single_request_anthropic_stream.go:169:func (s *singleRequestAnthropicStream) Final(result edgeservice.SingleRequestResult) error {
apps/edge/internal/openai/single_request_anthropic_stream.go:178:	policy := singleRequestAnthropicPolicy(result.Terminal)
apps/edge/internal/openai/single_request_anthropic_stream.go:186:	if result.Terminal.Kind != edgeservice.SingleRequestTerminalLength {
apps/edge/internal/openai/single_request_anthropic_stream.go:208:	disposition := edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorProvider}
apps/edge/internal/openai/single_request_anthropic_stream.go:210:		disposition = edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalCancelled}
apps/edge/internal/openai/single_request_anthropic_stream.go:215:func (s *singleRequestAnthropicStream) TerminalError(disposition edgeservice.SingleRequestTerminalDisposition) error {
apps/edge/internal/openai/single_request_anthropic_stream.go:224:	policy := singleRequestAnthropicPolicy(disposition)
apps/edge/internal/openai/single_request_anthropic_stream.go:230:		policy = singleRequestAnthropicPolicy(edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorProvider})
apps/edge/internal/openai/single_request_anthropic_stream.go:243:	disposition := edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorProvider}
apps/edge/internal/openai/single_request_anthropic_stream.go:245:		disposition = edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalCancelled}
apps/edge/internal/openai/single_request_anthropic_stream.go:247:	policy := singleRequestAnthropicPolicy(disposition)
apps/edge/internal/openai/single_request_anthropic_stream.go:389:				return stream.TerminalError(edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorProvider})
apps/edge/internal/openai/single_request_anthropic_stream.go:400:					writeErr := stream.TerminalError(edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorProvider})
apps/edge/internal/openai/single_request_anthropic_stream.go:412:				return stream.TerminalError(singleRequestProgressTerminal(progress, edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorProvider}))
apps/edge/internal/openai/single_request_anthropic_stream.go:418:				return stream.TerminalError(singleRequestProgressTerminal(progress, edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalCancelled}))
apps/edge/internal/openai/single_request_anthropic_stream.go:422:					_ = stream.TerminalError(edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorProvider})
apps/edge/internal/openai/single_request_anthropic_stream_test.go:97:	if err := stream.Final(edgeservice.SingleRequestResult{Output: "safe final result"}); err != nil {
apps/edge/internal/openai/single_request_anthropic_stream_test.go:105:	if err := stream.Final(edgeservice.SingleRequestResult{Output: "duplicate"}); err != nil {
apps/edge/internal/openai/single_request_anthropic_stream_test.go:155:		disposition edgeservice.SingleRequestTerminalDisposition
apps/edge/internal/openai/single_request_anthropic_stream_test.go:161:		{name: "end turn", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalEndTurn}, wantStop: "end_turn"},
apps/edge/internal/openai/single_request_anthropic_stream_test.go:162:		{name: "length", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalLength}, wantStop: "max_tokens"},
apps/edge/internal/openai/single_request_anthropic_stream_test.go:163:		{name: "cancelled", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalCancelled}, silent: true},
apps/edge/internal/openai/single_request_anthropic_stream_test.go:164:		{name: "provider", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorProvider}, wantType: "api_error", wantMessage: "single-request execution failed"},
apps/edge/internal/openai/single_request_anthropic_stream_test.go:165:		{name: "validation", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorValidation}, wantType: "invalid_request_error", wantMessage: "single-request execution was rejected"},
apps/edge/internal/openai/single_request_anthropic_stream_test.go:166:		{name: "timeout", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorTimeout}, wantType: "api_error", wantMessage: "single-request execution timed out"},
apps/edge/internal/openai/single_request_anthropic_stream_test.go:167:		{name: "budget", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorBudget}, wantType: "api_error", wantMessage: "single-request execution failed"},
apps/edge/internal/openai/single_request_anthropic_stream_test.go:168:		{name: "repetition", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorRepetition}, wantType: "api_error", wantMessage: "single-request execution failed"},
apps/edge/internal/openai/single_request_anthropic_stream_test.go:169:		{name: "malformed", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorMalformed}, wantType: "api_error", wantMessage: "single-request execution failed"},
apps/edge/internal/openai/single_request_anthropic_stream_test.go:170:		{name: "context", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorContext}, wantType: "invalid_request_error", wantMessage: "single-request context limit exceeded"},
apps/edge/internal/openai/single_request_anthropic_stream_test.go:171:		{name: "internal tool", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorInternalTool}, wantType: "api_error", wantMessage: "single-request execution failed"},
apps/edge/internal/openai/single_request_anthropic_stream_test.go:172:		{name: "workspace cleanup", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorWorkspaceCleanup}, wantType: "api_error", wantMessage: "single-request execution failed"},
apps/edge/internal/openai/single_request_anthropic_stream_test.go:186:			case edgeservice.SingleRequestTerminalEndTurn:
apps/edge/internal/openai/single_request_anthropic_stream_test.go:187:				err = stream.Final(edgeservice.SingleRequestResult{Output: "safe final result", Terminal: tc.disposition})
apps/edge/internal/openai/single_request_anthropic_stream_test.go:188:			case edgeservice.SingleRequestTerminalLength:
apps/edge/internal/openai/single_request_anthropic_stream_test.go:189:				err = stream.Final(edgeservice.SingleRequestResult{Output: privatePartial, Terminal: tc.disposition})
apps/edge/internal/openai/single_request_anthropic_stream_test.go:197:			if err := stream.TerminalError(edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorProvider}); err != nil {
apps/edge/internal/openai/single_request_anthropic_stream_test.go:200:			if err := stream.Final(edgeservice.SingleRequestResult{Output: "duplicate"}); err != nil {
apps/edge/internal/openai/single_request_anthropic_stream_test.go:228:				if tc.disposition.Kind == edgeservice.SingleRequestTerminalLength && len(singleRequestAnthropicDeltaTexts(events)) != 0 {
apps/edge/internal/openai/single_request_anthropic_stream_test.go:262:	if err := stream.Final(edgeservice.SingleRequestResult{Output: "done"}); err != nil {
apps/edge/internal/openai/single_request_anthropic_stream_test.go:301:	if err := stream.Final(edgeservice.SingleRequestResult{Output: "repaired"}); err != nil {
apps/edge/internal/openai/single_request_anthropic_stream_test.go:320:		Result:  &edgeservice.SingleRequestResult{Output: private},
apps/edge/internal/openai/single_request_anthropic_stream_test.go:363:				_ = stream.Final(edgeservice.SingleRequestResult{Output: "safe"})
apps/edge/internal/openai/single_request_anthropic_stream_test.go:535:				envelope.Result = &edgeservice.SingleRequestResult{Output: "safe final"}
apps/edge/internal/openai/single_request_anthropic_stream_test.go:609:				envelope.Result = &edgeservice.SingleRequestResult{Output: "safe final"}
apps/edge/internal/openai/single_request_anthropic_stream_test.go:654:				envelope.Result = &edgeservice.SingleRequestResult{Output: "safe final"}
apps/edge/internal/openai/single_request_executor.go:121:			disposition = edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalCancelled}
apps/edge/internal/openai/single_request_executor.go:123:			disposition = edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorTimeout}
apps/edge/internal/openai/single_request_executor.go:125:			disposition = edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorProvider}
apps/edge/internal/openai/single_request_executor.go:131:	case edgeservice.SingleRequestTerminalLength:
apps/edge/internal/openai/single_request_executor.go:135:			Result: &edgeservice.SingleRequestResult{
apps/edge/internal/openai/single_request_executor.go:139:	case edgeservice.SingleRequestTerminalCancelled:
apps/edge/internal/openai/single_request_executor.go:142:		if disposition.Kind != edgeservice.SingleRequestTerminalError || disposition.Validate() != nil {
apps/edge/internal/openai/single_request_executor.go:143:			disposition = edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorProvider}
apps/edge/internal/openai/single_request_executor.go:152:	if err := ctrl.SubmitEnvelope(envelope); err != nil && !errors.Is(err, edgeservice.ErrSingleRequestTerminal) {
apps/edge/internal/openai/single_request_executor_test.go:86:func waitExecutionResult(exec edgeservice.SingleRequestExecution) (edgeservice.SingleRequestResult, error) {
apps/edge/internal/openai/single_request_handler_test.go:162:			envelope.Result = &edgeservice.SingleRequestResult{Output: result}
apps/edge/internal/openai/single_request_handler_test.go:296:		disposition edgeservice.SingleRequestTerminalDisposition
apps/edge/internal/openai/single_request_handler_test.go:303:		{name: "end turn", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalEndTurn}, wantStatus: http.StatusOK, wantStop: "end_turn"},
apps/edge/internal/openai/single_request_handler_test.go:304:		{name: "length", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalLength}, wantStatus: http.StatusOK, wantStop: "max_tokens"},
apps/edge/internal/openai/single_request_handler_test.go:305:		{name: "cancelled", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalCancelled}, silent: true},
apps/edge/internal/openai/single_request_handler_test.go:306:		{name: "provider", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorProvider}, wantStatus: http.StatusBadGateway, wantType: "api_error", wantMessage: "single-request execution failed"},
apps/edge/internal/openai/single_request_handler_test.go:307:		{name: "validation", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorValidation}, wantStatus: http.StatusBadRequest, wantType: "invalid_request_error", wantMessage: "single-request execution was rejected"},
apps/edge/internal/openai/single_request_handler_test.go:308:		{name: "timeout", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorTimeout}, wantStatus: http.StatusBadGateway, wantType: "api_error", wantMessage: "single-request execution timed out"},
apps/edge/internal/openai/single_request_handler_test.go:309:		{name: "budget", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorBudget}, wantStatus: http.StatusBadGateway, wantType: "api_error", wantMessage: "single-request execution failed"},
apps/edge/internal/openai/single_request_handler_test.go:310:		{name: "repetition", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorRepetition}, wantStatus: http.StatusBadGateway, wantType: "api_error", wantMessage: "single-request execution failed"},
apps/edge/internal/openai/single_request_handler_test.go:311:		{name: "malformed", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorMalformed}, wantStatus: http.StatusBadGateway, wantType: "api_error", wantMessage: "single-request execution failed"},
apps/edge/internal/openai/single_request_handler_test.go:312:		{name: "context", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorContext}, wantStatus: http.StatusBadRequest, wantType: "invalid_request_error", wantMessage: "single-request context limit exceeded"},
apps/edge/internal/openai/single_request_handler_test.go:313:		{name: "internal tool", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorInternalTool}, wantStatus: http.StatusBadGateway, wantType: "api_error", wantMessage: "single-request execution failed"},
apps/edge/internal/openai/single_request_handler_test.go:314:		{name: "workspace cleanup", disposition: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorWorkspaceCleanup}, wantStatus: http.StatusBadGateway, wantType: "api_error", wantMessage: "single-request execution failed"},
apps/edge/internal/openai/single_request_handler_test.go:328:				case edgeservice.SingleRequestTerminalEndTurn, edgeservice.SingleRequestTerminalLength:
apps/edge/internal/openai/single_request_handler_test.go:335:					if tc.disposition.Kind == edgeservice.SingleRequestTerminalLength {
apps/edge/internal/openai/single_request_handler_test.go:342:						Result:    &edgeservice.SingleRequestResult{Output: output, Terminal: tc.disposition},
apps/edge/internal/openai/single_request_handler_test.go:344:				case edgeservice.SingleRequestTerminalCancelled:
apps/edge/internal/openai/single_request_handler_test.go:379:				if tc.disposition.Kind == edgeservice.SingleRequestTerminalLength && len(response.Content) != 0 {
apps/edge/internal/openai/single_request_handler_test.go:457:			envelope.Result = &edgeservice.SingleRequestResult{Output: "workspace task completed privately"}
apps/edge/internal/openai/single_request_quality_gate.go:21:	disposition edgeservice.SingleRequestTerminalDisposition
apps/edge/internal/openai/single_request_quality_gate.go:28:func singleRequestTerminalDisposition(err error) (edgeservice.SingleRequestTerminalDisposition, bool) {
apps/edge/internal/openai/single_request_quality_gate.go:31:		return edgeservice.SingleRequestTerminalDisposition{}, false
apps/edge/internal/openai/single_request_quality_gate.go:52:func (g *singleRequestQualityGate) failure(kind edgeservice.SingleRequestTerminalKind, class edgeservice.SingleRequestTerminalErrorClass, cause error) error {
apps/edge/internal/openai/single_request_quality_gate.go:53:	disposition := edgeservice.SingleRequestTerminalDisposition{Kind: kind, ErrorClass: class}
apps/edge/internal/openai/single_request_quality_gate.go:55:		disposition = edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorProvider}
apps/edge/internal/openai/single_request_quality_gate.go:73:		return g.failure(edgeservice.SingleRequestTerminalCancelled, "", cause)
apps/edge/internal/openai/single_request_quality_gate.go:75:		return g.failure(edgeservice.SingleRequestTerminalError, edgeservice.SingleRequestTerminalErrorTimeout, cause)
apps/edge/internal/openai/single_request_quality_gate.go:77:		return g.failure(edgeservice.SingleRequestTerminalLength, "", cause)
apps/edge/internal/openai/single_request_quality_gate.go:79:		return g.failure(edgeservice.SingleRequestTerminalError, edgeservice.SingleRequestTerminalErrorContext, cause)
apps/edge/internal/openai/single_request_quality_gate.go:81:		return g.failure(edgeservice.SingleRequestTerminalError, edgeservice.SingleRequestTerminalErrorMalformed, cause)
apps/edge/internal/openai/single_request_quality_gate.go:83:		return g.failure(edgeservice.SingleRequestTerminalError, edgeservice.SingleRequestTerminalErrorProvider, cause)
apps/edge/internal/openai/single_request_quality_gate.go:88:	return g.failure(edgeservice.SingleRequestTerminalError, edgeservice.SingleRequestTerminalErrorValidation, cause)
apps/edge/internal/openai/single_request_quality_gate.go:92:	return g.failure(edgeservice.SingleRequestTerminalError, edgeservice.SingleRequestTerminalErrorMalformed, cause)
apps/edge/internal/openai/single_request_quality_gate.go:96:	return g.failure(edgeservice.SingleRequestTerminalError, edgeservice.SingleRequestTerminalErrorBudget, cause)
apps/edge/internal/openai/single_request_quality_gate.go:100:	return g.failure(edgeservice.SingleRequestTerminalLength, "", cause)
apps/edge/internal/openai/single_request_quality_gate.go:104:	return g.failure(edgeservice.SingleRequestTerminalError, edgeservice.SingleRequestTerminalErrorContext, cause)
apps/edge/internal/openai/single_request_quality_gate.go:108:	return g.failure(edgeservice.SingleRequestTerminalError, edgeservice.SingleRequestTerminalErrorInternalTool, cause)
apps/edge/internal/openai/single_request_quality_gate.go:117:		return g.failure(edgeservice.SingleRequestTerminalCancelled, "", cause)
apps/edge/internal/openai/single_request_quality_gate.go:119:		return g.failure(edgeservice.SingleRequestTerminalError, edgeservice.SingleRequestTerminalErrorTimeout, cause)
apps/edge/internal/openai/single_request_quality_gate.go:139:			return g.failure(edgeservice.SingleRequestTerminalError, edgeservice.SingleRequestTerminalErrorTimeout, cause)
apps/edge/internal/openai/single_request_quality_gate.go:141:			return g.failure(edgeservice.SingleRequestTerminalError, edgeservice.SingleRequestTerminalErrorInternalTool, cause)
apps/edge/internal/openai/single_request_quality_gate.go:184:		return g.failure(edgeservice.SingleRequestTerminalError, edgeservice.SingleRequestTerminalErrorRepetition, cause)
apps/edge/internal/openai/single_request_quality_gate_test.go:50:		want edgeservice.SingleRequestTerminalDisposition
apps/edge/internal/openai/single_request_quality_gate_test.go:54:		}, want: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorProvider}},
apps/edge/internal/openai/single_request_quality_gate_test.go:57:		}, want: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorTimeout}},
apps/edge/internal/openai/single_request_quality_gate_test.go:58:		{name: "stage budget", err: func(g *singleRequestQualityGate) error { return g.budget(errSingleRequestWorkStage) }, want: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorBudget}},
apps/edge/internal/openai/single_request_quality_gate_test.go:59:		{name: "malformed call", err: func(g *singleRequestQualityGate) error { return g.malformed(errSingleRequestWorkStage) }, want: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorMalformed}},
apps/edge/internal/openai/single_request_quality_gate_test.go:60:		{name: "context limit", err: func(g *singleRequestQualityGate) error { return g.contextLimit(errSingleRequestPlanStage) }, want: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorContext}},
apps/edge/internal/openai/single_request_quality_gate_test.go:61:		{name: "output limit", err: func(g *singleRequestQualityGate) error { return g.length(errSingleRequestReviewStage) }, want: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalLength}},
apps/edge/internal/openai/single_request_quality_gate_test.go:64:		}, want: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalCancelled}},
apps/edge/internal/openai/single_request_quality_gate_test.go:65:		{name: "tool failure", err: func(g *singleRequestQualityGate) error { return g.internalTool(errSingleRequestWorkStage) }, want: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorInternalTool}},
apps/edge/internal/openai/single_request_quality_gate_test.go:86:			case edgeservice.SingleRequestTerminalLength:
apps/edge/internal/openai/single_request_quality_gate_test.go:90:			case edgeservice.SingleRequestTerminalCancelled:
apps/edge/internal/openai/single_request_quality_gate_test.go:110:		want edgeservice.SingleRequestTerminalDisposition
apps/edge/internal/openai/single_request_quality_gate_test.go:112:		{name: "length", body: finishBody("length"), want: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalLength}},
apps/edge/internal/openai/single_request_quality_gate_test.go:113:		{name: "context", body: finishBody("context_length_exceeded"), want: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorContext}},
apps/edge/internal/openai/single_request_quality_gate_test.go:114:		{name: "malformed", body: []byte(`{"private":"value"}`), want: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorMalformed}},
apps/edge/internal/openai/single_request_quality_gate_test.go:139:		want        edgeservice.SingleRequestTerminalDisposition
apps/edge/internal/openai/single_request_quality_gate_test.go:141:		{name: "provider", dispatchErr: errors.New("PRIVATE_PROVIDER_ERROR"), want: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorProvider}},
apps/edge/internal/openai/single_request_quality_gate_test.go:142:		{name: "timeout", dispatchErr: context.DeadlineExceeded, want: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorTimeout}},
apps/edge/internal/openai/single_request_quality_gate_test.go:143:		{name: "length", body: finishBody("length"), want: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalLength}},
apps/edge/internal/openai/single_request_quality_gate_test.go:144:		{name: "context", body: finishBody("context_length_exceeded"), want: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorContext}},
apps/edge/internal/openai/single_request_quality_gate_test.go:145:		{name: "malformed", body: []byte(`{"private":"provider payload"}`), want: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorMalformed}},
apps/edge/internal/openai/single_request_quality_gate_test.go:164:			var terminal edgeservice.SingleRequestTerminalDisposition
apps/edge/internal/openai/single_request_quality_gate_test.go:181:			if test.want.Kind == edgeservice.SingleRequestTerminalLength {
apps/edge/internal/openai/single_request_quality_gate_test.go:200:		want          edgeservice.SingleRequestTerminalDisposition
apps/edge/internal/openai/single_request_quality_gate_test.go:212:			want:          edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorBudget},
apps/edge/internal/openai/single_request_quality_gate_test.go:223:			want:          edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorMalformed},
apps/edge/internal/openai/single_request_quality_gate_test.go:246:			var terminal edgeservice.SingleRequestTerminalDisposition
apps/edge/internal/openai/single_request_quality_gate_test.go:286:	var terminal edgeservice.SingleRequestTerminalDisposition
apps/edge/internal/openai/single_request_quality_gate_test.go:294:	want := edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorRepetition}
apps/edge/internal/openai/single_request_quality_gate_test.go:329:	var terminal edgeservice.SingleRequestTerminalDisposition
apps/edge/internal/openai/single_request_quality_gate_test.go:338:	want := edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalError, ErrorClass: edgeservice.SingleRequestTerminalErrorTimeout}
apps/edge/internal/openai/single_request_review_stage.go:123:			if err := ctrl.SubmitEnvelope(edgeservice.SingleRequestEnvelope{RequestID: req.RequestID, Sequence: sequence, Stage: edgeservice.SingleRequestStateFinalizing, Result: &edgeservice.SingleRequestResult{Output: string(result.Output), Terminal: edgeservice.SingleRequestTerminalDisposition{Kind: edgeservice.SingleRequestTerminalEndTurn}}}); err != nil {
apps/edge/internal/openai/single_request_review_stage_test.go:1066:			result edgeservice.SingleRequestResult
apps/edge/internal/openai/single_request_work_stage_test.go:136:		Result:    &edgeservice.SingleRequestResult{Output: result.Completion + "\nVerification: " + result.Verification},
apps/edge/internal/openai/single_request_work_stage_test.go:406:func waitWorkExecution(t *testing.T, execution edgeservice.SingleRequestExecution) (edgeservice.SingleRequestResult, error) {
apps/edge/internal/openai/single_request_work_stage_test.go:409:		result edgeservice.SingleRequestResult
apps/edge/internal/openai/single_request_work_stage_test.go:422:		return edgeservice.SingleRequestResult{}, errors.New("unreachable")
exit=0
