Skip to content

Commit

Permalink
Merge pull request #566 from shenchucheng/fix-options-lookuperror
Browse files Browse the repository at this point in the history
fix cContextVar OPTIONS LookupError
garylin2099 authored Dec 15, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 32d6898 + 335a025 commit f65c7a0
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
@@ -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.")
2 changes: 1 addition & 1 deletion metagpt/const.py
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@

import metagpt

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


def get_metagpt_package_root():

0 comments on commit f65c7a0

Please sign in to comment.