Skip to content

Comments

Sync main with 1.6.x branch#712

Merged
NipunaRanasinghe merged 39 commits intoballerina-platform:mainfrom
NipunaRanasinghe:1.6.x-main-sync
Feb 18, 2026
Merged

Sync main with 1.6.x branch#712
NipunaRanasinghe merged 39 commits intoballerina-platform:mainfrom
NipunaRanasinghe:1.6.x-main-sync

Conversation

@NipunaRanasinghe
Copy link
Contributor

Purpose

$subject.

Goals

Describe the solutions that this feature/fix will introduce to resolve the problems described above

Approach

Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email documentation@wso2.com to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.

User stories

Summary of user stories addressed by this change>

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact

Training

Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable

Certification

Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why.

Marketing

Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable

Automation tests

  • Unit tests

    Code coverage information

  • Integration tests

    Details about the test cases and coverage

Security checks

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

Migrations (if applicable)

Describe migration steps and platforms on which migration has been tested

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

Learning

Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.

samithkavishke and others added 30 commits February 16, 2026 19:08
- 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
Copilot AI review requested due to automatic review settings February 17, 2026 17:33
@coderabbitai
Copy link

coderabbitai bot commented Feb 17, 2026

📝 Walkthrough

Walkthrough

Propagates 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

Cohort / File(s) Summary
Core generator wiring
flow-model-generator/.../AgentsGenerator.java, AvailableNodesGenerator.java, CodeAnalyzer.java, flow-model-generator-core/.../model/McpToolKitBuilder.java
Compute and propagate ModuleInfo, resolved Package, workspaceManager and filePath into FunctionDataBuilder; call sites updated to pass these contexts.
Builder nodes — context threading
flow-model-generator-core/.../model/node/*Builder.java (CallBuilder, ChunkerBuilder, DataLoaderBuilder, EmbeddingProviderBuilder, KnowledgeBaseBuilder, MemoryBuilder, MemoryStoreBuilder, ModelProviderBuilder, NewConnectionBuilder, ResourceActionCallBuilder, VectorStoreBuilder, NPFunctionCall, NPFunctionDefinitionBuilder, FunctionCall, NPFunctionCall.java)
Replaced inline module/semantic-model loading with PackageUtil usage; add .workspaceManager(...) and .filePath(...) to FunctionDataBuilder chains; pass defaultValue into typeWithExpression where applicable.
FunctionDataBuilder & Common utils
model-generator-commons/.../FunctionDataBuilder.java, CommonUtils.java, PackageUtil.java
Added workspace/document/package resolution inside FunctionDataBuilder, new builder setters (document, workspaceManager, filePath), centralized CommonUtils.resolveDefaultValue overloads, PackageUtil moved to Environment APIs and added resolveModulePackage/isLocalFunction helpers.
Type & property resolution
misc/diagram-util/.../Type.java, flow-model-generator-core/.../model/Property.java
Added packageName-aware fromSemanticSymbol overloads, default extraction helpers, enum-default reordering helpers, and new Property.typeWithExpression overloads to honor default values and module context.
Index & service generators
flow-model-index-generator/.../IndexGenerator.java, SearchIndexGenerator.java, service-model-index-generator/.../ServiceIndexGenerator.java
Removed BuildProject parameter usage; resolvePackage signatures simplified; per-function package resolution wired via PackageUtil; early-return on resolution errors added.
Diagram/util build and module changes
misc/diagram-util/build.gradle, misc/diagram-util/.../module-info.java
Added dependency on model-generator-commons and module require declaration.
Language server & extension
langserver-core/.../PullModuleExecutor.java, flow-model-generator-ls-extension/.../TypesManagerService.java
Run compilation after resolution; Type.fromSemanticSymbol calls updated to accept packageName.
Test & resource data
flow-model-generator-ls-extension/src/test/resources/... (numerous JSON templates, node templates, connectors, model/provider templates, chunker/vector/embedding templates, search/function/type manifests, added enum test files)
Widespread updates to defaultValue entries (replace literals with constants/constructed defaults, numeric defaults, HTTP/version/compression/validation changes), icon/version bumps, many manifest remappings and additions (including new Ballerina.toml and default_enum resources).

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • KavinduZoysa
  • pasindufernando1
  • LakshanWeerasinghe
  • madushajg

Poem

🐇 "A rabbit in the dev tree sings:
Module paths and workspace strings,
Defaults now find their rightful place,
Enums parade with honored grace,
Builders hop along — context brings!"

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description consists entirely of the template placeholder text with no substantive content filled in (all sections contain only template instructions prefixed with '>'). Replace placeholder template text with actual content describing the purpose, goals, approach, and other relevant details of the sync operation.
Docstring Coverage ⚠️ Warning Docstring coverage is 9.68% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Sync main with 1.6.x branch' clearly describes the main objective of the pull request: synchronizing the main branch with changes from the 1.6.x branch.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 | 🟡 Minor

Align placeholder with default value to avoid confusion.

placeholder is still "0" while defaultValue is 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 | 🟡 Minor

Placeholder and defaultValue format mismatch for maxIter.

The placeholder (line 143) is "\"INFER_TOOL_COUNT\"" (quoted string literal), but the defaultValue (line 152) is now "INFER_TOOL_COUNT" (unquoted identifier). Given the ballerinaType union 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 | 🟡 Minor

Update timeout defaultValue to use decimal literal syntax for consistency.

Line 180 sets "defaultValue": "60" while the field is a decimal type 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 | 🟡 Minor

Default value doesn’t match the single‑select option values (Lines 283–310).
The options are still quoted string literals, while defaultValue is 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 | 🟡 Minor

Use explicit decimal literal for temperature default value.

In this JSON template for code generation, the temperature field specifies "ballerinaType": "decimal" and the placeholder uses "0.0d" (with explicit d suffix). However, the defaultValue is "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 | 🟡 Minor

Align httpVersion default 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 | 🟡 Minor

Align agentType default 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 | 🟡 Minor

Align httpVersion default with select option values.

The option values are string literals ("\"2.0\"", "\"1.1\"", "\"1.0\""), but the default is the enum constant http: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_TEMPERATURE constant is missing from the codebase.

The JSON config references DEFAULT_TEMPERATURE as a default value for the decimal temperature field 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_TEMPERATURE constant 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 | 🟠 Major

Keep toolLoadingStrategy defaults 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 | 🟡 Minor

Update the defaultValue for compression to use the correct module qualification.

The unqualified COMPRESSION_AUTO should be qualified as http:COMPRESSION_AUTO based on patterns in similar config files and generated Ballerina code. Note: there is a type-value mismatch—ballerinaType references grpc:Compression but the constant comes from the http module.

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 | 🟡 Minor

Change the timeout defaultValue to use decimal literal format.

The field type is decimal but 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 | 🟠 Major

Add ai: module qualifier to unqualified defaultValue fields

The defaultValue fields use unqualified identifiers (FUNCTION_CALL_AGENT, DEFAULT_SESSION_ID, new MessageWindowChatMemory()) that require the ai: module prefix per Ballerina's module enumeration specification. The value field correctly uses ai: qualification (e.g., ai:REACT_AGENT), but the defaultValue field 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 | 🟡 Minor

HTTP constants are valid, but the timeout decimal should use the d suffix for consistency

Web search confirms http:HTTP_2_0 and http:COMPRESSION_AUTO are valid for ballerina/http 2.15.4. However, the timeout field's defaultValue: "60" should be "60d" to match the placeholder convention ("0.0d") and explicitly denote the decimal type, as the field's ballerinaType specifies decimal.

🤖 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 | 🟡 Minor

Align option values and placeholder with unquoted defaultValue format.

The options values and placeholder contain escaped quotes ("\"NO_FILTER\"", "\"LLM_FILTER\""), while defaultValue is unquoted (NO_FILTER). If the UI matches by string, the default won't cleanly map to available options. Either quote the defaultValue to 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 | 🔴 Critical

Fix JSON data: quote bare identifier defaults to produce valid Ballerina code.

The defaultValue for INFER_TOOL_COUNT and DEFAULT_SESSION_ID should be quoted as string literals. The ballerinaType for maxIter shows the union type "\"INFER_TOOL_COUNT\"|int", indicating the value should be the string "INFER_TOOL_COUNT", not a bare identifier. The current defaultValue: "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: maxIter defaultValue (and similar at 593–620, 884–911)
  • sessionId defaultValue in same and referenced sections

Apply 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 | 🟡 Minor

Change decimal defaultValue to literal format.

The timeout field with ballerinaType: "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 | 🟡 Minor

Align SINGLE_SELECT defaults with option values for consistent matching logic.

The httpVersion and compression fields use constant defaults (http:HTTP_2_0, http:COMPRESSION_AUTO) while option values are quoted literals ("\"2.0\"", "\"AUTO\""). The reorderOptionsByDefaultValue() 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 | 🟡 Minor

Fix 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 | 🟡 Minor

Fix 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 | 🟡 Minor

Grammar: 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 | 🟡 Minor

Guard null/blank versions before calling getModulePackage.
If service_artifacts.json omits a version for some entries, getModulePackage(org, name, version) can throw or fail to resolve. Consider using resolveModulePackage (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 | 🟡 Minor

Type mismatch: passing string literal instead of enum member.

function2("Tuesday") passes a string literal, but function2 expects a Day enum 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 | 🟡 Minor

Qualify 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 | 🟡 Minor

Fix timeout defaultValue to use proper decimal literal syntax.

Line 184 sets "defaultValue": "60" for a decimal type field. Since defaultValue strings 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 | 🟡 Minor

Default 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 | 🟡 Minor

Consider consistency with placeholder formatting for decimal values.

The placeholder uses 0.0d while defaultValue uses 0.7. For consistency with the pattern shown in the placeholder field, add the d suffix: "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 | 🟡 Minor

Fix http:Compression defaultValue format to match the finite string type definition.

AUTO must be either qualified as http:COMPRESSION_AUTO (matching the http:HttpVersion pattern) 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 | 🟡 Minor

Use explicit default value instead of bare identifier.
The defaultValue uses "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 | 🟡 Minor

Change defaultValue: "new" to defaultValue: "new ()" for syntactically correct Ballerina code generation.

In Ballerina, new alone is not a valid constructor expression; it must include parentheses as new (). While the placeholder correctly shows new (), the defaultValue should 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 | 🟡 Minor

Fix 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 between placeholder ("0" on line 53) and defaultValue ("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 sys account 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 between placeholder and defaultValue.

The defaultValue is now unquoted ("INFER_TOOL_COUNT"), while the placeholder at 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 60 to be inferred as decimal when expected), using the explicit d suffix 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: Redundant Objects.requireNonNull on Optional.

PackageUtil.getModulePackage() returns Optional<Package>, so wrapping it with Objects.requireNonNull() before calling orElseThrow() is redundant. The Optional itself is never null; if no package is found, it returns Optional.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 to orElseThrow.

Line 300: The orElseThrow() call without a message will produce an unclear NoSuchElementException if 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: Redundant Objects.requireNonNull on Optional.

Same issue as in IndexGenerator.java. The Optional returned by PackageUtil.getModulePackage() is never null; wrapping it with Objects.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"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants