Improve gateway transport and usage runtime

This commit is contained in:
elky
2026-06-25 22:36:27 +08:00
parent d336d1a7fa
commit 6f00e9fc67
112 changed files with 12456 additions and 1387 deletions
@@ -22,8 +22,39 @@ use aether_data_contracts::repository::provider_catalog::{
};
use sha2::{Digest, Sha256};
#[tokio::test]
async fn gateway_executes_kiro_claude_cli_stream_via_local_provider_catalog_candidate() {
const STREAM_PROVIDER_TEST_STACK_BYTES: usize = 16 * 1024 * 1024;
fn run_stream_provider_test<F, Fut>(test_name: &'static str, make_future: F)
where
F: FnOnce() -> Fut + Send + 'static,
Fut: std::future::Future<Output = ()> + 'static,
{
let handle = std::thread::Builder::new()
.name(test_name.to_string())
.stack_size(STREAM_PROVIDER_TEST_STACK_BYTES)
.spawn(move || {
let runtime = tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()
.expect("test runtime should build");
runtime.block_on(make_future());
})
.expect("stream provider test thread should spawn");
if let Err(payload) = handle.join() {
std::panic::resume_unwind(payload);
}
}
#[test]
fn gateway_executes_kiro_claude_cli_stream_via_local_provider_catalog_candidate() {
run_stream_provider_test(
"gateway_executes_kiro_claude_cli_stream_via_local_provider_catalog_candidate",
gateway_executes_kiro_claude_cli_stream_via_local_provider_catalog_candidate_impl,
);
}
async fn gateway_executes_kiro_claude_cli_stream_via_local_provider_catalog_candidate_impl() {
use base64::Engine as _;
#[derive(Debug, Clone)]
@@ -578,8 +609,16 @@ async fn gateway_executes_kiro_claude_cli_stream_via_local_provider_catalog_cand
upstream_handle.abort();
}
#[tokio::test]
async fn gateway_executes_claude_cli_stream_via_local_decision_gate_without_waiting_for_same_format_prefetch(
#[test]
fn gateway_executes_claude_cli_stream_via_local_decision_gate_without_waiting_for_same_format_prefetch(
) {
run_stream_provider_test(
"gateway_executes_claude_cli_stream_via_local_decision_gate_without_waiting_for_same_format_prefetch",
gateway_executes_claude_cli_stream_via_local_decision_gate_without_waiting_for_same_format_prefetch_impl,
);
}
async fn gateway_executes_claude_cli_stream_via_local_decision_gate_without_waiting_for_same_format_prefetch_impl(
) {
#[derive(Debug, Clone)]
struct SeenExecutionRuntimeStreamRequest {
@@ -1026,8 +1065,15 @@ async fn gateway_executes_claude_cli_stream_via_local_decision_gate_without_wait
upstream_handle.abort();
}
#[tokio::test]
async fn gateway_executes_claude_code_cli_stream_via_local_decision_gate_with_local_stream_decision(
#[test]
fn gateway_executes_claude_code_cli_stream_via_local_decision_gate_with_local_stream_decision() {
run_stream_provider_test(
"gateway_executes_claude_code_cli_stream_via_local_decision_gate_with_local_stream_decision",
gateway_executes_claude_code_cli_stream_via_local_decision_gate_with_local_stream_decision_impl,
);
}
async fn gateway_executes_claude_code_cli_stream_via_local_decision_gate_with_local_stream_decision_impl(
) {
#[derive(Debug, Clone)]
struct SeenExecutionRuntimeStreamRequest {
@@ -1558,8 +1604,16 @@ async fn gateway_executes_claude_code_cli_stream_via_local_decision_gate_with_lo
upstream_handle.abort();
}
#[tokio::test]
async fn gateway_executes_claude_chat_stream_via_local_decision_gate_with_local_stream_decision() {
#[test]
fn gateway_executes_claude_chat_stream_via_local_decision_gate_with_local_stream_decision() {
run_stream_provider_test(
"gateway_executes_claude_chat_stream_via_local_decision_gate_with_local_stream_decision",
gateway_executes_claude_chat_stream_via_local_decision_gate_with_local_stream_decision_impl,
);
}
async fn gateway_executes_claude_chat_stream_via_local_decision_gate_with_local_stream_decision_impl(
) {
#[derive(Debug, Clone)]
struct SeenExecutionRuntimeStreamRequest {
trace_id: String,