* fix: presever the local setting between frontend and backend * Added unit test for the state preservation * fix: passing the locale to the agent call * fix: apply the fix after code review