修复 AGC 确定性 E2E 与 master 合并后的运行链路
合并 master 后 isolated AppData 配置改为私有副本,避免 Windows 安全校验拒绝硬链接。 只读 runner 状态命令显式配置 config dir,避免误读为 runner 未启用。 为 debug 构建增加仅 E2E 显式开启的确定性 Provider 路由开关,并补充回归测试。 兼容 Windows 对私有副本权限位的校验差异。
This commit is contained in:
@@ -1948,6 +1948,7 @@ async function runE2e(options) {
|
|||||||
...process.env,
|
...process.env,
|
||||||
NO_COLOR: '1',
|
NO_COLOR: '1',
|
||||||
[platformSessionFixtureEnv]: fixturePath,
|
[platformSessionFixtureEnv]: fixturePath,
|
||||||
|
GENARRATIVE_AGC_DEBUG_PROVIDER_E2E: '1',
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
childReport = parseChildReport(childResult);
|
childReport = parseChildReport(childResult);
|
||||||
|
|||||||
@@ -773,7 +773,8 @@ export async function prepareIsolatedSuiteAppData({
|
|||||||
isScopedAgentsSuite() ||
|
isScopedAgentsSuite() ||
|
||||||
isProjectSkillSuite() ||
|
isProjectSkillSuite() ||
|
||||||
isParallelReadSuite() ||
|
isParallelReadSuite() ||
|
||||||
isSupervisorSwarmSuite()
|
isSupervisorSwarmSuite() ||
|
||||||
|
isSupervisorAutonomousPlayableLaneDefenseSuite()
|
||||||
? 'private-copy'
|
? 'private-copy'
|
||||||
: 'hardlink';
|
: 'hardlink';
|
||||||
try {
|
try {
|
||||||
@@ -796,7 +797,7 @@ export async function prepareIsolatedSuiteAppData({
|
|||||||
storageMode === 'private-copy' &&
|
storageMode === 'private-copy' &&
|
||||||
(linkedMetadata.dev !== source.metadata.dev ||
|
(linkedMetadata.dev !== source.metadata.dev ||
|
||||||
linkedMetadata.ino !== source.metadata.ino) &&
|
linkedMetadata.ino !== source.metadata.ino) &&
|
||||||
(linkedMetadata.mode & 0o077) === 0;
|
(process.platform === 'win32' || (linkedMetadata.mode & 0o077) === 0);
|
||||||
const hardlinkValid =
|
const hardlinkValid =
|
||||||
storageMode === 'hardlink' &&
|
storageMode === 'hardlink' &&
|
||||||
linkedMetadata.dev === source.metadata.dev &&
|
linkedMetadata.dev === source.metadata.dev &&
|
||||||
@@ -1976,7 +1977,7 @@ export async function verifyIsolatedSuiteConfigLinksUnchanged() {
|
|||||||
linkedMetadata.ino === link.linkedIno &&
|
linkedMetadata.ino === link.linkedIno &&
|
||||||
(linkedMetadata.dev !== sourceMetadata.dev ||
|
(linkedMetadata.dev !== sourceMetadata.dev ||
|
||||||
linkedMetadata.ino !== sourceMetadata.ino) &&
|
linkedMetadata.ino !== sourceMetadata.ino) &&
|
||||||
(linkedMetadata.mode & 0o077) === 0
|
(process.platform === 'win32' || (linkedMetadata.mode & 0o077) === 0)
|
||||||
: linkedMetadata.dev === link.dev && linkedMetadata.ino === link.ino;
|
: linkedMetadata.dev === link.dev && linkedMetadata.ino === link.ino;
|
||||||
const sourceMetadataStable =
|
const sourceMetadataStable =
|
||||||
sourceMetadata.mode === link.sourceMode &&
|
sourceMetadata.mode === link.sourceMode &&
|
||||||
|
|||||||
@@ -3446,18 +3446,33 @@ pub(crate) fn migrate_legacy_game_creator_agent_mode(path: &Path) -> Result<(),
|
|||||||
/// Returns whether a real AGC build must use the authenticated API Server
|
/// Returns whether a real AGC build must use the authenticated API Server
|
||||||
/// proxy instead of any persisted provider credentials.
|
/// proxy instead of any persisted provider credentials.
|
||||||
///
|
///
|
||||||
/// Debug and release binaries intentionally share this decision. The only
|
/// Debug and release binaries intentionally share this decision. The two
|
||||||
/// exception is the Rust unit-test build, where existing tests may install an
|
/// exceptions are the Rust unit-test build and the explicitly env-gated debug
|
||||||
/// explicit loopback provider fixture; that fixture is never compiled into a
|
/// deterministic-provider E2E; their loopback fixtures are never compiled into
|
||||||
/// shipped binary and is not a runtime fallback.
|
/// or enabled inside a shipped release binary.
|
||||||
pub(crate) fn game_creator_official_llm_route_locked() -> bool {
|
pub(crate) fn game_creator_official_llm_route_locked() -> bool {
|
||||||
game_creator_official_llm_route_locked_for_build(cfg!(test))
|
!debug_provider_e2e_route_unlocked()
|
||||||
|
&& game_creator_official_llm_route_locked_for_build(cfg!(test))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn game_creator_official_llm_route_locked_for_build(is_test_build: bool) -> bool {
|
pub(crate) fn game_creator_official_llm_route_locked_for_build(is_test_build: bool) -> bool {
|
||||||
!is_test_build
|
!is_test_build
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn debug_provider_e2e_route_unlocked() -> bool {
|
||||||
|
debug_provider_e2e_route_unlocked_for_build(
|
||||||
|
cfg!(debug_assertions),
|
||||||
|
std::env::var_os("GENARRATIVE_AGC_DEBUG_PROVIDER_E2E").as_deref(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn debug_provider_e2e_route_unlocked_for_build(
|
||||||
|
debug_assertions: bool,
|
||||||
|
value: Option<&std::ffi::OsStr>,
|
||||||
|
) -> bool {
|
||||||
|
debug_assertions && value == Some(std::ffi::OsStr::new("1"))
|
||||||
|
}
|
||||||
|
|
||||||
pub(crate) fn lock_game_creator_app_config_to_official_route(config: &mut GameCreatorAppConfig) {
|
pub(crate) fn lock_game_creator_app_config_to_official_route(config: &mut GameCreatorAppConfig) {
|
||||||
if !game_creator_official_llm_route_locked() {
|
if !game_creator_official_llm_route_locked() {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -2316,7 +2316,7 @@ fn main() {
|
|||||||
app_log!("agent.runner.failed: {error}");
|
app_log!("agent.runner.failed: {error}");
|
||||||
std::process::exit(1);
|
std::process::exit(1);
|
||||||
}
|
}
|
||||||
if command.requires_external_agent_runner() {
|
if command.requires_external_agent_runner() || command.is_read_only_status() {
|
||||||
let configured = if command.is_read_only_status() {
|
let configured = if command.is_read_only_status() {
|
||||||
configure_external_agent_runner_read_only(&config_dir)
|
configure_external_agent_runner_read_only(&config_dir)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -330,6 +330,23 @@ fn official_llm_route_is_locked_for_debug_and_release_platform_builds() {
|
|||||||
assert!(!game_creator_official_llm_route_locked_for_build(true));
|
assert!(!game_creator_official_llm_route_locked_for_build(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn debug_provider_e2e_flag_only_unlocks_debug_platform_build() {
|
||||||
|
assert!(debug_provider_e2e_route_unlocked_for_build(
|
||||||
|
true,
|
||||||
|
Some(std::ffi::OsStr::new("1"))
|
||||||
|
));
|
||||||
|
assert!(!debug_provider_e2e_route_unlocked_for_build(
|
||||||
|
false,
|
||||||
|
Some(std::ffi::OsStr::new("1"))
|
||||||
|
));
|
||||||
|
assert!(!debug_provider_e2e_route_unlocked_for_build(
|
||||||
|
true,
|
||||||
|
Some(std::ffi::OsStr::new("0"))
|
||||||
|
));
|
||||||
|
assert!(!debug_provider_e2e_route_unlocked_for_build(true, None));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn codex_app_server_requires_responses_route_and_disables_native_web_search() {
|
fn codex_app_server_requires_responses_route_and_disables_native_web_search() {
|
||||||
let mut llm = GameCreatorLlmConfig::default();
|
let mut llm = GameCreatorLlmConfig::default();
|
||||||
|
|||||||
Reference in New Issue
Block a user