fix: allow page clarification turns without delivery error

This commit is contained in:
john
2026-07-24 17:37:05 +08:00
parent 54637beffb
commit 412e5f149b
5 changed files with 103 additions and 2 deletions
+30
View File
@@ -536,6 +536,36 @@ test('static page run fails closed when Finish arrives without public HTML', asy
assert.match(pool.runs.get(run.id).error_message, /public HTML 交付物/);
});
test('generic page request succeeds when the assistant finishes a clarification turn', async () => {
const pool = createFakePool();
const gateway = createAgentRunGateway({
pool,
userAuth: {},
tkmindProxy: {
async startSessionForUser() {
return { id: 'session-public-page-clarification' };
},
async submitSessionReplyAndAwaitFinishForUser() {
return { ok: true, finishEvent: { type: 'Finish' } };
},
},
syncUserPagesOnSuccess: async () => ({}),
retryDelaysMs: [],
});
const run = await gateway.createRun('user-1', {
requestId: 'req-public-page-clarification',
userMessage: {
role: 'user',
content: [{ type: 'text', text: '【TKMind 路由提示】使用 static-page-publish\n帮我生成一个页面吧' }],
metadata: { displayText: '帮我生成一个页面吧' },
},
});
await waitFor(() => pool.runs.get(run.id)?.status === 'succeeded');
assert.equal(pool.runs.get(run.id).error_message, null);
});
test('Page Data run succeeds only after a generated session page is detected', async () => {
const pool = createFakePool({
sessionDeliverables: {