fix(assistant): close review gaps in delivery and action recovery
Address PR4 comments 66-69 with safe delivery retries, capacity stops, preserved effect evidence and stale proposal rejection. Prevent archived queue snapshots from resurrecting cancelled reminders.
This commit is contained in:
1 parent
1d5dcead84
commit
5ceffb935a
24 files changed
+1425
-125
No files matched your search
@@ -59,10 +59,13 @@
|
||||
isActive: live,
|
||||
showRight: () => layout.showRight(),
|
||||
onExecute: execute,
|
||||
onReject: (id, button) => execute(id, button, true),
|
||||
onRepair: repair,
|
||||
ensureConversation,
|
||||
onScheduleChanged: async (id) => {
|
||||
if (!live() || id !== currentId) return;
|
||||
if (!live()) return;
|
||||
await refreshList();
|
||||
if (id !== currentId) return;
|
||||
if (!eventClient) await select(id);
|
||||
else await loadCurrent();
|
||||
},
|
||||
@@ -76,7 +79,9 @@
|
||||
ensureConversation,
|
||||
isActive: live,
|
||||
onChanged: async (id) => {
|
||||
if (!live() || id !== currentId) return;
|
||||
if (!live()) return;
|
||||
await refreshList();
|
||||
if (id !== currentId) return;
|
||||
if (!eventClient) await select(id);
|
||||
else await loadCurrent();
|
||||
},
|
||||
@@ -593,7 +598,7 @@
|
||||
await select(owner.id);
|
||||
panel.showActions();
|
||||
}
|
||||
async function execute(actionId, button) {
|
||||
async function execute(actionId, button, rejectOnly = false) {
|
||||
if (pendingActions.has(actionId)) return;
|
||||
const id = currentId,
|
||||
at = revision;
|
||||
@@ -605,7 +610,7 @@
|
||||
.flatMap((t) => t.actions || [])
|
||||
.find((a) => a.id === actionId);
|
||||
let body = {};
|
||||
if (['update_configuration', 'manage_schedule'].includes(action?.kind)) {
|
||||
if (!rejectOnly && ['update_configuration', 'manage_schedule'].includes(action?.kind)) {
|
||||
body = await window.AssistantSettingsReview.open(root, {
|
||||
api,
|
||||
id,
|
||||
@@ -616,9 +621,17 @@
|
||||
}
|
||||
if (!live() || id !== currentId || revision !== at) return;
|
||||
watch();
|
||||
await api('/assistant/conversations/' + id + '/actions/' + actionId + '/execute', body, {
|
||||
managedOutcome: true,
|
||||
});
|
||||
await api(
|
||||
'/assistant/conversations/' +
|
||||
id +
|
||||
'/actions/' +
|
||||
actionId +
|
||||
(rejectOnly ? '/reject' : '/execute'),
|
||||
body,
|
||||
{
|
||||
managedOutcome: true,
|
||||
},
|
||||
);
|
||||
} catch (e) {
|
||||
if (live() && id === currentId && revision === at) showError(e);
|
||||
} finally {
|
||||
|
||||
Reference in new issue
Block a user