Skip to content

Comments

feat(cli): rebased backend command wiring fix for #146#219

Merged
lijingrs merged 9 commits intomofa-org:mainfrom
Rahul-2k4:feature/cli-backend-connections-146-rebased
Feb 22, 2026
Merged

feat(cli): rebased backend command wiring fix for #146#219
lijingrs merged 9 commits intomofa-org:mainfrom
Rahul-2k4:feature/cli-backend-connections-146-rebased

Conversation

@Rahul-2k4
Copy link
Contributor

@Rahul-2k4 Rahul-2k4 commented Feb 22, 2026

📋 Summary

This PR reintroduces and finalizes the backend CLI command wiring for agent/plugin/session/tool flows after regressions from #148.
It restores the complete #146 behavior set from PR #154, rebased cleanly onto latest main, with equivalent code content and a conflict-free history.

🔗 Related Issues

Closes #146

Related to #148, #154


🧠 Context

PR #148 introduced build/runtime regressions and did not fully implement the intended command backend behavior.
PR #154 already had end-to-end implementation for the required command flows, but maintainers requested a latest-main conflict resolution and resubmission.

This branch (feature/cli-backend-connections-146-rebased) is a clean rebased replacement preserving the same functional scope as #154 while aligning with current main.


🛠️ Changes

  • Restored full backend wiring in mofa-cli command surface (agent/plugin/session/tool) through CliContext, registries, and persistent stores.
  • Preserved/validated lifecycle correctness improvements:
    • explicit agent factory selection support (agent start --type)
    • safer persistence/registry ordering in start/stop/uninstall paths
    • canonical session key behavior and session list key extraction improvements
  • Kept command-chain regression coverage for key flows (start/stop/restart/list and session command behavior).
  • Rebasing work only: no net functional delta vs feat(cli): implement backend wiring for agent/plugin/session/tool commands #154 content; history cleaned for maintainability.

🧪 How you Tested

  1. Rebased branch onto latest origin/main and verified clean replay of all feature commits via git range-diff.
  2. Verified content equivalence vs previous feature branch using git diff (no file-content drift between old/new feature branches).
  3. Ran:
    • cargo test -p mofa-cli -p mofa-foundation
    • Result: all passing (mofa-cli: 37 tests, mofa-foundation: 201 tests, doctests completed)

##Logs

CLI verification summary:

  • mofa-cli: 37 passed, 0 failed
  • mofa-foundation: 201 passed, 0 failed
  • doctests completed successfully

⚠️ Breaking Changes

  • No breaking changes
  • Breaking change (describe below)

If breaking:


🧹 Checklist

Code Quality

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

Testing

  • Tests added/updated
  • cargo test passes locally without any error

Documentation

  • Public APIs documented
  • README / docs updated (if needed)

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

@mugiwaraluffy56
Copy link
Contributor

nice work buddy :) , i was about to start fixing the ci tests, and suddenly my pr got merged , so i was not able to fix those issues.

@Rahul-2k4
Copy link
Contributor Author

@mugiwaraluffy56 yeah had a lot of things to work upon , np but atleast u should have informed @lijingrs abt this , i had again lots of doubts wt happened and how was it merged 😆 .
next time be aware of this and let maintainers or the person involve know abt this mistake , coz this could break a lot of things in legacy code and users have a bad experience . but truly had fun implementing this feature

@mugiwaraluffy56
Copy link
Contributor

yep @Rahul-2k4 i wont repeat these mistakes next time.

@Rahul-2k4 Rahul-2k4 force-pushed the feature/cli-backend-connections-146-rebased branch from 97ef682 to a4931f0 Compare February 22, 2026 07:15
@Rahul-2k4
Copy link
Contributor Author

Rahul-2k4 commented Feb 22, 2026

@lijingrs ill ping u when i have reviewed it once more , until then pls dont merge as this is a big implementation that is why it is hard to review

@lijingrs
Copy link
Collaborator

@lijingrs ill ping u when i have reviewed it once more , until then pls dont merge as this is a big implementation that is why it is hard to review

Got it added to the review list

@Rahul-2k4
Copy link
Contributor Author

hi @lijingrs i have reviewed this myself as well as also double checked with copilot .it is all good to go .
thank you 😉

@lijingrs
Copy link
Collaborator

hi @lijingrs i have reviewed this myself as well as also double checked with copilot .it is all good to go . thank you 😉

Thanks for your contribution. Could you implement practical example code under the examples directory, from a user's perspective, to verify whether all CLI commands are production-ready?

@lijingrs
Copy link
Collaborator

You've implemented many features. Could you also update the README at the same time? Thanks!

@Rahul-2k4
Copy link
Contributor Author

ok sure @lijingrs ill look into this thing and will ping u after awhile
should i make a different pr for that or update the existing one?

@Rahul-2k4
Copy link
Contributor Author

some questions :
How much README change should i include with this PR?

  1. Focused section Add a new 'CLI production smoke example' section with exact commands and expected outcomes only.

  2. Broader CLI rewrite Rework multiple CLI sections and command docs;higher review load and more churn.

  3. Minimal note + link Small note in README linking to example folder;fastest but may not satisfy

@lijingrs
Copy link
Collaborator

ok sure @lijingrs ill look into this thing and will ping u after awhile should i make a different pr for that or update the existing one?
Yeah, You can create a new PR. In practice, you might encounter various issues that AI cannot help you decide on. This is where you, as the magician, need to infuse the framework with soul and validate our code through real-world application. Much of the code generated by AI tends to be superficial, so it requires hands-on practice to polish the functionality and make it more mature.

@Rahul-2k4
Copy link
Contributor Author

Rahul-2k4 commented Feb 22, 2026

i think ill include the focused section for this

@lijingrs
Copy link
Collaborator

i think ill include the focused section for this

Perfect Go ahead!

@Rahul-2k4
Copy link
Contributor Author

Rahul-2k4 commented Feb 22, 2026

ok @lijingrs u can merge this , ill shortly open a pr for the other requirement which are essential and wt u asked for . thank u 😉 🚀

@lijingrs lijingrs merged commit 6843d48 into mofa-org:main Feb 22, 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.

feature(cli): Implement missing backend connections for CLI commands

4 participants