agents-relay 2.0.181 → 2.0.182
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/dist/relayd.js +10 -4
- package/package.json +1 -1
package/dist/relayd.js
CHANGED
|
@@ -137,7 +137,7 @@ export async function runDaemon(argv) {
|
|
|
137
137
|
}
|
|
138
138
|
if (repositories.length === 0)
|
|
139
139
|
repositories.push('local/' + basename(workspaceRoot));
|
|
140
|
-
const inventoryFromLocal = async () => {
|
|
140
|
+
const inventoryFromLocal = async (limitHistory = true) => {
|
|
141
141
|
const snapshots = await discoverLocalRelayStoreSnapshots(relayStoreDirectory());
|
|
142
142
|
const known = new Set(repositories);
|
|
143
143
|
const entries = snapshots.flatMap(snapshot => snapshot.jobs.filter(job => known.has(job.repository)).map(job => ({
|
|
@@ -150,7 +150,8 @@ export async function runDaemon(argv) {
|
|
|
150
150
|
counts.set(item.job.id, (counts.get(item.job.id) ?? 0) + 1);
|
|
151
151
|
// Hide obsolete terminal snapshots only when one live authoritative Job exists.
|
|
152
152
|
// Multiple live copies remain visible for diagnosis but cannot be mutated.
|
|
153
|
-
|
|
153
|
+
const visible = entries.filter(item => !['COMPLETED', 'CANCELLED'].includes(item.job.state) || counts.get(item.job.id) !== 1);
|
|
154
|
+
return limitHistory ? dashboardManagedJobs(visible) : visible;
|
|
154
155
|
};
|
|
155
156
|
cachedOverviews = await inventoryFromLocal();
|
|
156
157
|
const makeReconciler = (store, maxConcurrent) => new Reconciler(store, { noGitHub, owner: `relayd-${process.pid}`, maxConcurrent, leaseMs: Number(value(argv, '--lease-ms', '300000')), adapters: [new CodexAdapter(value(argv, '--codex', 'codex')), new ChatGptAdapter()], continuations: [new CodexThreadContinuation(value(argv, '--codex', 'codex')), new CommandContinuation(), new WebhookContinuation()], planner: runtimePlanner(argv), usageSnapshotProvider: () => usageRegistry.snapshot(), runtimeSummaryProvider: () => ({ chatgptRunning: summarizeRuntime(cachedOverviews.map(item => item.job)).workers.chatgpt }), decisionEngine: executionDecisionEngine(), decisionMode: decisionMode(), decisionAuditStore, eventBus: bus, escalationNotifier: escalationNotifierFromEnvironment(), reviewer: runtimeReviewer(argv), executionContextRoots: { workspaceRoot }, projectPathForJob: async (job, task) => {
|
|
@@ -176,7 +177,8 @@ export async function runDaemon(argv) {
|
|
|
176
177
|
cachedOverviews = await inventoryFromLocal();
|
|
177
178
|
return cachedOverviews;
|
|
178
179
|
};
|
|
179
|
-
|
|
180
|
+
// Search the full SQLite inventory; keep the executor's bounded view unchanged.
|
|
181
|
+
const overviews = async (_forceRefresh = false, _trigger = 'internal.unknown') => inventoryFromLocal(false);
|
|
180
182
|
const refreshPullRequestSnapshot = async (repository, prNumber, _trigger = 'internal', _options = {}) => {
|
|
181
183
|
const inventory = await refreshAll();
|
|
182
184
|
return {
|
|
@@ -429,6 +431,10 @@ export async function runDaemon(argv) {
|
|
|
429
431
|
} : undefined;
|
|
430
432
|
const exactJob = async (jobId, target) => {
|
|
431
433
|
let cached = dashboardOverview(jobId, target);
|
|
434
|
+
if (!cached)
|
|
435
|
+
cached = (await inventoryFromLocal(false)).find(item => item.job.id === jobId &&
|
|
436
|
+
(!target?.repository || item.job.repository === target.repository) &&
|
|
437
|
+
(!target?.prNumber || item.job.prNumber === target.prNumber));
|
|
432
438
|
if (!cached && target?.repository && target.prNumber && repositories.includes(target.repository)) {
|
|
433
439
|
cached = (await refreshPullRequest(target.repository, target.prNumber, 'control.job-lookup', { force: true }))
|
|
434
440
|
.find(item => item.job.id === jobId && item.job.repository === target.repository && item.job.prNumber === target.prNumber);
|
|
@@ -439,7 +445,7 @@ export async function runDaemon(argv) {
|
|
|
439
445
|
try {
|
|
440
446
|
const refreshed = (await refreshPullRequest(cached.job.repository, cached.job.prNumber, 'dashboard.selected-job', { force: true })).find(item => item.job.id === jobId);
|
|
441
447
|
if (!refreshed)
|
|
442
|
-
return
|
|
448
|
+
return cachedJob();
|
|
443
449
|
return { ...refreshed.job, githubState: refreshed.githubState, runtimeStatus: deriveJobRuntimeStatus(refreshed.job, refreshed.githubState), mergedAt: refreshed.mergedAt, closedAt: refreshed.closedAt, draft: refreshed.draft, publication: refreshed.publication, publicationFailure: refreshed.publicationFailure };
|
|
444
450
|
}
|
|
445
451
|
catch (error) {
|