调整策划调试日志默认开关
Project CI / Repository checks (pull_request) Failing after 13s
Project CI / Backend tests (pull_request) Failing after 13s
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled

npm run agc 开发启动时默认开启 design debug

其他启动方式默认不创建 .debug 目录
This commit is contained in:
2026-09-11 11:21:07 +00:00
parent 63f5a1d49e
commit fd5a4c3136
2 changed files with 12 additions and 1 deletions
@@ -20,6 +20,7 @@ import {
const appRoot = fileURLToPath(new URL('..', import.meta.url));
const repoRoot = resolve(appRoot, '../..');
const tauriCliPath = resolve(repoRoot, 'node_modules/@tauri-apps/cli/tauri.js');
const AGC_DESIGN_DEBUG_ENV = 'GENARRATIVE_AGC_DESIGN_DEBUG';
function buildTauriArguments(argv, devUrl = readAgcDevEndpoint().url) {
const args = [...argv];
@@ -108,7 +109,10 @@ async function runTauriDev(
if (!prepared || shutdownSignal) return 1;
const tauriArguments = buildTauriArguments(argv, endpoint.url);
child = spawnCli(tauriArguments, {
env: withAgcDevEndpointEnv(endpoint),
env: {
...withAgcDevEndpointEnv(endpoint),
[AGC_DESIGN_DEBUG_ENV]: '1',
},
});
const childResult = waitForCli(child);
const outcome = await Promise.race([
@@ -460,6 +460,13 @@ fn build_design_request(
// 调试队列只接收副本,写盘慢或失败时丢弃,不参与会话恢复。
fn design_debug(root: &Path, kind: &str, data: Value) {
if std::env::var("GENARRATIVE_AGC_DESIGN_DEBUG")
.ok()
.as_deref()
!= Some("1")
{
return;
}
type Entry = (PathBuf, Value);
static QUEUE: OnceLock<std::sync::mpsc::SyncSender<Entry>> = OnceLock::new();
let sender = QUEUE.get_or_init(|| {