fix(gateway): route response history through ai seam

This commit is contained in:
ZheFox
2026-07-30 20:34:41 +08:00
parent ef5f36cc2b
commit ff47d8d48a
3 changed files with 19 additions and 20 deletions
@@ -1,9 +1,8 @@
use serde_json::Value;
use aether_ai_formats::api::ResponseHistoryRecord;
use crate::ai_serving::{
maybe_build_ai_surface_stream_rewriter, AiSurfaceFinalizeError, AiSurfaceStreamRewriter,
ResponseHistoryRecord,
};
use crate::GatewayError;
+17 -17
View File
@@ -57,7 +57,7 @@ pub(crate) use aether_ai_formats::api::{
find_kiro_real_thinking_end_tag, find_kiro_real_thinking_end_tag_at_buffer_end,
find_kiro_real_thinking_start_tag, forbid_upstream_streaming_for_provider,
force_upstream_streaming_for_provider, gemini_request_is_image_generation,
implicit_sync_finalize_report_kind, is_core_error_finalize_kind,
hydrate_response_history, implicit_sync_finalize_report_kind, is_core_error_finalize_kind,
is_matching_stream_http_request, is_matching_stream_request, is_openai_image_stream_request,
is_openai_responses_compact_format, is_openai_responses_family_format,
is_openai_responses_format, kiro_crc32, map_claude_stop_reason,
@@ -88,10 +88,10 @@ pub(crate) use aether_ai_formats::api::{
provider_adaptation_descriptor_for_provider_type,
provider_adaptation_requires_eventstream_accept,
provider_adaptation_should_unwrap_stream_envelope,
provider_private_response_allows_sync_finalize, request_candidate_api_format_preference,
request_candidate_api_formats, request_conversion_kind,
request_conversion_requires_enable_flag, request_path_implies_stream_request,
resolve_claude_stream_spec, resolve_claude_sync_spec,
provider_private_response_allows_sync_finalize, record_converted_response_history,
request_candidate_api_format_preference, request_candidate_api_formats,
request_conversion_kind, request_conversion_requires_enable_flag,
request_path_implies_stream_request, resolve_claude_stream_spec, resolve_claude_sync_spec,
resolve_codex_responses_model_capabilities, resolve_execution_runtime_stream_plan_kind,
resolve_execution_runtime_stream_plan_kind_with_client_surface,
resolve_execution_runtime_sync_plan_kind,
@@ -105,14 +105,14 @@ pub(crate) use aether_ai_formats::api::{
resolve_openai_responses_sync_spec, resolve_requested_gemini_image_model_for_request,
resolve_requested_openai_image_model_for_request,
resolve_upstream_is_stream_for_provider as resolve_format_upstream_is_stream_for_provider,
resolve_upstream_is_stream_from_endpoint_config, sanitize_request_path,
sanitize_request_path_and_query, sanitize_request_query_string,
stream_body_contains_error_event, supports_stream_execution_decision_kind,
supports_sync_execution_decision_kind, sync_chat_response_conversion_kind,
sync_cli_response_conversion_kind, transform_provider_private_stream_line,
validate_openai_provider_request_contract, value_as_u64, AiControlPlanRequest,
AiSurfaceFinalizeError, AiSurfaceStreamRewriter, CanonicalStreamFrame,
ChatGptWebImageRequestError, ClaudeClientEmitter, ClaudeProviderState,
resolve_upstream_is_stream_from_endpoint_config, response_history_is_loaded,
response_history_storage_key, sanitize_request_path, sanitize_request_path_and_query,
sanitize_request_query_string, stream_body_contains_error_event,
supports_stream_execution_decision_kind, supports_sync_execution_decision_kind,
sync_chat_response_conversion_kind, sync_cli_response_conversion_kind,
transform_provider_private_stream_line, validate_openai_provider_request_contract,
value_as_u64, AiControlPlanRequest, AiSurfaceFinalizeError, AiSurfaceStreamRewriter,
CanonicalStreamFrame, ChatGptWebImageRequestError, ClaudeClientEmitter, ClaudeProviderState,
CodexResponsesModelCapabilities, ExecutionRuntimeAuthContext, FinalizeStreamRewriteMode,
FormatContext, GeminiClientEmitter, GeminiImageRequestForOpenAi, GeminiProviderState,
KiroToClaudeCliStreamState, LocalCoreSyncErrorKind, LocalGeminiFilesSpec, LocalOpenAiImageSpec,
@@ -124,10 +124,10 @@ pub(crate) use aether_ai_formats::api::{
OpenAiImageRequestForGemini, OpenAiImageResponseFormat, OpenAiImageStreamState,
OpenAiImageSyncFinalizeProduct, OpenAiProviderRequestFinalization,
ProviderAdaptationDescriptor, ProviderAdaptationSurface, ProviderPrivateStreamNormalizer,
ReasoningEffort, RequestConversionKind, ServiceTier, StandardCrossFormatSyncProduct,
StandardSyncFinalizeNormalizedProduct, StreamingStandardFormatMatrix,
SyncChatResponseConversionKind, SyncCliResponseConversionKind, SyncToStreamBridgeOutcome,
ANTIGRAVITY_V1INTERNAL_ENVELOPE_NAME, CLAUDE_CHAT_STREAM_PLAN_KIND,
ReasoningEffort, RequestConversionKind, ResponseHistoryRecord, ServiceTier,
StandardCrossFormatSyncProduct, StandardSyncFinalizeNormalizedProduct,
StreamingStandardFormatMatrix, SyncChatResponseConversionKind, SyncCliResponseConversionKind,
SyncToStreamBridgeOutcome, ANTIGRAVITY_V1INTERNAL_ENVELOPE_NAME, CLAUDE_CHAT_STREAM_PLAN_KIND,
CLAUDE_CHAT_STREAM_SUCCESS_REPORT_KIND, CLAUDE_CHAT_SYNC_ERROR_REPORT_KIND,
CLAUDE_CHAT_SYNC_FINALIZE_REPORT_KIND, CLAUDE_CHAT_SYNC_PLAN_KIND,
CLAUDE_CHAT_SYNC_SUCCESS_REPORT_KIND, CLAUDE_CLI_STREAM_PLAN_KIND,
@@ -1,4 +1,4 @@
use aether_ai_formats::api::{
use crate::ai_serving::{
hydrate_response_history, normalize_api_format_alias, record_converted_response_history,
response_history_is_loaded, response_history_storage_key, ResponseHistoryRecord,
};