From a09d198a8ec5dabbbe62d031e8a77f344cee5b47 Mon Sep 17 00:00:00 2001 From: Cole Medin Date: Tue, 7 Apr 2026 16:20:45 -0500 Subject: [PATCH] fix(web): allow workflow graph view to load without a codebase (#958) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The useQuery for workflow definitions required both workflowName and codebaseCwd to be truthy. For CLI-triggered runs or "No project" web runs where codebase_id is null, codebaseCwd stays undefined and the query never fires — showing "Loading graph..." forever. The server already handles missing cwd by falling back to bundled defaults, so the client gate only needs workflowName. Fixes #958 Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/web/src/components/workflows/WorkflowExecution.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/web/src/components/workflows/WorkflowExecution.tsx b/packages/web/src/components/workflows/WorkflowExecution.tsx index 22bb946a..e648983b 100644 --- a/packages/web/src/components/workflows/WorkflowExecution.tsx +++ b/packages/web/src/components/workflows/WorkflowExecution.tsx @@ -235,12 +235,12 @@ export function WorkflowExecution({ runId }: WorkflowExecutionProps): React.Reac }, [codebaseId]); // Fetch workflow definition for DAG topology (depends_on edges). - // Enabled whenever we have a workflow name and cwd — isDag is derived from the result, - // not used as a gate, to avoid a circular dependency. + // Only gated on workflowName — codebaseCwd is optional; the server falls back to bundled + // defaults when cwd is absent (handles CLI runs and "No project" web runs). const { data: workflowDef } = useQuery({ queryKey: ['workflowDefinition', initialData?.workflowName, codebaseCwd], queryFn: () => getWorkflow(initialData?.workflowName ?? '', codebaseCwd ?? undefined), - enabled: !!initialData?.workflowName && !!codebaseCwd, + enabled: !!initialData?.workflowName, staleTime: Infinity, }); const dagDefinitionNodes = workflowDef?.workflow?.nodes ?? null;