fix: update langfuse>=3.8.0 and fix cuga_agent.py by haroldship · Pull Request #11519 · langflow-ai/langflow (original) (raw)

Updated all langchain-* integration packages to versions compatible with langchain-core 1.0+.

LangChain 1.0 removed AgentExecutor and related classes to langchain-classic. This adds the dependency to maintain backward compatibility.

LangChain 1.0 no longer includes sqlalchemy as a transitive dependency. Move the import inside the function where it's used to avoid import errors when sqlalchemy is not installed.

nv-ingest 26.1.1 removes the openai dependency, resolving the conflict with langchain-openai>=1.0.0 (which requires openai>=1.109.1).

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

opencv-python 4.13+ now supports numpy>=2, resolving the conflict with langchain-aws>=1.0.0 (which requires numpy>=2.2 on Python 3.12+).

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

Also simplified GoogleGenerativeAIEmbeddingsComponent to use native langchain-google-genai 4.x which now supports output_dimensionality.


Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

Conflicts:

src/backend/base/langflow/initial_setup/starter_projects/Basic Prompt Chaining.json

src/backend/base/langflow/initial_setup/starter_projects/Basic Prompting.json

src/backend/base/langflow/initial_setup/starter_projects/Blog Writer.json

src/backend/base/langflow/initial_setup/starter_projects/Custom Component Generator.json

src/backend/base/langflow/initial_setup/starter_projects/Document Q&A.json

src/backend/base/langflow/initial_setup/starter_projects/Financial Report Parser.json

src/backend/base/langflow/initial_setup/starter_projects/Hybrid Search RAG.json

src/backend/base/langflow/initial_setup/starter_projects/Image Sentiment Analysis.json

src/backend/base/langflow/initial_setup/starter_projects/Instagram Copywriter.json

src/backend/base/langflow/initial_setup/starter_projects/Invoice Summarizer.json

src/backend/base/langflow/initial_setup/starter_projects/Knowledge Retrieval.json

src/backend/base/langflow/initial_setup/starter_projects/Market Research.json

src/backend/base/langflow/initial_setup/starter_projects/Meeting Summary.json

src/backend/base/langflow/initial_setup/starter_projects/Memory Chatbot.json

src/backend/base/langflow/initial_setup/starter_projects/News Aggregator.json

src/backend/base/langflow/initial_setup/starter_projects/Nvidia Remix.json

src/backend/base/langflow/initial_setup/starter_projects/Pokédex Agent.json

src/backend/base/langflow/initial_setup/starter_projects/Portfolio Website Code Generator.json

src/backend/base/langflow/initial_setup/starter_projects/Price Deal Finder.json

src/backend/base/langflow/initial_setup/starter_projects/Research Agent.json

src/backend/base/langflow/initial_setup/starter_projects/Research Translation Loop.json

src/backend/base/langflow/initial_setup/starter_projects/SEO Keyword Generator.json

src/backend/base/langflow/initial_setup/starter_projects/SaaS Pricing.json

src/backend/base/langflow/initial_setup/starter_projects/Search agent.json

src/backend/base/langflow/initial_setup/starter_projects/Sequential Tasks Agents.json

src/backend/base/langflow/initial_setup/starter_projects/Simple Agent.json

src/backend/base/langflow/initial_setup/starter_projects/Social Media Agent.json

src/backend/base/langflow/initial_setup/starter_projects/Text Sentiment Analysis.json

src/backend/base/langflow/initial_setup/starter_projects/Travel Planning Agents.json

src/backend/base/langflow/initial_setup/starter_projects/Twitter Thread Generator.json

src/backend/base/langflow/initial_setup/starter_projects/Vector Store RAG.json

src/backend/base/langflow/initial_setup/starter_projects/Youtube Analysis.json

Optimize LangFuseTracer.end

The optimized code achieves a 140% speedup (8.23ms → 3.42ms) through two complementary optimizations:

1. Fast-path for Common Primitives in serialize()

What changed: Added an early-exit check that returns immutable primitives (str, int, float, bool) directly when no truncation or special handling is needed:

if max_length is None and max_items is None and not to_str:
    if isinstance(obj, (str, int, float, bool)):
        return obj

Why it's faster:

When it helps: This optimization is particularly effective for workloads with many primitive values in dictionaries and lists—which is exactly what the tracing use case provides (metadata dicts with strings, numbers, booleans).

2. Eliminate Redundant Serialization in LangFuseTracer.end()

What changed: Serialize inputs, outputs, and metadata once each, then reuse the results:

inputs_ser = serialize(inputs)
outputs_ser = serialize(outputs)
metadata_ser = serialize(metadata) if metadata else None

Why it's faster:

Impact on workloads: The test_end_multiple_iterations_calls_end_each_time test (500 iterations) demonstrates this matters in hot paths. If LangFuseTracer.end() is called frequently during flow execution, avoiding duplicate serialization provides compounding benefits.

Combined Effect

Both optimizations target the serialization bottleneck from different angles:

Together, they deliver the observed 140% speedup, with the optimization being especially effective for the common case of metadata dictionaries containing mostly primitive types.

Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>

z3-solver 4.15.7 dropped manylinux wheels, causing the Docker build to fail when trying to compile from source. Temporary pin until codeflash is removed.

before it was attempting to pull release-notes as letters are alphanumerically after numbers when we sort -V then grab tail now we only look at branch names that follow the pattern '^release-[0-9]+.[0-9]+.[0-9]+$'

add-back-svg

Old flows using removed langchain imports (e.g. langchain.memory, langchain.schema, langchain.chains) now resolve via langchain_classic at two levels: module-level for entirely removed modules, and attribute-level for removed attributes in modules that still exist in langchain 1.0. New langchain 1.0 imports are never affected since fallbacks only trigger on import failure.


Co-authored-by: Claude Opus 4.5 noreply@anthropic.com Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Harold Ship harold.ship@gmail.com Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com> Co-authored-by: Adam-Aghili 149833988+Adam-Aghili@users.noreply.github.com Co-authored-by: Mendon Kissling 59585235+mendonk@users.noreply.github.com Co-authored-by: Eric Hare ericrhare@gmail.com