修复 AGC 本地 Provider Smoke 路由
允许显式 Debug E2E 开关使用 loopback Provider 为 smoke 子进程透传环境并启用 Debug E2E 开关
This commit is contained in:
@@ -7,6 +7,7 @@ import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const appRoot = fileURLToPath(new URL('..', import.meta.url));
|
||||
const inheritedChildEnvironment = { ...globalThis['process']['env'] };
|
||||
const localConfigPath = path.join(appRoot, 'game-creator.config.local.json');
|
||||
const projectRoot = path.join(
|
||||
os.tmpdir(),
|
||||
@@ -671,6 +672,11 @@ function runAgent() {
|
||||
{
|
||||
cwd: appRoot,
|
||||
stdio: ['pipe', 'pipe', 'pipe'],
|
||||
env: {
|
||||
...inheritedChildEnvironment,
|
||||
// 该 smoke 只使用一次性 loopback Provider;生产路由仍保持锁定。
|
||||
GENARRATIVE_AGC_DEBUG_PROVIDER_E2E: '1',
|
||||
},
|
||||
},
|
||||
);
|
||||
let stdout = '';
|
||||
|
||||
@@ -151,16 +151,18 @@ fn build_game_creator_platform_llm_config(
|
||||
if game_creator_official_llm_route_locked() {
|
||||
return build_game_creator_official_platform_llm_config(llm);
|
||||
}
|
||||
if debug_provider_e2e_route_unlocked() {
|
||||
return build_game_creator_provider_llm_config(llm, config_path);
|
||||
}
|
||||
#[cfg(not(test))]
|
||||
{
|
||||
return Err("AGC 正式运行只允许通过 API Server 使用官方 LLM Router".to_string());
|
||||
}
|
||||
#[cfg(test)]
|
||||
build_game_creator_test_platform_llm_config(llm, config_path)
|
||||
build_game_creator_provider_llm_config(llm, config_path)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
fn build_game_creator_test_platform_llm_config(
|
||||
fn build_game_creator_provider_llm_config(
|
||||
llm: &GameCreatorLlmConfig,
|
||||
config_path: &str,
|
||||
) -> Result<LlmConfig, String> {
|
||||
|
||||
Reference in New Issue
Block a user