Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

chore: reconcile catalog task branch with main (#5074)

[._.]/ Adam Eivy4eda03ccd4a3
diff --cc server/routes/cosJobRoutes.js
index e1aa88d382,43d7fac9de..55162e5137
--- a/server/routes/cosJobRoutes.js
+++ b/server/routes/cosJobRoutes.js
@@@ -209,12 -209,8 +209,12 @@@ router.post('/jobs/:id/trigger', asyncH
// Preserve the markers consumed by the job:spawned listener so Run now
// records the execution and re-registers the saved schedule.
autonomousJob: task.metadata?.autonomousJob,
- jobId: task.metadata?.jobId
+ jobId: task.metadata?.jobId,
+ // A marked audit may complete successfully with a verified empty branch;
+ // preserve that contract on the manually queued task as well as the
+ // scheduled task path.
+ noChangeSuccess: task.metadata?.noChangeSuccess
- }, 'internal');
+ }, 'internal', { suppressDequeue: true });
if (!taskResult?.id) {
res.json({
diff --cc server/routes/cosJobRoutes.test.js
index 5971fcf26d,c1c1272af4..90baed3125
--- a/server/routes/cosJobRoutes.test.js
+++ b/server/routes/cosJobRoutes.test.js
@@@ -496,36 -501,12 +501,38 @@@ describe('CoS Job Routes', () =>
autonomousJob: true,
jobId: 'j1'
}),
- 'internal'
+ 'internal',
+ { suppressDequeue: true }
);
+ expect(cos.forceSpawnTask).toHaveBeenCalledWith('task-2');
});
+ it('should preserve the no-change success contract when Run now queues an agent job', async () => {
+ autonomousJobs.getJob.mockResolvedValue({ id: 'j1', type: 'agent', name: 'Catalog audit' });
+ autonomousJobs.isShellJob.mockReturnValue(false);
+ autonomousJobs.isScriptJob.mockReturnValue(false);
+ autonomousJobs.generateTaskFromJob.mockResolvedValue({
+ description: 'Audit catalogs',
+ priority: 'MEDIUM',
+ metadata: {
+ autonomousJob: true,
+ jobId: 'j1',
+ useWorktree: true,
+ openPR: true,
+ noChangeSuccess: true,
+ }
+ });
+ cos.addTask.mockResolvedValue({ id: 'task-no-change' });
+
+ const response = await request(app).post('/api/cos/jobs/j1/trigger');
+
+ expect(response.status).toBe(200);
+ expect(cos.addTask).toHaveBeenCalledWith(
+ expect.objectContaining({ autonomousJob: true, jobId: 'j1', noChangeSuccess: true }),
+ 'internal'
+ );
+ });
+
it('should forward provider + model overrides into addTask', async () => {
autonomousJobs.getJob.mockResolvedValue({ id: 'j1', type: 'agent', name: 'Pinned Review' });
autonomousJobs.isShellJob.mockReturnValue(false);
diff --cc server/services/cosTaskStore.test.js
index 6a988ebaae,3286e3ba01..c223d93868
--- a/server/services/cosTaskStore.test.js
+++ b/server/services/cosTaskStore.test.js
@@@ -323,20 -323,17 +323,31 @@@ describe('cosTaskStore.addTask', () =>
expect(mock.events.some(e => e.name === 'tasks:changed' && e.payload.action === 'added' && e.payload.type === 'user')).toBe(true);
});
+ it('persists the no-change success marker for an autonomous audit', async () => {
+ const created = await addTask({
+ description: 'Audit shipped catalogs',
+ id: 'catalog-audit-task',
+ autonomousJob: true,
+ jobId: 'job-refresh-cli-provider-catalogs',
+ noChangeSuccess: true,
+ }, 'internal');
+
+ expect(created.metadata.noChangeSuccess).toBe(true);
+ const reloaded = (await getTaskById(created.id)).metadata.noChangeSuccess;
+ expect(reloaded === true || reloaded === 'true').toBe(true);
+ });
+
+ it('marks explicitly dispatched tasks so the scheduler does not race their spawn', async () => {
+ const task = await addTask({ description: 'run this now' }, 'internal', { suppressDequeue: true });
+ const change = mock.events.find(e => e.name === 'tasks:changed' && e.payload.task?.id === task.id);
+
+ expect(change.payload).toMatchObject({
+ type: 'internal',
+ action: 'added',
+ suppressDequeue: true
+ });
+ });
+
describe('targeted instance pin (#4520)', () => {
it('persists targetInstanceId and round-trips it through markdown', async () => {
const created = await addTask({ description: 'gpu work', id: 'task-pin', targetInstanceId: 'instance-bbbb' }, 'user');