fix(agc): 让 run_turn 在 unix 测试构建可见,修 Linux harness 的 E0599(CI 红因)
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 6m24s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 5m3s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 6m3s
Project CI / Frontend tests (pull_request) Failing after 1m38s
Project CI / Backend tests (pull_request) Successful in 9m35s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m41s
Project CI / Native shell tests (pull_request) Successful in 10m26s
Project CI / Repository checks (pull_request) Successful in 7m50s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 6m24s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 5m3s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 6m3s
Project CI / Frontend tests (pull_request) Failing after 1m38s
Project CI / Backend tests (pull_request) Successful in 9m35s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m41s
Project CI / Native shell tests (pull_request) Successful in 10m26s
Project CI / Repository checks (pull_request) Successful in 7m50s
根因(CI run 3609 的 21864/21865/21866 日志):`cargo test --bin genarrative-ai-game-creator-shell --no-run` 在 Linux 上 `could not compile ... (bin ... test) due to 3 previous errors`,逐条是 `error[E0599]: no method named run_turn found for struct CodexAppServerConnection`(src/agent/codex_app_server/mod.rs:8284/8337/8423)。 来历:lane C 的 86478e8a5(清 dead_code 那批)给 `CodexAppServerConnection::run_turn` 与 `RunFailure::into_llm_error` 加了 `#[cfg(not(test))]` 来消除测试构建里的未用告警;但这三个调用点所在用例是 `#[cfg(unix)]`(用 chmod/权限位与假 app-server 脚本),在 Linux 的测试构建里存在并需要该方法,在 Windows 测试构建里整段不存在,所以本地/Windows 口径看不到。 修法:两个方法由 `#[cfg(not(test))]` 改为 `#[cfg(any(not(test), unix))]`(生产全平台可用 + unix 测试构建可用;Windows 测试构建仍排除,保持既有 zero-warning 口径),并加注释写清为何不能再收窄。不新增 allow、不删测试、不改实现。 验证(本地 Windows):bin 口径 0 warning / EXIT=0;--all-targets EXIT=0(test harness 实例 336 条不变);定向用例 `cargo test --bin ... -- agent::codex_app_server` 118 passed / 0 failed;cargo fmt --all --check、npm run check:encoding(5406 文件)、git diff --check 全 rc=0。 说明:AGC 壳的 Linux test 构建无法在本机复现(tauri/webkit 依赖需要 Linux 系统库,pkg-config 交叉不可用),该口径以下一轮 CI 为准;修复本身只涉及“方法缺失”这一类错误(编译器在同一次编译里报了全部 3 条,已全部覆盖)。
This commit is contained in:
@@ -3102,7 +3102,10 @@ impl CodexAppServerConnection {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
// 生产入口(非 Direct 的 app-server 回合)。`#[cfg(unix)]` 的三个 app-server 用例在**测试构建**里也会
|
||||
// 直接调用它(见下方 read-only protocol / cancel / terminal-unknown 三个用例),因此测试态只在 unix 保留;
|
||||
// Windows 测试构建用不到它,继续排除以维持 zero-warning 口径。
|
||||
#[cfg(any(not(test), unix))]
|
||||
async fn run_turn(
|
||||
&self,
|
||||
snapshot: &AgentRuntimeProviderRequestSnapshot,
|
||||
@@ -3996,7 +3999,9 @@ impl From<platform_llm::LlmError> for RunFailure {
|
||||
|
||||
impl RunFailure {
|
||||
/// 压回 `LlmError`:只给拿不到"继续返修批次"这条控制流的入口用(非 Direct 的 `run_turn`)。
|
||||
#[cfg(not(test))]
|
||||
///
|
||||
/// cfg 与 `run_turn` 保持一致:unix 的测试构建会经由 `run_turn` 调用到它。
|
||||
#[cfg(any(not(test), unix))]
|
||||
fn into_llm_error(self) -> platform_llm::LlmError {
|
||||
match self {
|
||||
Self::Failed(error) => error,
|
||||
|
||||
Reference in New Issue
Block a user