Skip to content

Commit 8af3841

Browse files
coleam00claude
andauthored
fix(web): allow workflow graph view to load without a codebase (coleam00#959)
* fix(web): allow workflow graph view to load without a codebase (coleam00#958) 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 coleam00#958 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(web): clarify server fallback chain comment for absent codebaseCwd Update inline comment to accurately describe the two-step server fallback: when cwd is absent the server first tries the first registered codebase before falling back to bundled defaults. The previous comment skipped the intermediate step, which could confuse developers debugging unexpected workflow resolution for "No project" runs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ff72296 commit 8af3841

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

packages/web/src/components/workflows/WorkflowExecution.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,13 @@ export function WorkflowExecution({ runId }: WorkflowExecutionProps): React.Reac
235235
}, [codebaseId]);
236236

237237
// Fetch workflow definition for DAG topology (depends_on edges).
238-
// Enabled whenever we have a workflow name and cwd — isDag is derived from the result,
239-
// not used as a gate, to avoid a circular dependency.
238+
// Only gated on workflowName — codebaseCwd is optional; when absent the server tries the
239+
// first registered codebase before falling back to bundled defaults (handles CLI runs and
240+
// "No project" web runs).
240241
const { data: workflowDef } = useQuery({
241242
queryKey: ['workflowDefinition', initialData?.workflowName, codebaseCwd],
242243
queryFn: () => getWorkflow(initialData?.workflowName ?? '', codebaseCwd ?? undefined),
243-
enabled: !!initialData?.workflowName && !!codebaseCwd,
244+
enabled: !!initialData?.workflowName,
244245
staleTime: Infinity,
245246
});
246247
const dagDefinitionNodes = workflowDef?.workflow?.nodes ?? null;

0 commit comments

Comments
 (0)