Skip to content

Commit

Permalink
fix cContextVar OPTIONS LookupError
Browse files Browse the repository at this point in the history
  • Loading branch information
shenchucheng committed Dec 15, 2023
1 parent 32d6898 commit 335a025
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions metagpt/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ class Config(metaclass=Singleton):
default_yaml_file = METAGPT_ROOT / "config/config.yaml"

def __init__(self, yaml_file=default_yaml_file):
golbal_options = OPTIONS.get()
self._init_with_config_files_and_env(yaml_file)
logger.debug("Config loading done.")
self._update()
golbal_options.update(OPTIONS.get())

def _update(self):
# logger.info("Config loading done.")
Expand Down
2 changes: 1 addition & 1 deletion metagpt/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import metagpt

OPTIONS = contextvars.ContextVar("OPTIONS")
OPTIONS = contextvars.ContextVar("OPTIONS", default={})


def get_metagpt_package_root():
Expand Down

0 comments on commit 335a025

Please sign in to comment.