修复本地Provider冒烟测试的HTML项目夹具
Project CI / Repository checks (pull_request) Successful in 3m10s
Project CI / Frontend tests (pull_request) Successful in 4m7s
Project CI / Backend tests (pull_request) Successful in 7m11s
Project CI / Native shell tests (pull_request) Successful in 18m7s

启动 Agent 前准备已有 HTML 入口以符合 JSON Generator 项目契约
失败诊断补齐退出码、终止信号及标准输出和错误输出尾部
同步冒烟测试夹具与诊断约定文档
This commit is contained in:
2026-09-09 03:50:32 +00:00
parent 3be91bf283
commit ff065dbc6c
2 changed files with 15 additions and 2 deletions
@@ -722,7 +722,7 @@ function runAgent() {
stderr += chunk.toString();
});
child.on('error', reject);
child.on('close', (code) => {
child.on('close', (code, signal) => {
const output = `${stdout}${stderr}`;
if (previewReadError) {
reject(previewReadError);
@@ -740,13 +740,24 @@ function runAgent() {
previewDom,
});
} else {
reject(new Error(output || `agent run exited with ${code}`));
reject(
new Error(
`agent run failed: exitCode=${code}, signal=${signal ?? 'none'}\n` +
`stderr tail (last 8000 characters):\n${stderr.slice(-8000)}\n` +
`stdout tail (last 4000 characters):\n${stdout.slice(-4000)}`,
),
);
}
});
});
}
async function seedLocalAsset() {
await fs.mkdir(path.join(projectRoot, 'game'), { recursive: true });
await fs.writeFile(
path.join(projectRoot, 'game/index.html'),
'<!doctype html><html lang="zh-CN"><meta charset="UTF-8"><body>还没有生成游戏</body></html>',
);
await fs.mkdir(path.join(projectRoot, 'assets/uploads'), { recursive: true });
await fs.mkdir(path.join(projectRoot, '.agent'), { recursive: true });
await seedConversationContext();