修复 AI 任务与历史清理的内存边界
补齐外部生成历史清理 procedure 的 SATS tuple 解析与回归测试 限制 AI 流式文本每阶段 chunk 数量并分批释放明细 修正进程内失败收口的容量检查顺序 分批删除外部生成审计事件并同步更新契约文档
This commit is contained in:
@@ -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: '清理失败',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user