Skip to content

chore(langchain): strip_ansi fucntion to remove ANSI escape sequences#32200

Merged
Eugene Yurtsev (eyurtsev) merged 2 commits intolangchain-ai:masterfrom
pc099:32150_terminal_char_fail
Jul 25, 2025
Merged

chore(langchain): strip_ansi fucntion to remove ANSI escape sequences#32200
Eugene Yurtsev (eyurtsev) merged 2 commits intolangchain-ai:masterfrom
pc099:32150_terminal_char_fail

Conversation

@pc099
Copy link
Copy Markdown
Contributor

Description:
Fixes a bug in the file callback test where ANSI escape codes were causing test failures. The improved test now properly handles ANSI escape sequences by:

  • Using exact string comparison instead of substring checking
  • Applying the strip_ansi function consistently to all file contents
  • Adding descriptive assertion messages
  • Maintaining test coverage and backward compatibility

The changes ensure tests pass reliably even when terminal control sequences are present in the output

Issue: Fixes #32150

Dependencies: None required - uses existing dependencies only.

@vercel
Copy link
Copy Markdown

vercel bot commented Jul 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Jul 25, 2025 3:51pm

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Jul 23, 2025

CodSpeed WallTime Performance Report

Merging #32200 will improve performances by 16.29%

Comparing pc099:32150_terminal_char_fail (0e01d72) with master (0d6f915)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

⚡ 4 improvements
✅ 9 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
test_import_time[CallbackManager] 482.2 ms 414.7 ms +16.29%
test_import_time[LangChainTracer] 461.5 ms 411.7 ms +12.08%
test_import_time[RunnableLambda] 261.6 ms 232.6 ms +12.44%
test_import_time[Runnable] 255.5 ms 230.2 ms +10.99%

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Jul 23, 2025

CodSpeed Instrumentation Performance Report

Merging #32200 will not alter performance

Comparing pc099:32150_terminal_char_fail (0e01d72) with master (0d6f915)

Summary

✅ 14 untouched benchmarks

@mdrxy Mason Daugherty (mdrxy) changed the title Adding strip_ansi fucntion to Remove ANSI escape sequences feat: strip_ansi fucntion to remove ANSI escape sequences Jul 24, 2025
Copy link
Copy Markdown
Collaborator

@eyurtsev Eugene Yurtsev (eyurtsev) left a comment

Choose a reason for hiding this comment

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

Sorry ignore me -- read over the original issue

@eyurtsev Eugene Yurtsev (eyurtsev) changed the title feat: strip_ansi fucntion to remove ANSI escape sequences chore(langchain): strip_ansi fucntion to remove ANSI escape sequences Jul 25, 2025
@eyurtsev Eugene Yurtsev (eyurtsev) enabled auto-merge (squash) July 25, 2025 15:51
@eyurtsev Eugene Yurtsev (eyurtsev) merged commit 8f5ec20 into langchain-ai:master Jul 25, 2025
42 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.

test_filecallback can fail due to terminal characters in output

2 participants