Sync main with 1.6.x branch#712
Conversation
- Add maxHeapSize configuration for flow-model-generator tests - Add model-generator-commons dependency to diagram-util - Addresses version compatibility issues Fixes issue-2309 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add enum reordering functionality to prioritize default values - Implement reorderOptionsByDefaultValue method for better UX - Update typeWithExpression method signatures to support default values - Fix version mismatches in build.gradle files: - Add maxHeapSize configuration for flow-model-generator tests - Add model-generator-commons dependency to diagram-util - Update test files with correct package versions - Fix building issues after conflicts Fixes issue-2309
Add default value support
…-16x Fix the repeated "failed to pull module" notification pop-ups
…a-language-server into 1.6.x-main-sync
📝 WalkthroughWalkthroughPropagates module/workspace/file-path context into FunctionData construction, centralizes package resolution via PackageUtil, enhances default-value resolution (including enum default ordering), removes BuildProject dependencies, and updates many test/config JSON defaults and resource metadata. Changes
Sequence DiagramsequenceDiagram
participant Caller as Generator/Builder Call Site
participant Builder as FunctionDataBuilder
participant PkgUtil as PackageUtil
participant Workspace as WorkspaceManager
participant Commons as CommonUtils
participant Semantic as SemanticModel
Caller->>Builder: create builder (.moduleInfo, .workspaceManager, .filePath, ...)
Caller->>Builder: build() / buildChildNodes()
Builder->>PkgUtil: resolveModulePackage(org, pkg, ver)
PkgUtil->>Workspace: check isLocalFunction / try workspace resolution
alt local
Workspace-->>PkgUtil: project + document + semanticModel
PkgUtil-->>Builder: resolved Package + Document + SemanticModel
else remote/central
PkgUtil-->>Builder: Optional Package (may be empty)
end
Builder->>Builder: updateModuleInfo(resolvedPackage)
loop for each parameter
Builder->>Commons: resolveDefaultValue(symbol, type, semanticModel, resolvedPackage, document)
Commons->>Semantic: analyze default expression
Semantic-->>Commons: default literal / enum member
alt enum default found
Commons-->>Builder: reordered options with default first
else
Commons-->>Builder: default value
end
end
Builder-->>Caller: FunctionData with module/package/semantic/document context
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR syncs the main branch with the 1.6.x branch, bringing significant architectural improvements to package resolution and default value handling in the flow model generator.
Changes:
- Refactored package resolution to remove BuildProject dependency and use direct Environment-based resolution
- Added automatic package and semantic model resolution in FunctionDataBuilder with support for local vs. external function detection
- Enhanced default value extraction to support enum member resolution with proper constant value handling
- Updated test expectations across 100+ test files to reflect improved default value resolution (enums, constants, proper defaults)
Reviewed changes
Copilot reviewed 137 out of 140 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| PackageUtil.java | Removed BuildProject parameter from methods, added Environment-based resolution, new utility methods for safe package resolution and local function detection |
| FunctionDataBuilder.java | Added automatic package/semantic model resolution logic with local vs. external function handling, moved default value extraction to CommonUtils |
| CommonUtils.java | Added resolveDefaultValue methods with enum member resolution support, findDocument helper, updated copyright year to 2026 |
| Various builder classes | Added workspaceManager and filePath parameters to enable automatic resolution |
| Property.java | Added reorderOptionsByDefaultValue to prioritize default enum options in UI |
| Test resources | Updated 100+ test JSON files with corrected default values from actual package definitions |
| module-info.java, build.gradle | Added dependencies for model-generator-commons |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 11
Note
Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (18)
flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/memory_manager_template.json (1)
53-63:⚠️ Potential issue | 🟡 MinorAlign placeholder with default value to avoid confusion.
placeholderis still"0"whiledefaultValueis now"10". If this template is used for UI/test fixtures, the mismatch can be misleading. Consider updating the placeholder to"10"or documenting why it should stay"0".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/memory_manager_template.json` around lines 53 - 63, Update the JSON template so the "placeholder" for the field with codedata.originalName "size" matches its "defaultValue": change "placeholder": "0" to "placeholder": "10" (or, if there is a specific reason to keep "0", add a comment/documentation entry explaining the intentional mismatch); locate the object containing "codedata": {"originalName":"size"} and adjust the "placeholder" property to match the "defaultValue" property to avoid confusion in UI/test fixtures.flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_template_ballerina.json (1)
143-152:⚠️ Potential issue | 🟡 MinorPlaceholder and defaultValue format mismatch for
maxIter.The
placeholder(line 143) is"\"INFER_TOOL_COUNT\""(quoted string literal), but thedefaultValue(line 152) is now"INFER_TOOL_COUNT"(unquoted identifier). Given theballerinaTypeunion includes a string literal"\"INFER_TOOL_COUNT\"|int", this formatting difference could affect code generation or UI behavior.This pattern appears inconsistently across the codebase—some similar config files retain quoted defaultValue while others use unquoted. Clarify if this distinction is intentional or if the change should be reverted to match the placeholder format.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_template_ballerina.json` around lines 143 - 152, The placeholder for the field maxIter is a quoted string literal ("\"INFER_TOOL_COUNT\"") while defaultValue is unquoted ("INFER_TOOL_COUNT"), causing a mismatch against the ballerinaType union that expects a string literal; update the defaultValue to match the placeholder format (i.e., include the surrounding quotes to become "\"INFER_TOOL_COUNT\"" or conversely make placeholder unquoted) so both placeholder and defaultValue use the same representation, and ensure codedata.originalName "maxIter" and ballerinaType remain consistent with this choice across other config files.flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search_nodes/config/config1.json (1)
154-181:⚠️ Potential issue | 🟡 MinorUpdate timeout defaultValue to use decimal literal syntax for consistency.
Line 180 sets
"defaultValue": "60"while the field is adecimaltype with placeholder"0.0d". This is inconsistent with another timeout field at line 724 in the same file, which correctly uses"defaultValue": "0.0d"for the same type. Update to"60d"or"60.0d"to match the decimal literal format indicated by the placeholder and maintain consistency with the other timeout field in this configuration.Suggested change
- "defaultValue": "60" + "defaultValue": "60d"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search_nodes/config/config1.json` around lines 154 - 181, The "timeout" config object has a decimal ballerinaType and placeholder "0.0d" but its defaultValue is the integer string "60"; update the "timeout" object's "defaultValue" to a decimal literal such as "60d" or "60.0d" to match the placeholder and the other timeout entry; locate the JSON object by the "timeout" key and its "placeholder": "0.0d" and change the "defaultValue" property accordingly.flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_call_flow_node_9.json (1)
283-310:⚠️ Potential issue | 🟡 MinorDefault value doesn’t match the single‑select option values (Lines 283–310).
The options are still quoted string literals, whiledefaultValueis unquoted. If the UI does string matching, the default won’t preselect. Either quote the defaultValue or unquote the option values/placeholder.💡 Possible fix (align defaultValue to existing option values)
- "defaultValue": "NO_FILTER" + "defaultValue": "\"NO_FILTER\""🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_call_flow_node_9.json` around lines 283 - 310, The defaultValue for the field with codedata.originalName "toolLoadingStrategy" doesn't match the option values because options/placeholder use quoted string literals; update the defaultValue to match that format (e.g., change defaultValue from NO_FILTER to "\"NO_FILTER\"") so the single-select preselects correctly, or alternatively remove quotes from the option values/placeholder to match the unquoted defaultValue—make the formats consistent between "options", "placeholder", and "defaultValue".flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/model_provider_manager/config/get_wso2_model_provider_template.json (2)
125-152:⚠️ Potential issue | 🟡 MinorUse explicit decimal literal for
temperaturedefault value.In this JSON template for code generation, the
temperaturefield specifies"ballerinaType": "decimal"and the placeholder uses"0.0d"(with explicitdsuffix). However, thedefaultValueis"0.7"without the decimal suffix. For consistency and to ensure the generated Ballerina code is correctly typed, use"0.7d".Proposed fix
- "defaultValue": "0.7" + "defaultValue": "0.7d"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/model_provider_manager/config/get_wso2_model_provider_template.json` around lines 125 - 152, The defaultValue for the "temperature" field in the JSON template should use an explicit Ballerina decimal literal to match "ballerinaType":"decimal" and the "0.0d" placeholder; update the "defaultValue" for the temperature object (identify by the "temperature" key and its "defaultValue" property) from "0.7" to "0.7d" so generated Ballerina code preserves the decimal type.
153-193:⚠️ Potential issue | 🟡 MinorAlign
httpVersiondefault with select option values.The defaultValue uses
http:HTTP_2_0(enum constant), but the select options and placeholder are quoted strings ("2.0"). This mismatch will prevent the UI from matching the default value to a select option, potentially breaking the preselection. Align the options (and placeholder) to use the enum constants for consistency.🛠️ Proposed fix (align options to enum constants)
- "value": "\"2.0\"" + "value": "http:HTTP_2_0" ... - "value": "\"1.1\"" + "value": "http:HTTP_1_1" ... - "value": "\"1.0\"" + "value": "http:HTTP_1_0" ... - "placeholder": "\"2.0\"", + "placeholder": "http:HTTP_2_0",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/model_provider_manager/config/get_wso2_model_provider_template.json` around lines 153 - 193, The httpVersion block's defaultValue (http:HTTP_2_0) doesn't match the SINGLE_SELECT option values and placeholder (they're quoted strings), so update the options' value fields and the placeholder to use the corresponding enum constants (e.g., http:HTTP_2_0, http:HTTP_1_1, http:HTTP_1_0) so they match the ballerinaType http:HttpVersion and the existing defaultValue; also ensure the selected flag reflects the desired preselection for httpVersion.flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/diagram_generator/config/chat_agent.json (3)
217-246:⚠️ Potential issue | 🟡 MinorAlign
agentTypedefault with select option values.The default value is now an identifier (
FUNCTION_CALL_AGENT) while the options are string literals ("FUNCTION_CALL_AGENT"). If the UI expects an exact match, the default won’t select anything. Consider updating the options to identifiers or reverting the default to the quoted literal for consistency.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/diagram_generator/config/chat_agent.json` around lines 217 - 246, The default for agentType (defaultValue: "FUNCTION_CALL_AGENT") does not match the option values which are quoted string literals ("\"FUNCTION_CALL_AGENT\""), so update either the options or the default for consistent matching: either change each option.value for the SINGLE_SELECT under agentType to unquoted identifiers (e.g., value: "FUNCTION_CALL_AGENT") to match defaultValue, or change defaultValue to the quoted literal (defaultValue: "\"FUNCTION_CALL_AGENT\"") so it exactly matches the option.value; locate the config block containing "codedata": {"originalName": "agentType"}, the "options" array, and the "defaultValue" field to make the change.
1189-1231:⚠️ Potential issue | 🟡 MinorAlign
httpVersiondefault with select option values.The option values are string literals (
"\"2.0\"","\"1.1\"","\"1.0\""), but the default is the enum constanthttp:HTTP_2_0. This inconsistency differs from other similar config files in the same directory (function_call-log1.json, nested_node5.json, while6.json), which consistently use"\"2.0\""as the default. If the renderer matches defaults to options by string comparison, no option will be selected. Update line 1231 to use"\"2.0\""for consistency with both the options and other config files.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/diagram_generator/config/chat_agent.json` around lines 1189 - 1231, The default for the httpVersion field is inconsistent: currently defaultValue is set to the enum constant http:HTTP_2_0 but the selectable options are string literals; update the httpVersion defaultValue to match the option format used elsewhere (use the "\"2.0\"" string value) so the renderer can match the default to the option; locate this in the httpVersion object (field name "httpVersion" and property "defaultValue") and replace the enum constant with the string literal used by the options.
1161-1187:⚠️ Potential issue | 🔴 Critical
DEFAULT_TEMPERATUREconstant is missing from the codebase.The JSON config references
DEFAULT_TEMPERATUREas a default value for the decimaltemperaturefield across multiple configuration files, but this constant is never defined anywhere in the repository. The generated code will fail to compile when it attempts to use this undefined constant.Define the
DEFAULT_TEMPERATUREconstant with a decimal type, or use a literal decimal value instead.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/diagram_generator/config/chat_agent.json` around lines 1161 - 1187, The config uses an undefined symbol DEFAULT_TEMPERATURE for the decimal temperature field; add a repository-wide definition for DEFAULT_TEMPERATURE as a decimal constant (or replace the JSON defaultValue with a literal decimal) so generated code compiles. Create the constant in the shared constants module used by code generation (name it DEFAULT_TEMPERATURE with a decimal value matching expected default, e.g., 0.0) and update any codegen references that import or expect DEFAULT_TEMPERATURE to use that defined constant.flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_call_template_hide_td.json (1)
206-234:⚠️ Potential issue | 🟠 MajorKeep
toolLoadingStrategydefaults consistent with option values.
Options still use quoted strings, but the default is now unquoted (NO_FILTER). If matching is literal, this breaks the default selection. Align both forms.💡 Minimal consistency fix (revert to quoted)
- "defaultValue": "NO_FILTER" + "defaultValue": "\"NO_FILTER\""🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_call_template_hide_td.json` around lines 206 - 234, The defaultValue for the field represented by codedata.originalName "toolLoadingStrategy" is unquoted ("NO_FILTER") while the options' values are quoted ("\"NO_FILTER\""), causing literal-matching failures; update the defaultValue in that object's JSON to match the options' format (make it "\"NO_FILTER\"" to match the option values) or alternatively change the options' value strings to unquoted NO_FILTER — ensure toolLoadingStrategy's defaultValue and the entries under options[].value use the exact same quoting so selection logic can match them.flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/module_nodes/config/single.json (2)
166-206:⚠️ Potential issue | 🟡 MinorUpdate the defaultValue for compression to use the correct module qualification.
The unqualified
COMPRESSION_AUTOshould be qualified ashttp:COMPRESSION_AUTObased on patterns in similar config files and generated Ballerina code. Note: there is a type-value mismatch—ballerinaTypereferencesgrpc:Compressionbut the constant comes from thehttpmodule.Suggested fix
- "defaultValue": "COMPRESSION_AUTO" + "defaultValue": "http:COMPRESSION_AUTO"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/module_nodes/config/single.json` around lines 166 - 206, The defaultValue for the "compression" config is currently unqualified ("COMPRESSION_AUTO") but must reference the http module constant; update the "defaultValue" for the compression entry to "http:COMPRESSION_AUTO". Ensure you adjust only the defaultValue in the JSON node named "compression" (note the related ballerinaType is "grpc:Compression", but the constant lies in the http module), so other fields like "placeholder", "types", and "codedata" remain unchanged.
64-91:⚠️ Potential issue | 🟡 MinorChange the timeout defaultValue to use decimal literal format.
The field type is
decimalbut the defaultValue is"60"(an integer literal). The placeholder also shows"0.0d", indicating the expected format. Use"60.0d"to match the decimal type and maintain consistency with other decimal defaults in the codebase.Suggested fix
- "defaultValue": "60" + "defaultValue": "60.0d"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/module_nodes/config/single.json` around lines 64 - 91, The "timeout" field's defaultValue is an integer string ("60") but the metadata indicates a decimal type (fieldType/ballerinaType "decimal") and the placeholder uses decimal literal format; update the "defaultValue" for the timeout node to the decimal literal "60.0d" so it matches the placeholder and decimal type (look for the "timeout" object containing "metadata", "types", "placeholder" and "defaultValue" in the JSON).flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_call_flow_node_4.json (2)
196-233:⚠️ Potential issue | 🟠 MajorAdd
ai:module qualifier to unqualified defaultValue fieldsThe
defaultValuefields use unqualified identifiers (FUNCTION_CALL_AGENT,DEFAULT_SESSION_ID,new MessageWindowChatMemory()) that require theai:module prefix per Ballerina's module enumeration specification. Thevaluefield correctly usesai:qualification (e.g.,ai:REACT_AGENT), but thedefaultValuefield does not, creating a mismatch.Correct the following defaultValue entries:
- Line 232:
"defaultValue": "ai:FUNCTION_CALL_AGENT"- Line 312:
"defaultValue": "new ai:MessageWindowChatMemory()"- Line 524:
"defaultValue": "ai:DEFAULT_SESSION_ID"Also applies to: 290–313, 498–525, 621–658, 659–682, 998–1053
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_call_flow_node_4.json` around lines 196 - 233, The defaultValue entries are missing the required ai: module qualifier; update the unqualified defaults to use the ai: prefix: change the defaultValue for the agentType config (currently "FUNCTION_CALL_AGENT") to "ai:FUNCTION_CALL_AGENT", change the MessageWindowChatMemory instantiation default (currently "new MessageWindowChatMemory()") to "new ai:MessageWindowChatMemory()", and change the session id default (currently "DEFAULT_SESSION_ID") to "ai:DEFAULT_SESSION_ID"; locate these by searching for defaultValue keys near the agentType object, any defaultValue referencing MessageWindowChatMemory, and any defaultValue referencing DEFAULT_SESSION_ID and prepend the ai: qualifier accordingly.
1054-1097:⚠️ Potential issue | 🟡 MinorHTTP constants are valid, but the timeout decimal should use the
dsuffix for consistencyWeb search confirms
http:HTTP_2_0andhttp:COMPRESSION_AUTOare valid for ballerina/http 2.15.4. However, the timeout field'sdefaultValue: "60"should be"60d"to match the placeholder convention ("0.0d") and explicitly denote the decimal type, as the field'sballerinaTypespecifiesdecimal.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_call_flow_node_4.json` around lines 1054 - 1097, The timeout field's defaultValue is currently "60" but its ballerinaType is decimal and placeholders use the "d" suffix (e.g., "0.0d"); update the timeout property's defaultValue to include the decimal suffix ("60d") to match the placeholder convention and explicit decimal typing; locate the timeout object alongside httpVersion in the JSON (fields like "timeout", "defaultValue", and "ballerinaType": "decimal") and replace the string "60" with "60d".flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_call_flow_node_7.json (2)
372-408:⚠️ Potential issue | 🟡 MinorAlign option values and placeholder with unquoted defaultValue format.
The
optionsvalues andplaceholdercontain escaped quotes ("\"NO_FILTER\"","\"LLM_FILTER\""), whiledefaultValueis unquoted (NO_FILTER). If the UI matches by string, the default won't cleanly map to available options. Either quote thedefaultValueto match options/placeholder, or remove quotes from all three to use bare identifiers consistently.This issue appears in two places: lines 372–408 and lines 963–999.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_call_flow_node_7.json` around lines 372 - 408, The option values and placeholder for the toolLoadingStrategy field are quoted (e.g. "\"NO_FILTER\"") while defaultValue is unquoted (NO_FILTER), causing mismatch; fix by making them consistent: either change defaultValue to the quoted form "\"NO_FILTER\"" to match options/placeholder, or (preferably) remove the escaped quotes from options and placeholder so options values and placeholder become bare identifiers (NO_FILTER, LLM_FILTER) to match defaultValue; update the entries in the toolLoadingStrategy block (options -> value and placeholder and defaultValue) accordingly in both occurrences.
293-320:⚠️ Potential issue | 🔴 CriticalFix JSON data: quote bare identifier defaults to produce valid Ballerina code.
The
defaultValueforINFER_TOOL_COUNTandDEFAULT_SESSION_IDshould be quoted as string literals. TheballerinaTypeformaxItershows the union type"\"INFER_TOOL_COUNT\"|int", indicating the value should be the string"INFER_TOOL_COUNT", not a bare identifier. The currentdefaultValue: "INFER_TOOL_COUNT"will emit invalid Ballerina code; it should be"defaultValue": "\"INFER_TOOL_COUNT\""to produce the correct string literal output.Affected locations:
- Lines 293–320:
maxIterdefaultValue (and similar at 593–620, 884–911)sessionIddefaultValue in same and referenced sectionsApply the same quoting correction to all bare identifier defaults throughout the file to ensure generated code compiles.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_call_flow_node_7.json` around lines 293 - 320, The JSON emits bare identifier defaults that produce invalid Ballerina code; update each defaultValue that is meant to be a string literal (e.g., maxIter defaultValue of INFER_TOOL_COUNT and sessionId/DEFAULT_SESSION_ID occurrences) to include the quoted string literal form by escaping the quotes so the value becomes "\"INFER_TOOL_COUNT\"" (and similarly "\"DEFAULT_SESSION_ID\"" wherever used), ensuring the ballerinaType union like "\"INFER_TOOL_COUNT\"|int" matches the actual defaultValue; apply this fix to all instances listed (around maxIter, sessionId and other similar sections).flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_call_flow_node_2.json (2)
2888-2915:⚠️ Potential issue | 🟡 MinorChange decimal defaultValue to literal format.
The
timeoutfield withballerinaType: "decimal"should use decimal literal format. Change"defaultValue": "60"to"defaultValue": "60.0d"to match the decimal literal syntax required by Ballerina and consistent with the placeholder format and other similar timeout fields in the codebase.Suggested fix
- "defaultValue": "60" + "defaultValue": "60.0d"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_call_flow_node_2.json` around lines 2888 - 2915, The timeout field's defaultValue is an integer string but the field has ballerinaType "decimal" and uses a decimal literal placeholder; update the "timeout" object's "defaultValue" from "60" to the decimal literal "60.0d" so it matches the placeholder and other decimal timeout fields (locate the JSON object with "metadata": {"label":"Timeout"}, "ballerinaType":"decimal" and the "defaultValue" property and replace its value).
2764-2807:⚠️ Potential issue | 🟡 MinorAlign SINGLE_SELECT defaults with option values for consistent matching logic.
The
httpVersionandcompressionfields use constant defaults (http:HTTP_2_0,http:COMPRESSION_AUTO) while option values are quoted literals ("\"2.0\"","\"AUTO\""). ThereorderOptionsByDefaultValue()method compares these values after stripping quotes, causing the default to never match any option. Update either the defaults to use quoted literals or the option values to use constants.[Also applies to: 3024-3067]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_call_flow_node_2.json` around lines 2764 - 2807, The SINGLE_SELECT option values and the defaultValue for fields like httpVersion and compression are mismatched (options use quoted literals like "\"2.0\"" and "\"AUTO\"" while defaults use constants like http:HTTP_2_0 and http:COMPRESSION_AUTO), causing reorderOptionsByDefaultValue() to never match; fix by making the representations consistent — either change the option entries for httpVersion and compression to use the same constant tokens as the defaults (e.g., option value -> http:HTTP_2_0 / http:COMPRESSION_AUTO) or change the defaultValue to the quoted literal forms used in options, and ensure reorderOptionsByDefaultValue() still strips quotes/matches accordingly so the comparison succeeds.
🟡 Minor comments (13)
flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/default.json-438-441 (1)
438-441:⚠️ Potential issue | 🟡 MinorFix typo in description (“implmenting”).
User-facing metadata should avoid spelling errors.
✍️ Suggested fix
- "description": "Allows implmenting custom toolkits by extending this type. Toolkits can help to define new types of tools so that agent can understand them.", + "description": "Allows implementing custom toolkits by extending this type. Toolkits can help to define new types of tools so that agent can understand them.",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/default.json` around lines 438 - 441, Update the "description" value in the metadata for the type with label "BaseToolKit" to correct the spelling of "implmenting" to "implementing" so the user-facing metadata reads "Allows implementing custom toolkits by extending this type. Toolkits can help to define new types of tools so that agent can understand them."; locate the metadata object containing "label": "BaseToolKit" and edit its "description" string accordingly.flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/default.json-775-776 (1)
775-776:⚠️ Potential issue | 🟡 MinorFix spelling/wording in error description.
“Stackoverflow” and “lenthy” read as typos in user-facing text.
✍️ Suggested fix
- "description": "Stackoverflow errors due to lenthy OpenAPI specification or cyclic references in the specification.", + "description": "Stack overflow errors due to lengthy OpenAPI specifications or cyclic references in the specification.",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/default.json` around lines 775 - 776, Update the description for the entry with label "ParsingStackOverflowError" in default.json to correct typos and improve wording: replace "Stackoverflow" with "Stack overflow" (or "StackOverflow" if you prefer CamelCase) and "lenthy" with "lengthy", and rephrase to a concise sentence such as "Stack overflow errors caused by lengthy OpenAPI specifications or cyclic references in the specification." Make the change in the description value for the ParsingStackOverflowError object.flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/default.json-535-537 (1)
535-537:⚠️ Potential issue | 🟡 MinorGrammar: use “an HTML document.”
Minor text polish for clarity.
✍️ Suggested fix
- "description": "Represents the available strategies for chunking a HTML document.\n\nEach strategy attempts to include as much content as possible using a specific unit (such as paragraph or sentence).\nIf the content exceeds the defined `maxChunkSize` the strategy recursively falls back to a finer-grained unit until\nthe content fits within the limit.", + "description": "Represents the available strategies for chunking an HTML document.\n\nEach strategy attempts to include as much content as possible using a specific unit (such as paragraph or sentence).\nIf the content exceeds the defined `maxChunkSize` the strategy recursively falls back to a finer-grained unit until\nthe content fits within the limit.",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/default.json` around lines 535 - 537, Update the description string for the object with "label": "HtmlChunkStrategy" to use correct grammar: change "a HTML document." to "an HTML document." so the sentence reads "Represents the available strategies for chunking an HTML document." Locate the description field associated with the "HtmlChunkStrategy" label and make this single-word change within that JSON value.service-model-generator/modules/service-model-index-generator/src/main/java/io/ballerina/indexgenerator/ServiceIndexGenerator.java-120-126 (1)
120-126:⚠️ Potential issue | 🟡 MinorGuard null/blank versions before calling
getModulePackage.
Ifservice_artifacts.jsonomits a version for some entries,getModulePackage(org, name, version)can throw or fail to resolve. Consider usingresolveModulePackage(which handles nulls and fallback) or add a guard before calling.💡 Suggested fix (use safe resolver)
- Optional<Package> packageOpt = PackageUtil.getModulePackage(org, - packageMetadataInfo.name(), packageMetadataInfo.version()); + String version = packageMetadataInfo.version(); + Optional<Package> packageOpt = PackageUtil.resolveModulePackage( + org, + packageMetadataInfo.name(), + (version == null || version.isBlank()) ? null : version + );🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@service-model-generator/modules/service-model-index-generator/src/main/java/io/ballerina/indexgenerator/ServiceIndexGenerator.java` around lines 120 - 126, In resolvePackage, guard against null/blank packageMetadataInfo.version() before calling PackageUtil.getModulePackage, or replace that call with the safe resolver PackageUtil.resolveModulePackage/org.resolveModulePackage (which handles missing versions and fallbacks); specifically update the logic around PackageUtil.getModulePackage(org, packageMetadataInfo.name(), packageMetadataInfo.version()) in resolvePackage to either check StringUtils.isBlank(packageMetadataInfo.version()) and use a default/fallback resolution, or call PackageUtil.resolveModulePackage(org, packageMetadataInfo.name(), packageMetadataInfo.version()) so resolution won't throw when version is omitted.flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/node_template/source/default_enum.bal-1-3 (1)
1-3:⚠️ Potential issue | 🟡 MinorType mismatch: passing string literal instead of enum member.
function2("Tuesday")passes a string literal, butfunction2expects aDayenum type. In Ballerina, enum members must be referenced directly without quotes.🐛 Proposed fix
function function1() { - function2("Tuesday"); + function2(Tuesday); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/node_template/source/default_enum.bal` around lines 1 - 3, function2 is being called with a string literal "Tuesday" but it expects a Day enum; replace the string with the appropriate enum member (e.g., Day.Tuesday) in the call site inside function1 (update the invocation function2("Tuesday") to function2(Day.Tuesday)), and ensure the Day enum is imported or defined in scope so the symbol Day and its member Tuesday resolve correctly.flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search_nodes/config/config7.json-299-299 (1)
299-299:⚠️ Potential issue | 🟡 MinorQualify the compression default value or align with placeholder format.
The unqualified
"COMPRESSION_AUTO"at line 299 is inconsistent with the codebase. Other config files use qualified constants like"http:COMPRESSION_AUTO"(see service_field_nodes.json line 599 and agent_model.json line 2126) or quoted literals matching the placeholder (see line 908 in the same file:"\"AUTO\""). Since this field has"ballerinaType": "grpc:Compression", consider using either"grpc:COMPRESSION_AUTO"to properly qualify the constant or"\"AUTO\""to match the placeholder format. This same unqualified pattern appears systematically across search_nodes config files (config1.json, config2.json, config4.json).🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search_nodes/config/config7.json` at line 299, The defaultValue "COMPRESSION_AUTO" is unqualified for a field with ballerinaType "grpc:Compression"; update the defaultValue in this config (and the same occurrences in config1.json, config2.json, config4.json) to either the fully qualified constant "grpc:COMPRESSION_AUTO" or to the quoted placeholder literal "\"AUTO\"" so it matches the project's format for grpc compression constants — locate the JSON property "defaultValue" for the node entries where "ballerinaType" == "grpc:Compression" and replace the unqualified token accordingly.flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search_nodes/config/config7.json-184-184 (1)
184-184:⚠️ Potential issue | 🟡 MinorFix timeout defaultValue to use proper decimal literal syntax.
Line 184 sets
"defaultValue": "60"for a decimal type field. SincedefaultValuestrings are inserted directly into generated Ballerina code, this must be a valid decimal literal. The placeholder correctly shows"0.0d", indicating the expected format.✅ Suggested fix
- "defaultValue": "60" + "defaultValue": "60.0d"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search_nodes/config/config7.json` at line 184, The defaultValue for the decimal-typed field is currently the string "60", which will be injected directly into generated Ballerina code and is not a valid decimal literal; locate the JSON node where "defaultValue": "60" is set for the decimal field (the entry with "defaultValue") and change it to a proper decimal literal string such as "60.0d" (matching the "0.0d" pattern used elsewhere) so the generated Ballerina code receives a valid decimal literal.flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_call_flow_node_9.json-222-222 (1)
222-222:⚠️ Potential issue | 🟡 MinorDefault value format no longer matches maxIter placeholder/type (Line 222).
The placeholder/type still show a quoted literal, so an unquoted token may not round‑trip or match strict checks in consumers. Consider keeping the quoted literal here or updating the placeholder/type to match the new format.💡 Possible fix (keep quoted literal)
- "defaultValue": "INFER_TOOL_COUNT" + "defaultValue": "\"INFER_TOOL_COUNT\""🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_call_flow_node_9.json` at line 222, The JSON entry with "defaultValue": "INFER_TOOL_COUNT" is inconsistent with the maxIter placeholder/type format; locate the maxIter placeholder/type and make the formats match by updating the placeholder/type to use a quoted literal (e.g., wrap the placeholder/type in quotes) so it matches the "defaultValue": "INFER_TOOL_COUNT", or alternatively change the "defaultValue" token to an unquoted INFER_TOOL_COUNT—prefer updating the placeholder/type to quoted form to preserve round-trip compatibility.flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/model_template.json-289-290 (1)
289-290:⚠️ Potential issue | 🟡 MinorConsider consistency with placeholder formatting for decimal values.
The placeholder uses
0.0dwhile defaultValue uses0.7. For consistency with the pattern shown in the placeholder field, add thedsuffix:"defaultValue": "0.7d". While Ballerina's decimal type context makes the suffix optional, matching the placeholder format improves consistency.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/model_template.json` around lines 289 - 290, Update the JSON entry so the "defaultValue" uses the same decimal suffix as the "placeholder" (change the value from "0.7" to "0.7d"); locate the object that contains the "placeholder": "0.0d" and the "defaultValue" key and make the string for "defaultValue" include the trailing "d" to match formatting consistency.flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/model_template.json-593-594 (1)
593-594:⚠️ Potential issue | 🟡 MinorFix
http:CompressiondefaultValue format to match the finite string type definition.
AUTOmust be either qualified ashttp:COMPRESSION_AUTO(matching thehttp:HttpVersionpattern) or quoted as"AUTO"(matching the select option values) to generate valid Ballerina code. The current unquoted, unqualified format will cause compilation errors.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/model_template.json` around lines 593 - 594, The defaultValue for the http:Compression field is incorrectly unqualified/unquoted (currently AUTO); update the "defaultValue" in the http:Compression entry so it matches the finite string type: either set it to the fully qualified symbol http:COMPRESSION_AUTO or to the quoted string "AUTO" so generated Ballerina code compiles; look for the http:Compression object and its "defaultValue" key in model_template.json and replace the value accordingly.flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_call_template.json-433-433 (1)
433-433:⚠️ Potential issue | 🟡 MinorUse explicit default value instead of bare identifier.
ThedefaultValueuses"sessionId"as an unquoted identifier without guaranteed scope at generation time. Other similar template files use either explicit constants like"DEFAULT_SESSION_ID"or empty string literals. Align with the convention used in comparable templates for consistency and to ensure the default value is deterministic.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_call_template.json` at line 433, The JSON template's "defaultValue" currently uses the bare identifier "sessionId"; change it to an explicit deterministic literal (e.g., "DEFAULT_SESSION_ID" or an empty string "") so it matches the convention used in other templates and avoids relying on external scope. Update the "defaultValue" entry in the agent_call_template.json to the chosen constant string and ensure any consuming code that expects "sessionId" is adjusted to read the explicit literal instead.flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_call_template_hide_td.json-455-455 (1)
455-455:⚠️ Potential issue | 🟡 MinorChange
defaultValue: "new"todefaultValue: "new ()"for syntactically correct Ballerina code generation.In Ballerina,
newalone is not a valid constructor expression; it must include parentheses asnew (). While the placeholder correctly showsnew (), thedefaultValueshould match this syntax to ensure the generated code is valid if this default is used in code generation.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_call_template_hide_td.json` at line 455, The JSON property defaultValue currently contains the invalid constructor string "new" which produces incorrect Ballerina code; update the value of the "defaultValue" key in the agent_call_template_hide_td.json entry from "new" to "new ()" so it matches the placeholder and yields a syntactically correct Ballerina constructor expression.flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/connectors/http.json-199-205 (1)
199-205:⚠️ Potential issue | 🟡 MinorFix broken Markdown link in Asana description.
There’s a space between
]and(, which prevents Markdown link rendering in UIs that parse this field.🛠️ Suggested fix
- "description": "This is the interface for interacting with the [Asana Platform](https://developers.asana.com). Our API reference is generated from our [OpenAPI spec] (https://raw.githubusercontent.com/Asana/openapi/master/defs/asana_oas.yaml).", + "description": "This is the interface for interacting with the [Asana Platform](https://developers.asana.com). Our API reference is generated from our [OpenAPI spec](https://raw.githubusercontent.com/Asana/openapi/master/defs/asana_oas.yaml).",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/connectors/http.json` around lines 199 - 205, The Asana connector metadata.description contains a broken Markdown link due to a stray space between `]` and `(`; update the metadata.description string in the JSON (the "metadata" -> "description" value for the Asana connector) by removing the space so the OpenAPI URL is formatted as a proper Markdown link (i.e., "...from our [OpenAPI spec](https://raw.githubusercontent.com/Asana/openapi/master/defs/asana_oas.yaml).").
🧹 Nitpick comments (7)
flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/memory_manager_template_ballerina.json (1)
53-62: Default value change looks reasonable; verify placeholder consistency.The change from
"0"to"10"for the default size is semantically appropriate—a message window with zero capacity wouldn't be useful. However, there's a mismatch betweenplaceholder("0"on line 53) anddefaultValue("10"on line 62). If the placeholder is meant to hint at the default, consider updating it to"10"for consistency.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/memory_manager_template_ballerina.json` around lines 53 - 62, The JSON shows a mismatch between the "placeholder" ("0") and the "defaultValue" ("10") for the memory size field (codedata.originalName: "size"); update the "placeholder" value to "10" so it consistently hints the actual default, and verify no other references rely on a placeholder of "0" (check any UI rendering that uses "placeholder" vs "defaultValue").flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/node_template/config/new_connection-oracledb.json (1)
90-90: Consider using a less privileged default user.The
sysaccount is Oracle's most privileged system administrator account. Using it as a default in connection templates may inadvertently encourage insecure practices when developers use this as a starting point. Consider using a generic placeholder like"dbuser"or leaving it empty/null to prompt users to provide their own credentials.Suggested change
- "defaultValue": "\"sys\"" + "defaultValue": "\"dbuser\""🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/node_template/config/new_connection-oracledb.json` at line 90, The template currently sets the JSON property "defaultValue" to the highly-privileged value "sys"; update that "defaultValue" entry (the one showing "\"sys\"") to a less privileged placeholder such as "dbuser" or set it to an empty/null value so users are prompted to supply credentials; ensure you update only the defaultValue field in the new_connection-oracledb template to avoid changing other keys or structure.flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search_nodes/config/config9.json (1)
153-153: Format inconsistency betweenplaceholderanddefaultValue.The
defaultValueis now unquoted ("INFER_TOOL_COUNT"), while theplaceholderat line 144 remains quoted ("\"INFER_TOOL_COUNT\""). If this format difference is intentional (e.g., due to how the BI plugin processes these fields differently), this is fine. Otherwise, consider aligning the formats.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search_nodes/config/config9.json` at line 153, The config has inconsistent formatting between the "placeholder" and "defaultValue" fields (placeholder contains an escaped quoted string "\"INFER_TOOL_COUNT\"" while defaultValue is "INFER_TOOL_COUNT"); update one to match the other so both use the same representation (either both as a raw string value or both as an explicitly quoted/escaped string) — locate the JSON object containing the "placeholder" and "defaultValue" keys in config9.json and make the formats consistent for those two fields.flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/model_provider_manager/config/get_wso2_model_provider_template.json (1)
268-295: Consider using explicit decimal literal"60d"for clarity.While Ballerina supports context-based type inference (allowing
60to be inferred asdecimalwhen expected), using the explicitdsuffix makes the intent clearer and is a recommended style practice for numeric defaults in decimal-typed fields.Suggested improvement
- "defaultValue": "60" + "defaultValue": "60d"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/model_provider_manager/config/get_wso2_model_provider_template.json` around lines 268 - 295, The defaultValue for the "timeout" field is currently the string "60" but should use an explicit decimal literal to match the field's ballerinaType; update the "timeout" entry's defaultValue to "60d" (the "timeout" object and its "defaultValue" property) so the default unambiguously represents a decimal literal while preserving all other metadata.flow-model-generator/modules/flow-model-index-generator/src/main/java/io/ballerina/indexgenerator/IndexGenerator.java (1)
122-123: RedundantObjects.requireNonNullonOptional.
PackageUtil.getModulePackage()returnsOptional<Package>, so wrapping it withObjects.requireNonNull()before callingorElseThrow()is redundant. TheOptionalitself is never null; if no package is found, it returnsOptional.empty().♻️ Suggested simplification
- resolvedPackage = Objects.requireNonNull(PackageUtil.getModulePackage(org, - packageMetadataInfo.name(), packageMetadataInfo.version())).orElseThrow(); + resolvedPackage = PackageUtil.getModulePackage(org, + packageMetadataInfo.name(), packageMetadataInfo.version()) + .orElseThrow(() -> new IllegalStateException( + "Package not found: " + packageMetadataInfo.name()));🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-index-generator/src/main/java/io/ballerina/indexgenerator/IndexGenerator.java` around lines 122 - 123, The code redundantly wraps the Optional returned by PackageUtil.getModulePackage(...) with Objects.requireNonNull before calling orElseThrow; remove the Objects.requireNonNull call and directly call PackageUtil.getModulePackage(org, packageMetadataInfo.name(), packageMetadataInfo.version()).orElseThrow(...) to assign resolvedPackage in IndexGenerator (so rely on Optional emptiness rather than a null check on the Optional itself).model-generator-commons/src/main/java/io/ballerina/modelgenerator/commons/FunctionDataBuilder.java (1)
281-310: Consider adding exception message toorElseThrow.Line 300: The
orElseThrow()call without a message will produce an unclearNoSuchElementExceptionif the semantic model is unavailable. Adding context would help debugging.♻️ Suggested improvement
- SemanticModel semanticModel = workspaceManager.semanticModel(filePath).orElseThrow(); + SemanticModel semanticModel = workspaceManager.semanticModel(filePath) + .orElseThrow(() -> new IllegalStateException( + "Semantic model not available for: " + filePath));🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@model-generator-commons/src/main/java/io/ballerina/modelgenerator/commons/FunctionDataBuilder.java` around lines 281 - 310, In resolvePackageAndSemanticModel(), the call workspaceManager.semanticModel(filePath).orElseThrow() can throw a NoSuchElementException with no context; change it to provide a clear exception message (e.g., use orElseThrow(() -> new NoSuchElementException("semantic model not found for file: " + filePath))) or another appropriate runtime exception so failures show which file and why; update the SemanticModel retrieval in resolvePackageAndSemanticModel to include that message and keep the rest of the method logic intact.flow-model-generator/modules/flow-model-index-generator/src/main/java/io/ballerina/indexgenerator/SearchIndexGenerator.java (1)
125-126: RedundantObjects.requireNonNullonOptional.Same issue as in
IndexGenerator.java. TheOptionalreturned byPackageUtil.getModulePackage()is never null; wrapping it withObjects.requireNonNull()is unnecessary.♻️ Suggested simplification
- resolvedPackage = Objects.requireNonNull(PackageUtil.getModulePackage(org, - packageMetadataInfo.name(), packageMetadataInfo.version())).orElseThrow(); + resolvedPackage = PackageUtil.getModulePackage(org, + packageMetadataInfo.name(), packageMetadataInfo.version()) + .orElseThrow(() -> new IllegalStateException( + "Package not found: " + packageMetadataInfo.name()));🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@flow-model-generator/modules/flow-model-index-generator/src/main/java/io/ballerina/indexgenerator/SearchIndexGenerator.java` around lines 125 - 126, In SearchIndexGenerator, remove the redundant Objects.requireNonNull wrapper around the Optional returned by PackageUtil.getModulePackage and call .orElseThrow() directly on that Optional when assigning to resolvedPackage; specifically update the assignment that currently uses Objects.requireNonNull(PackageUtil.getModulePackage(...)).orElseThrow() to just PackageUtil.getModulePackage(...).orElseThrow() to avoid the unnecessary null-check on an Optional.
| "originalName": "agentType" | ||
| }, | ||
| "defaultValue": "\"FUNCTION_CALL_AGENT\"" | ||
| "defaultValue": "FUNCTION_CALL_AGENT" |
There was a problem hiding this comment.
Align agentType.defaultValue with the select option values.
Options/placeholder still use quoted strings, so an unquoted default may not match and the UI may not preselect. Either unquote the option values/placeholder too or keep the default quoted.
💡 Minimal consistency fix (revert to quoted)
- "defaultValue": "FUNCTION_CALL_AGENT"
+ "defaultValue": "\"FUNCTION_CALL_AGENT\""🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/agents_manager/config/agent_call_template.json`
at line 155, agentType.defaultValue must match the quoting style of the select
option values/placeholder; update the JSON so the default is a string value
consistent with the options (either change agentType.defaultValue to the quoted
string "FUNCTION_CALL_AGENT" or remove quotes from the select option
values/placeholder) — locate the agentType.defaultValue entry and the select
options/placeholder in the same JSON and make their value styles identical.
...ow-model-generator-ls-extension/src/test/resources/agents_manager/config/model_template.json
Show resolved
Hide resolved
...ow-model-generator-ls-extension/src/test/resources/agents_manager/config/model_template.json
Show resolved
Hide resolved
...ion/src/test/resources/model_provider_manager/config/get_ollama_model_provider_template.json
Show resolved
Hide resolved
...ion/src/test/resources/model_provider_manager/config/get_ollama_model_provider_template.json
Show resolved
Hide resolved
...-ls-extension/src/test/resources/model_provider_manager/source/model_provider/Ballerina.toml
Show resolved
Hide resolved
...iagram-util/src/main/java/org/ballerinalang/diagramutil/connector/models/connector/Type.java
Show resolved
Hide resolved
...iagram-util/src/main/java/org/ballerinalang/diagramutil/connector/models/connector/Type.java
Show resolved
Hide resolved
model-generator-commons/src/main/java/io/ballerina/modelgenerator/commons/CommonUtils.java
Show resolved
Hide resolved
model-generator-commons/src/main/java/io/ballerina/modelgenerator/commons/PackageUtil.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@flow-model-generator/modules/flow-model-generator-core/src/main/java/io/ballerina/flowmodelgenerator/core/model/Property.java`:
- Around line 802-810: The code in Property.java (inside the loop iterating
reorderedOptions) calls reorderedOptions.addFirst(option) but reorderedOptions
is an ArrayList so addFirst() doesn't exist; replace the addFirst usage with
reorderedOptions.add(0, option) to insert at the front. Apply the same fix
wherever this pattern occurs (e.g., SourceBuilder.java,
AbstractServiceBuilder.java, TypesManager.java, AbstractCdcServiceBuilder.java)
— find occurrences of .addFirst(...) on variables declared as ArrayList and
change them to .add(0, ...), ensuring the collection types remain List/ArrayList
and no Deque-specific imports are used.
In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/default.json`:
- Around line 559-561: Fix the typos in the JSON descriptions by updating any
description text that contains "implmenting", "lenthy", or "Stackoverflow" to
the correct spellings; specifically change "implmenting" to "implementing" in
the description for the entry with "label": "BaseToolKit" and correct other
occurrences (e.g., change "lenthy" to "lengthy" and "Stackoverflow" to "Stack
Overflow") wherever those misspellings appear in this JSON (also matching the
other occurrence noted similar to the BaseToolKit entry).
- Around line 143-227: The test resource wrongly lists JsonPathValue as a
top-level exported type for data.jsondata v1.1.3; remove the item whose
metadata.label is "JsonPathValue" (codedata.module "data.jsondata",
codedata.symbol "JsonPathValue", version "1.1.3") from the JSON array (or set
its enabled flag to false) so only actual exported types (Error, Options,
NameConfig, JsonPathRawTemplate) remain, or alternatively document/justify its
presence if there's an explicit testing reason.
...-model-generator-core/src/main/java/io/ballerina/flowmodelgenerator/core/model/Property.java
Show resolved
Hide resolved
...odules/flow-model-generator-ls-extension/src/test/resources/search/config/types/default.json
Show resolved
Hide resolved
...odules/flow-model-generator-ls-extension/src/test/resources/search/config/types/default.json
Show resolved
Hide resolved
87d6fd0
into
ballerina-platform:main
Purpose
$subject.
Goals
Approach
User stories
Release note
Documentation
Training
Certification
Marketing
Automation tests
Security checks
Samples
Related PRs
Migrations (if applicable)
Test environment
Learning