Skip to content

[LangSmith] Fix env wiring + standardize trace metadata for Workflows LLM calls #1215

Description

@github-actions

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

  • Update tools/llm_provider.py to set LANGCHAIN_API_KEY when LANGSMITH_API_KEY is present and ensure LANGCHAIN_TRACING_V2 is enabled.
  • Update scripts/langchain/pr_verifier.py to standardize metadata tagging for LLM calls (include repo, run id, issue/pr number, operation at minimum).
  • Update scripts/langchain/followup_issue_generator.py to standardize metadata tagging for LLM calls (include repo, run id, issue/pr number, operation at minimum).
  • Add a unit test to verify env wiring behavior when LANGSMITH_API_KEY is set/unset.

Acceptance Criteria

  • With LANGSMITH_API_KEY set, LANGCHAIN_TRACING_V2 and LANGCHAIN_API_KEY are configured (covered by a unit test).
  • At least two key operations emit traces with standardized metadata fields (inspectable in code, e.g., explicit metadata/tags include repo, run id, issue/pr number, operation).
  • With no LANGSMITH_API_KEY, tracing remains off and code paths still run.

Implementation Notes

Primary files:

  • tools/llm_provider.py
  • scripts/langchain/pr_verifier.py
  • scripts/langchain/followup_issue_generator.py

Synced by workflow run.

Activity

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

Metadata

Metadata

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions