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

fix: retarget remaining cos.js imports after rebase onto the workspace-prep split (#12988)

[._.]/ Adam Eivyf49f54a6aa6b
diff --git a/server/services/agentWorkspacePrep.js b/server/services/agentWorkspacePrep.js
index 0d1f7b37de..1eeab18623 100644
--- a/server/services/agentWorkspacePrep.js
+++ b/server/services/agentWorkspacePrep.js
@@ -786,7 +786,7 @@ async function adoptFeatureAgentWorktree(task) {
* @returns {Promise<object|null>} the new worktree's info, or null to stay put
*/
async function provisionConflictWorktree({ agentId, task, workspacePath }) {
- const { getAgents } = await import('./cos.js');
+ const { getAgents } = await import('./cosAgentLifecycle.js');
const runningAgents = (await getAgents()).filter(a => a.status === 'running');
const conflictResult = await detectConflicts(task, workspacePath, runningAgents).catch(err => {
diff --git a/server/services/cos.test.js b/server/services/cos.test.js
index b08a0d408c..070166fc17 100644
--- a/server/services/cos.test.js
+++ b/server/services/cos.test.js
@@ -35,7 +35,8 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { readFileSync } from 'fs';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
-import { firstLine, isPerpetualRefillCandidate, perpetualRefillPlan, resetOrphanedTasks } from './cos.js';
+import { isPerpetualRefillCandidate, perpetualRefillPlan, resetOrphanedTasks } from './cos.js';
+import { firstLine } from './cosTaskStore.js';
import { canQueueImprovementTasks, DEFAULT_STATE } from './cosState.js';
import { createDequeueCapacity, countRunningAgentsByLocalEndpoint, isIdleTierEligible, isUserTaskRunnableUnattended } from './cosDequeue.js';
import { generateTasksMarkdown, parseTasksMarkdown } from '../lib/taskParser.js';