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

refactor: drop unused import + dead ctx fields (codex review)

Adam Eivy44c5185463c3
diff --git a/server/services/cos.js b/server/services/cos.js
index 5ab9fcd5d2..de825c79a1 100644
--- a/server/services/cos.js
+++ b/server/services/cos.js
@@ -713,8 +713,8 @@ async function spawnDequeuePriority0OnDemand(ctx) {
const taskScheduleMod = await import('./taskSchedule.js');
const taskSchedule = await taskScheduleMod.loadSchedule();
const onDemandRequests = await taskScheduleMod.getOnDemandRequests();
- // Stash for Priority 2's disabled-analysis-type gate (avoids a second load).
- ctx.taskScheduleMod = taskScheduleMod;
+ // Stash the loaded schedule for Priority 2's disabled-analysis-type gate
+ // (avoids a second load).
ctx.taskSchedule = taskSchedule;
// Track apps already marked review-started this cycle so multiple on-demand
@@ -810,7 +810,6 @@ async function spawnDequeuePriority1UserTasks(ctx) {
const userTaskData = await getUserTasks();
const pendingUserTasks = userTaskData.grouped?.pending || [];
- ctx.pendingUserTasks = pendingUserTasks;
ctx.hasPendingUserTasks = pendingUserTasks.length > 0;
for (const task of pendingUserTasks) {
@@ -1036,15 +1035,13 @@ async function dequeueNextTask() {
// Shared spawn context threaded through each priority tier. The tiers mutate
// the running spawn total + per-project counts through `capacity` (whose
// `canSpawn`/`trackSpawn` close over that state), and stash cross-tier values
- // (taskSchedule, pendingUserTasks, cosAutonomyMode, autonomousSpawnCeiling) on
- // `ctx` as they resolve them.
+ // (taskSchedule, hasPendingUserTasks, cosAutonomyMode, autonomousSpawnCeiling)
+ // on `ctx` as they resolve them.
const ctx = {
state,
instanceId,
capacity,
- pendingUserTasks: [],
hasPendingUserTasks: false,
- taskScheduleMod: null,
taskSchedule: null,
cosAutonomyMode: null,
autonomousSpawnCeiling: availableSlots
diff --git a/server/services/cosAgentArchive.js b/server/services/cosAgentArchive.js
index 3dbf0fef14..f5e0b1dc10 100644
--- a/server/services/cosAgentArchive.js
+++ b/server/services/cosAgentArchive.js
@@ -8,7 +8,7 @@
* The public barrel `cosAgents.js` re-exports everything here.
*/
-import { readFile, writeFile, rename, readdir, rm } from 'fs/promises';
+import { writeFile, rename, readdir, rm } from 'fs/promises';
import { existsSync } from 'fs';
import { join } from 'path';
import { cosEvents } from './cosEvents.js';