Why
Tracing is only useful if it is consistent and queryable. Some paths set LANGSMITH_API_KEY but not LANGCHAIN_API_KEY, and metadata tags are not consistently attached to runs.
Scope
Ensure LangSmith tracing is enabled consistently when LANGSMITH_API_KEY is present, and add standardized metadata (repo, workflow, run id, issue/PR number, step name) to LLM calls.
Non-Goals
- This does not add a dashboard.
- This does not change core prompts or evaluation logic.
Tasks
Acceptance Criteria
Implementation Notes
Primary files:
tools/llm_provider.py
scripts/langchain/pr_verifier.py
scripts/langchain/followup_issue_generator.py
Synced by workflow run.
Why
Tracing is only useful if it is consistent and queryable. Some paths set LANGSMITH_API_KEY but not LANGCHAIN_API_KEY, and metadata tags are not consistently attached to runs.
Scope
Ensure LangSmith tracing is enabled consistently when LANGSMITH_API_KEY is present, and add standardized metadata (repo, workflow, run id, issue/PR number, step name) to LLM calls.
Non-Goals
Tasks
tools/llm_provider.pyto setLANGCHAIN_API_KEYwhenLANGSMITH_API_KEYis present and ensureLANGCHAIN_TRACING_V2is enabled.scripts/langchain/pr_verifier.pyto standardize metadata tagging for LLM calls (includerepo,run id,issue/pr number,operationat minimum).scripts/langchain/followup_issue_generator.pyto standardize metadata tagging for LLM calls (includerepo,run id,issue/pr number,operationat minimum).LANGSMITH_API_KEYis set/unset.Acceptance Criteria
LANGSMITH_API_KEYset,LANGCHAIN_TRACING_V2andLANGCHAIN_API_KEYare configured (covered by a unit test).repo,run id,issue/pr number,operation).LANGSMITH_API_KEY, tracing remains off and code paths still run.Implementation Notes
Primary files:
tools/llm_provider.pyscripts/langchain/pr_verifier.pyscripts/langchain/followup_issue_generator.pySynced by workflow run.