Skip to content

Conversation

@CodeCasterX
Copy link
Member

  • Added a closed flag to DefaultMcpClient to track client lifecycle state.
  • Prevent method invocations after closure by adding checks in initialize(), getTools(), and callTool().
  • Safely handle potential nulls in close() to avoid exceptions during partial initialization.
  • Ensures consistent behavior and prevents resource leaks or usage after the client has been closed.

This change improves reliability and correctness by enforcing proper usage of the MCP client throughout its lifecycle.

- Added a closed flag to DefaultMcpClient to track client lifecycle state.
- Prevent method invocations after closure by adding checks in initialize(), getTools(), and callTool().
- Safely handle potential nulls in close() to avoid exceptions during partial initialization.
- Ensures consistent behavior and prevents resource leaks or usage after the client has been closed.

This change improves reliability and correctness by enforcing proper usage of the MCP client throughout its lifecycle.
@CodeCasterX CodeCasterX added this to the 3.5.0 milestone May 28, 2025
@CodeCasterX CodeCasterX requested a review from loveTsong May 28, 2025 12:50
@CodeCasterX CodeCasterX self-assigned this May 28, 2025
@CodeCasterX CodeCasterX added type: enhancement A general enhancement in: fel Issues in FEL(FIT Expression for LLM) modules labels May 28, 2025
@CodeCasterX CodeCasterX added this to Nova May 28, 2025
@CodeCasterX CodeCasterX merged commit 6bcdba2 into ModelEngine-Group:3.5.x May 28, 2025
1 check passed
@github-project-automation github-project-automation bot moved this to Done in Nova May 28, 2025
Yager-42 pushed a commit to Yager-42/fit-framework that referenced this pull request Aug 16, 2025
…ng (ModelEngine-Group#146)

- Added a closed flag to DefaultMcpClient to track client lifecycle state.
- Prevent method invocations after closure by adding checks in initialize(), getTools(), and callTool().
- Safely handle potential nulls in close() to avoid exceptions during partial initialization.
- Ensures consistent behavior and prevents resource leaks or usage after the client has been closed.

This change improves reliability and correctness by enforcing proper usage of the MCP client throughout its lifecycle.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: fel Issues in FEL(FIT Expression for LLM) modules type: enhancement A general enhancement

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant