Skip to content

Bug: _find_checkpoint() glob paths are relative to process cwd — ML path silently disabled outside repo root #56

Description

@bradsmithmba

Summary

_find_checkpoint() uses glob.glob('models/checkpoints/best_model.pth') and similar relative paths. When the process is launched from any directory other than the repo root (e.g., the CLI is run from ~ or a different project dir), all patterns match nothing and the function returns None, silently forcing the heuristic path every time.

Evidence

src/api/enhanced_strategy_recommender.py lines 113-118: five glob.glob() calls with relative path strings, no Path(__file__) anchor.

Fix

Anchor to the module's own location:

repo_root = Path(__file__).parents[3]
patterns = [str(repo_root / p) for p in [...]]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions