Skip to content

fix: return error instead of silent Ok in hot_reload_plugin#291

Merged
lijingrs merged 1 commit intomofa-org:mainfrom
Avi-47:fix-hot-reload-stub
Feb 24, 2026
Merged

fix: return error instead of silent Ok in hot_reload_plugin#291
lijingrs merged 1 commit intomofa-org:mainfrom
Avi-47:fix-hot-reload-stub

Conversation

@Avi-47
Copy link
Copy Markdown
Contributor

@Avi-47 Avi-47 commented Feb 23, 2026

📋 Summary

The current implementation of hot_reload_plugin silently returns Ok(vec![]) without performing any action.

This can mislead callers into assuming that the plugin was successfully reloaded.

This PR updates the method to return an explicit AgentError, clearly indicating that plugin hot reloading is not yet implemented.


🔗 Related Issues

Closes #287


🧠 Context

Returning Ok(vec![]) from an unimplemented API can lead to silent failures and undefined behavior from the caller’s perspective.

It is better to return an explicit error until the feature is properly implemented, ensuring predictable and transparent API behavior.


🛠️ Changes

  • Replaced Ok(vec![]) with Err(AgentError::Other(...))
  • Prevented silent success behavior
  • Made API behavior explicit and safe

🧪 How you Tested

  1. Ran cargo build --workspace
  2. Verified compilation succeeds without errors
  3. Confirmed no other functionality was affected

⚠️ Breaking Changes

  • No breaking changes
  • Breaking change (describe below)

🧹 Checklist

Code Quality

  • Code follows Rust idioms and project conventions
  • cargo fmt run
  • cargo clippy passes without warnings

Testing

  • Tests added/updated (not applicable — behavior change only)
  • cargo test passes locally without any error

Documentation

  • Public APIs documented (no new API introduced)
  • README / docs updated (not required)

PR Hygiene

  • PR is small and focused (one logical change)
  • Branch is up to date with main
  • No unrelated commits
  • Commit messages explain why, not only what

🧩 Additional Notes for Reviewers

This change intentionally avoids implementing the full hot reload logic.
It only corrects the misleading success behavior of the existing stub.

@Avi-47 Avi-47 changed the title fix: return explicit error for unimplemented hot_reload_plugin fix: return error instead of silent Ok in hot_reload_plugin Feb 23, 2026
@lijingrs lijingrs merged commit 359ed82 into mofa-org:main Feb 24, 2026
5 checks passed
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.

[Bug] hot_reload_plugin in ToolRegistry is an unimplemented stub that silently fails

2 participants