fix: unblock local news page generation

This commit is contained in:
john
2026-07-25 21:55:00 +08:00
parent 793e64bfbc
commit 6b6f9ed01c
16 changed files with 1075 additions and 47 deletions
+21
View File
@@ -2652,6 +2652,7 @@ test('agent run fails non-retryably when tool gateway artifact validation fails'
test('agent run retries transient failures and then becomes terminal', async () => {
const pool = createFakePool();
const retryCancellations = [];
const gateway = createAgentRunGateway({
pool,
userAuth: {},
@@ -2663,6 +2664,10 @@ test('agent run retries transient failures and then becomes terminal', async ()
throw new Error('upstream unavailable');
},
},
cancelSessionOnRetry: async (input) => {
retryCancellations.push(input);
return { cancelled: true, skipped: false };
},
retryDelaysMs: [0, 0],
});
@@ -2674,6 +2679,22 @@ test('agent run retries transient failures and then becomes terminal', async ()
await waitFor(() => pool.runs.get(run.id)?.status === 'failed');
assert.equal(pool.runs.get(run.id).attempts, 2);
assert.match(pool.runs.get(run.id).error_message, /upstream unavailable/);
assert.deepEqual(retryCancellations, [
{
runId: run.id,
userId: 'user-1',
sessionId: 'session-1',
requestId: 'req-1',
},
]);
assert.equal(
pool.events.some(
(event) =>
event.runId === run.id
&& event.eventType === 'session_request_cancelled_for_retry',
),
true,
);
});
test('agent run queue limits concurrent execution', async () => {