Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/llama_stack/cli/stack/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,17 @@ def _run_stack_run_cmd(self, args: argparse.Namespace) -> None:
try:
config = parse_and_maybe_upgrade_config(config_dict)
# Create external_providers_dir if it's specified and doesn't exist
if config.external_providers_dir and not os.path.exists(str(config.external_providers_dir)):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand. how is this code path reachable given this conditional explicitly filters it out?

Here's what happened in my opinion:

The summaries on your other PRs have the same symptom. Please please don't do that and consider carefully reviewing / understanding the code that was produced. This is otherwise actively harmful to the project since it takes away reviewing resources.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep you are correct, I'm still debugging it locally, and unfortunatly I failed to notice this was not an issue to begin with when I was assigned.
Sorry for that

os.makedirs(str(config.external_providers_dir), exist_ok=True)
if config.external_providers_dir is not None:
ext_dir = Path(config.external_providers_dir)
if not ext_dir.exists():
try:
logger.info(f"Creating external providers directory: {ext_dir}")
ext_dir.mkdir(parents=True, exist_ok=True)
except (OSError, PermissionError) as e:
self.parser.error(
f"Failed to create external_providers_dir '{ext_dir}': {e}\n"
f"Please ensure you have write permissions or specify a different path."
)
except AttributeError as e:
self.parser.error(f"failed to parse config file '{config_file}':\n {e}")

Expand Down
3 changes: 3 additions & 0 deletions src/llama_stack/core/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ def _convert_string_to_proper_type(value: str) -> Any:
# providers config should be typed this way.
# TODO: we could try to load the config class and see if the config has a field with type 'str | None'
# and then convert the empty string to None or not
# NOTE: Empty strings from env var defaults (e.g., ${VAR:=}) are converted to None.
# Code that uses these values MUST check for None explicitly (not just truthiness)
# to avoid converting None to the string "None" later.
if value == "":
return None

Expand Down
Loading