Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions packages/core/src/handlers/command-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
cleanupStaleWorktrees,
getWorktreeStatusBreakdown,
} from '../services/cleanup-service';
import { getArchonWorkspacesPath } from '@archon/paths';
import { getArchonWorkspacesPath, getArchonHome } from '@archon/paths';
import { loadConfig } from '../config/config-loader';
import { discoverWorkflowsWithConfig } from '@archon/workflows/workflow-discovery';
import { resolveWorkflowName } from '@archon/workflows/router';
Expand Down Expand Up @@ -563,7 +563,9 @@ async function handleWorkflowCommand(
let workflowEntries: readonly WorkflowWithSource[];
let errors: readonly WorkflowLoadError[];
try {
const result = await discoverWorkflowsWithConfig(workflowCwd, loadConfig);
const result = await discoverWorkflowsWithConfig(workflowCwd, loadConfig, {
globalSearchPath: getArchonHome(),
});
workflowEntries = result.workflows;
errors = result.errors;
} catch (error) {
Expand Down Expand Up @@ -609,7 +611,9 @@ async function handleWorkflowCommand(
case 'reload': {
try {
const { workflows: reloadedWorkflows, errors: reloadErrors } =
await discoverWorkflowsWithConfig(workflowCwd, loadConfig);
await discoverWorkflowsWithConfig(workflowCwd, loadConfig, {
globalSearchPath: getArchonHome(),
});
let msg = `Discovered ${String(reloadedWorkflows.length)} workflow(s).`;
if (reloadErrors.length > 0) {
msg += `\n\n**${String(reloadErrors.length)} failed to load:**\n`;
Expand Down Expand Up @@ -804,7 +808,9 @@ async function handleWorkflowCommand(
let workflowEntries: readonly WorkflowWithSource[];
let loadErrors: readonly WorkflowLoadError[];
try {
const result = await discoverWorkflowsWithConfig(workflowCwd, loadConfig);
const result = await discoverWorkflowsWithConfig(workflowCwd, loadConfig, {
globalSearchPath: getArchonHome(),
});
workflowEntries = result.workflows;
loadErrors = result.errors;
} catch (error) {
Expand Down
4 changes: 3 additions & 1 deletion packages/server/src/routes/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1767,7 +1767,9 @@ export function registerApiRoutes(
return c.json({ workflows: [] });
}

const result = await discoverWorkflowsWithConfig(workingDir, loadConfig);
const result = await discoverWorkflowsWithConfig(workingDir, loadConfig, {
globalSearchPath: getArchonHome(),
});
return c.json({
workflows: result.workflows.map(ws => ({ workflow: ws.workflow, source: ws.source })),
errors: result.errors.length > 0 ? result.errors : undefined,
Expand Down