fix: stabilize MindSpace local workflows

Signed-off-by: john <cynell@139.com>
This commit is contained in:
john
2026-07-12 08:12:15 +08:00
parent 32fb2cdeaf
commit a3f669d4e7
9 changed files with 107 additions and 23 deletions
+4
View File
@@ -121,6 +121,9 @@ test('runner claims job, executes reply, bills usage, and completes job', async
path: file,
};
},
async setSessionId(jobId, token, sessionId) {
calls.push(['setSessionId', jobId, token, sessionId]);
},
async completeJob(jobId, token, payload) {
calls.push(['completeJob', jobId, token, payload]);
return { id: jobId, status: payload.status ?? 'completed', resultPageId: 'page-1' };
@@ -150,6 +153,7 @@ test('runner claims job, executes reply, bills usage, and completes job', async
const result = await runner.runJob('job-1');
assert.equal(result.status, 'completed');
assert.equal(calls.some((item) => item[0] === 'setSessionId' && item[3] === 'session-1'), true);
assert.equal(calls.some((item) => item[0] === 'billSessionUsage'), true);
const completeCall = calls.find((item) => item[0] === 'completeJob');
assert.equal(completeCall[3].title, '项目周报');