diff --git a/metagpt/team.py b/metagpt/team.py index b98fc2efb..aad24efa0 100644 --- a/metagpt/team.py +++ b/metagpt/team.py @@ -83,11 +83,12 @@ class Team(BaseModel): """Invest company. raise NoMoneyException when exceed max_budget.""" self.investment = investment CONFIG.max_budget = investment + CONFIG.cost_manager.max_budget = investment logger.info(f"Investment: ${investment}.") @staticmethod def _check_balance(): - if CONFIG.cost_manager.total_cost > CONFIG.cost_manager.max_budget: + if CONFIG.cost_manager.total_cost >= CONFIG.cost_manager.max_budget: raise NoMoneyException( CONFIG.cost_manager.total_cost, f"Insufficient funds: {CONFIG.cost_manager.max_budget}" )