@axiom-lattice/gateway 2.1.69 → 2.1.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +11 -0
- package/dist/index.js +20 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/controllers/workflow-tracking.ts +24 -21
package/dist/index.mjs
CHANGED
|
@@ -1851,8 +1851,7 @@ async function getInboxItems(request, reply) {
|
|
|
1851
1851
|
if (runningRuns.length === 0) {
|
|
1852
1852
|
return { success: true, message: "No running workflows", data: { records: [] } };
|
|
1853
1853
|
}
|
|
1854
|
-
const
|
|
1855
|
-
for (const r of runningRuns) {
|
|
1854
|
+
const checkPromises = runningRuns.map(async (r) => {
|
|
1856
1855
|
try {
|
|
1857
1856
|
const agent = agentInstanceManager4.getAgent({
|
|
1858
1857
|
assistant_id: r.assistantId,
|
|
@@ -1860,26 +1859,28 @@ async function getInboxItems(request, reply) {
|
|
|
1860
1859
|
tenant_id: r.tenantId
|
|
1861
1860
|
});
|
|
1862
1861
|
const runStatus = await agent.getRunStatus();
|
|
1863
|
-
if (runStatus !== "interrupted")
|
|
1862
|
+
if (runStatus !== "interrupted") return [];
|
|
1864
1863
|
const state = await agent.getCurrentState();
|
|
1865
1864
|
const interrupts = state.tasks?.flatMap((t) => t.interrupts || []) || [];
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
}
|
|
1880
|
-
|
|
1865
|
+
return interrupts.map((i) => ({
|
|
1866
|
+
runId: r.id,
|
|
1867
|
+
assistantId: r.assistantId,
|
|
1868
|
+
assistantName: nameMap[r.assistantId] || r.assistantId,
|
|
1869
|
+
threadId: r.threadId,
|
|
1870
|
+
tenantId: r.tenantId,
|
|
1871
|
+
interruptId: i.id,
|
|
1872
|
+
interruptValue: i.value,
|
|
1873
|
+
startedAt: r.startedAt,
|
|
1874
|
+
totalEdges: r.totalEdges,
|
|
1875
|
+
completedEdges: r.completedEdges
|
|
1876
|
+
}));
|
|
1877
|
+
} catch (err) {
|
|
1878
|
+
request.log.warn({ runId: r.id, error: err.message }, "Agent check skipped");
|
|
1879
|
+
return [];
|
|
1881
1880
|
}
|
|
1882
|
-
}
|
|
1881
|
+
});
|
|
1882
|
+
const results = await Promise.all(checkPromises);
|
|
1883
|
+
const inboxItems = results.flat();
|
|
1883
1884
|
inboxItems.sort(
|
|
1884
1885
|
(a, b) => new Date(b.startedAt).getTime() - new Date(a.startedAt).getTime()
|
|
1885
1886
|
);
|