File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
ballerina-extension/src/features/ai/service/design
ballerina-visualizer/src/views/AIPanel/components/AIChat Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ const sdk = new NodeSDK({
5050} ) ;
5151sdk . start ( ) ;
5252
53+ //TODO: Tool name, types and uesd in both ext and visualizer to display, either move to core or use visualizer as view only.
5354export async function generateDesignCore ( params : GenerateAgentCodeRequest , eventHandler : CopilotEventHandler ) : Promise < void > {
5455 const isPlanModeEnabled = params . isPlanMode ;
5556 const messageId = params . messageId ;
Original file line number Diff line number Diff line change @@ -462,7 +462,7 @@ const AIChat: React.FC = () => {
462462 }
463463 return newMessages ;
464464 } ) ;
465- } else if ( response . toolName === "DiagnosticsTool " ) {
465+ } else if ( response . toolName === "getCompilationErrors " ) {
466466 setMessages ( ( prevMessages ) => {
467467 const newMessages = [ ...prevMessages ] ;
468468 if ( newMessages . length > 0 ) {
@@ -589,9 +589,10 @@ const AIChat: React.FC = () => {
589589 }
590590 return newMessages ;
591591 } ) ;
592- } else if ( response . toolName === "DiagnosticsTool " ) {
592+ } else if ( response . toolName === "getCompilationErrors " ) {
593593 const diagnosticsOutput = response . toolOutput ;
594- const errors = diagnosticsOutput ?. diagnostics ?. filter ( ( d : any ) => d . severity === 1 ) || [ ] ;
594+ // Backend already filters for errors only (severity === 1), so no need to filter again
595+ const errors = diagnosticsOutput ?. diagnostics || [ ] ;
595596 const errorCount = errors . length ;
596597
597598 setErrorCount ( errorCount ) ;
You can’t perform that action at this time.
0 commit comments