Bug: prompt templates fail to load unless score.py is run from the repo root (template_dir is CWD-relative)

Author: rajarshidattapyCreated Sep 12, 2026Updated Sep 12, 2026

Description

TemplateManager resolves its template directory relative to the current working directory, not the module's location:

https://github.com/interviewstreet/hiring-agent/blob/70fd3ea/prompts/template_manager.py#L21

python
def __init__(self, template_dir: str = "prompts/templates"):

Other modules already resolve paths from __file__ (roles.py uses Path(__file__).parent / "roles", config.py uses Path(__file__).parent / "providers.json"), so role/provider loading works from any directory but the extraction templates don't.

Steps to reproduce

bash
cd /some/other/dir
python /path/to/hiring-agent/score.py /path/to/resume.pdf --role software_engineering_intern

Or minimally:

python
import sys; sys.path.insert(0, "/path/to/hiring-agent")
from prompts.template_manager import TemplateManager
TemplateManager().render_template("basics", text_content="x")

Actual

⚠️ Template file not found: prompts/templates\basics.jinja
⚠️ Template file not found: prompts/templates\work.jinja
... (all 8 templates)
❌ Template not found for section: basics
Available sections: []

Every section render returns None, extraction is aborted, and no resume is scored.

Expected

Templates load regardless of the working directory, e.g.:

python
DEFAULT_TEMPLATE_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "templates")

Source: interviewstreet/hiring-agent