Skip to content

fix: blank LangSmith input should disable tracing#54

Merged
Brace Sproul (bracesproul) merged 2 commits into
langchain-ai:mainfrom
blue-az:fix-blank-tracing
Jul 5, 2026
Merged

fix: blank LangSmith input should disable tracing#54
Brace Sproul (bracesproul) merged 2 commits into
langchain-ai:mainfrom
blue-az:fix-blank-tracing

Conversation

@blue-az

@blue-az blue-az commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Problem

During --init setup, entering a LangSmith key writes LANGCHAIN_TRACING_V2=true to ~/.openwiki/.env. But if the user later re-runs setup and leaves the LangSmith prompt blank (intending to opt out), the old true flag survives: saveOpenWikiEnv merges updates and nothing ever clears it. Tracing silently stays enabled with whatever stale key/config remains — the user believes they've opted out.

Fix

Blank LangSmith input now acts as an explicit off switch: LANGCHAIN_TRACING_V2 is written as false. One conditional branch in src/credentials.tsx, 5 lines.

Verification

  • pnpm run build, pnpm run lint:check, pnpm run format:check all pass.
  • Repro before fix: run setup with a LangSmith key, re-run setup leaving the prompt blank → ~/.openwiki/.env still contains LANGCHAIN_TRACING_V2=true. After fix: it's false.

Surfaced during an automated documentation audit of the repo (same review pass that produced #50/#49, but this is an independent fix — kept as its own PR so each change reviews on its own merits).

🤖 Generated with Claude Code

A LANGCHAIN_TRACING_V2=true saved by an earlier setup survived in
~/.openwiki/.env when the user later left the LangSmith prompt blank,
because saveOpenWikiEnv merges updates and never clears the flag.
Blank input now explicitly writes LANGCHAIN_TRACING_V2=false.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is a small, targeted bug fix that matches the documented behavior.

Why approve:

✅ Fixes a real state persistence bug: clearing the LangSmith API key now explicitly disables tracing instead of leaving LANGCHAIN_TRACING_V2=true behind.
✅ Minimal, low-risk change.
✅ Comment clearly explains the previous behavior and why the fix is needed.
✅ No obvious regressions from the diff shown.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice, thank you!

@bracesproul
Brace Sproul (bracesproul) enabled auto-merge (squash) July 5, 2026 22:09
@bracesproul
Brace Sproul (bracesproul) merged commit ebc4712 into langchain-ai:main Jul 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants