修复 AI 任务与历史清理的内存边界
Project CI / Repository checks (pull_request) Successful in 17m41s
Project CI / Backend tests (pull_request) Successful in 17m53s
Project CI / Frontend tests (pull_request) Successful in 22m22s
Project CI / Native shell tests (pull_request) Successful in 28m36s

补齐外部生成历史清理 procedure 的 SATS tuple 解析与回归测试

限制 AI 流式文本每阶段 chunk 数量并分批释放明细

修正进程内失败收口的容量检查顺序

分批删除外部生成审计事件并同步更新契约文档
This commit is contained in:
2026-08-27 21:12:38 +08:00
parent 458371a73d
commit b55a225ccc
10 changed files with 287 additions and 33 deletions
+18
View File
@@ -427,6 +427,24 @@ function normalizeSatsProduct(value, procedureName) {
};
}
if (
procedureName === 'prune_external_generation_job_history_and_return' &&
value.length === 10
) {
return {
ok: normalizeSatsValue(value[0]),
dry_run: normalizeSatsValue(value[1]),
scanned_count: normalizeSatsValue(value[2]),
selected_count: normalizeSatsValue(value[3]),
deleted_job_count: normalizeSatsValue(value[4]),
deleted_summary_count: normalizeSatsValue(value[5]),
deleted_event_count: normalizeSatsValue(value[6]),
next_cursor_job_id: normalizeSatsOption(value[7]),
has_more: normalizeSatsValue(value[8]),
error_message: normalizeSatsOption(value[9]),
};
}
if (value.length === 3) {
return {
ok: normalizeSatsValue(value[0]),
@@ -223,4 +223,35 @@ describe('SpacetimeDB CLI SATS option encoding', () => {
expect(objectResult.batch_sha256).toBe('d'.repeat(64));
expect(objectResult).not.toHaveProperty('batch_sha_256');
});
it('normalizes external generation history prune tuple results', () => {
const result = parseProcedureResult(
JSON.stringify([
true,
false,
25,
2,
2,
2,
10,
[0, 'job-25'],
true,
[0, '清理失败'],
]),
'prune_external_generation_job_history_and_return',
);
expect(result).toEqual({
ok: true,
dry_run: false,
scanned_count: 25,
selected_count: 2,
deleted_job_count: 2,
deleted_summary_count: 2,
deleted_event_count: 10,
next_cursor_job_id: 'job-25',
has_more: true,
error_message: '清理失败',
});
});
});