feat: wire optional progress reminders to actual requests and verified readback

This commit is contained in:
Agent Workbench Dev
2026-11-06 16:05:21 +08:00
parent 7725cb2ad8
commit 01377b24c0
21 changed files with 686 additions and 22 deletions
+15
View File
@@ -241,6 +241,21 @@ return async (request, response) => {
}
}
}
if (route === '/api/progress-reminders/settings') {
if (method === 'GET') return json(response, { enabled: store.config.progressRemindersEnabled === true });
if (method === 'POST') {
const input = await body(request);
if (!input || Object.keys(input).length !== 1 || typeof input.enabled !== 'boolean') throw new Error('进展提醒设置只接受开启或关闭。');
store.saveConfig({ progressRemindersEnabled: input.enabled }); runtime.progressRemindersChanged();
return json(response, { enabled: store.config.progressRemindersEnabled === true });
}
}
const reminderRoute = route.match(/^\/api\/sessions\/([a-f0-9-]{36})\/progress-reminders$/i);
if (method === 'GET' && reminderRoute) {
const session = store.session(reminderRoute[1]), id = url.searchParams.get('run') || session.runId;
const run = store.owned('run', id, session.id);
return json(response, runtime.reminderManager().inspect(session, run));
}
if (method === 'GET' && route === '/api/operations') {
return json(response, inspectOperations({ store, provider, runtime, server, appDirectory, version: APP_VERSION, parameters: url.searchParams }));
}