Skip to content

feat(agentic): Langflow Assistant improvements — flow building, model portability, and robustness - #14007

Open
Cristhianzl wants to merge 20 commits into
release-1.12.0from
cz/assistant-improvements
Open

feat(agentic): Langflow Assistant improvements — flow building, model portability, and robustness#14007
Cristhianzl wants to merge 20 commits into
release-1.12.0from
cz/assistant-improvements

Conversation

@Cristhianzl

@Cristhianzl Cristhianzl commented Jul 10, 2026

Copy link
Copy Markdown
Member

Summary

A broad reliability + capability pass on the Langflow Assistant: it now builds
loop and conditional flows correctly, works across every configured model provider
(fixing silent failures on WatsonX, Ollama, and reasoning models like gpt-5.6),
surfaces recovered errors instead of hiding them, and gives the user session-level
control over memory and step budget. Targets release-1.11.0.

Summary by CodeRabbit

  • New Features

    • Added starter-template discovery and application in Assistant workflows.
    • Added loop and branching support with improved flow validation.
    • Added headless Assistant execution and consolidated HTTP MCP access.
    • Added live progress updates for canvas-building actions.
    • Added restore points with the ability to revert Assistant-applied edits.
    • Added /history controls for limiting conversation context.
    • Added structured error details and model fallback/remediation notices.
    • Increased Assistant iteration capacity for complex builds.
  • Bug Fixes

    • Improved model portability, streaming reliability, tracing resilience, and canvas edge preservation.
    • Prevented malformed flow updates from modifying the canvas.
    • Expanded localized messaging across supported languages.
  • Documentation

    • Updated Assistant and MCP feature documentation with current API behavior and workflow guidance.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 01527e6a-6af7-468f-9fef-e988aeeb373b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

The change expands the agentic assistant with headless execution, HTTP MCP access, loop-aware flow building and validation, bounded history, progress events, restore/revert behavior, structured errors, template tools, atomic canvas updates, and frontend localization with extensive regression coverage.

Changes

Agentic assistant and MCP

Layer / File(s) Summary
Assistant execution and API contracts
src/backend/base/langflow/agentic/api/*, src/backend/base/langflow/agentic/services/*
Adds the headless SSE route, history limits, restore-point metadata, structured errors, bounded history injection, and live provider entries.
MCP transport and tools
src/backend/base/langflow/api/v1/agentic_mcp.py, src/backend/base/langflow/agentic/mcp/*, src/lfx/src/lfx/mcp/*
Adds authenticated HTTP MCP delegation, assistant execution through the headless route, progress forwarding, and starter-template tools.
Loop-aware flow construction
src/lfx/src/lfx/graph/flow_builder/*, src/lfx/src/lfx/mcp/registry.py
Adds loop feedback handles, loop input discovery, dropdown-output synchronization, conversion hints, and tool-start instrumentation.
Frontend assistant state and controls
src/frontend/src/components/core/assistantPanel/*, src/frontend/src/controllers/API/queries/agentic/*, src/frontend/src/stores/flowStore.ts
Adds tool-progress rows, structured error details, restore/revert actions, history commands, atomic node-edge updates, and related SSE types.
Validation and regression coverage
src/backend/tests/*, src/lfx/tests/*, src/frontend/src/**/__tests__/*
Adds coverage for loop validation, MCP routes, templates, progress events, restore points, error details, history bounds, canvas updates, and frontend lifecycle behavior.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested reviewers: ogabrielluiz, adam-aghili, jkavia

🚥 Pre-merge checks | ✅ 8 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 19.52% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (8 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Test Coverage For New Implementations ✅ Passed The PR adds convention-named tests across backend, frontend, and LFX, and sampled files contain real assertions for loops, restore points, tool_start, and error details.
Test Quality And Coverage ✅ Passed Broad behavior-focused coverage exists for loops, history, restore, tool_start, API success/error paths, and frontend revert/error states, using proper pytest/RTL async patterns.
Test File Naming And Structure ✅ Passed PASS: Changed test files match repo conventions (test_*.py backend, *.test.ts/tsx frontend) and representative suites use descriptive pytest/Jest cases with setup/teardown.
Excessive Mock Usage Warning ✅ Passed Mocks are mostly confined to boundary tests (streaming, preload, hook plumbing); core loop/validation tests use real fixtures and show 0 mock hits, so usage isn’t excessive.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main assistant improvements around flow building, model portability, and robustness.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cz/assistant-improvements

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the enhancement New feature or request label Jul 10, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ Test Coverage Advisor

No source changes detected without accompanying tests. Thanks for keeping coverage up! 🎉

Advisory check only — never blocks merge.

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.47768% with 314 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.53%. Comparing base (597d05f) to head (db6e893).
⚠️ Report is 36 commits behind head on release-1.12.0.

Files with missing lines Patch % Lines
...e/assistantPanel/hooks/use-assistant-chat.types.ts 0.00% 58 Missing ⚠️
...ntend/src/controllers/API/queries/agentic/types.ts 0.00% 40 Missing ⚠️
...nents/core/assistantPanel/assistant-panel.types.ts 0.00% 39 Missing ⚠️
src/lfx/src/lfx/mcp/server.py 10.71% 25 Missing ⚠️
...components/core/assistantPanel/assistant-panel.tsx 35.13% 24 Missing ⚠️
...nents/core/assistantPanel/hooks/history-storage.ts 81.31% 17 Missing ⚠️
src/frontend/src/types/zustand/flow/index.ts 0.00% 9 Missing ⚠️
src/lfx/src/lfx/graph/flow_builder/connect.py 88.15% 5 Missing and 4 partials ⚠️
...rc/lfx/src/lfx/mcp/flow_builder_tools/run_tools.py 30.76% 7 Missing and 2 partials ⚠️
...ssistantPanel/components/assistant-build-tasks.tsx 89.33% 8 Missing ⚠️
... and 23 more
Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##           release-1.12.0   #14007      +/-   ##
==================================================
+ Coverage           61.47%   61.53%   +0.05%     
==================================================
  Files                2339     2353      +14     
  Lines              237145   238537    +1392     
  Branches            35410    33490    -1920     
==================================================
+ Hits               145787   146779     +992     
- Misses              89561    89995     +434     
+ Partials             1797     1763      -34     
Flag Coverage Δ
backend 69.34% <92.77%> (+0.39%) ⬆️
frontend 59.75% <79.48%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/backend/base/langflow/agentic/api/schemas.py 100.00% <100.00%> (ø)
...e/langflow/agentic/flows/flow_builder_assistant.py 100.00% <ø> (ø)
...end/base/langflow/agentic/helpers/code_security.py 91.11% <100.00%> (-0.82%) ⬇️
...ase/langflow/agentic/helpers/input_sanitization.py 100.00% <100.00%> (ø)
src/backend/base/langflow/agentic/mcp/server.py 64.44% <100.00%> (+8.88%) ⬆️
...e/langflow/agentic/services/conversation_buffer.py 96.72% <100.00%> (-3.28%) ⬇️
...nd/base/langflow/agentic/services/flow_executor.py 94.53% <100.00%> (-0.60%) ⬇️
...angflow/agentic/services/helpers/event_consumer.py 94.44% <100.00%> (-5.56%) ⬇️
...e/langflow/agentic/services/helpers/flow_loader.py 90.67% <100.00%> (-1.70%) ⬇️
.../agentic/services/helpers/intent_classification.py 91.13% <100.00%> (-3.74%) ⬇️
... and 53 more

... and 182 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 47%
47.14% (67831/143864) 70.42% (9650/13703) 45.77% (1571/3432)

Unit Test Results

Tests Skipped Failures Errors Time
5448 0 💤 0 ❌ 0 🔥 19m 17s ⏱️

@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 10, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 10, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 10, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 10, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the enhancement New feature or request label Jul 13, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 16, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 16, 2026
@Cristhianzl
Cristhianzl changed the base branch from release-1.11.0 to release-1.12.0 July 23, 2026 12:58
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 23, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 23, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Migration Validation Passed

All migrations follow the Expand-Contract pattern correctly.

@github-actions

This comment has been minimized.

@erichare
erichare self-requested a review July 23, 2026 20:02
): SerializedAssistantMessage[] {
return messages.map((msg) => {
const { timestamp, progress, result, ...rest } = msg;
const { timestamp, progress, result, inProgressTask, ...rest } = msg;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We pull inProgressTask out here because it is transient, but flowProposalSnapshot still rides along in ...rest, so it gets persisted. That field is a full cloneDeep of nodes+edges (set in handleApplyFlowProposal), so every applied proposal writes an entire canvas copy into the session localStorage. On a big flow, or after a few proposals in one session, that can balloon and eventually blow past the ~5MB quota — at which point the whole setItem throws and we lose the session save, not just the snapshot.

If keeping revert working across a reload is intentional, can we bound it? e.g. only keep the snapshot while flowProposalStatus === "applied", or keep just the latest one. If it is only meant to power the in-session undo, I think we can drop it in the destructure the same way we do inProgressTask.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch — you are right. The snapshot rides along in ...rest, and since it is a full cloneDeep of the canvas it can get heavy fast on big flows. And it is worse than just the snapshot: saveSessionsToStorage swallows the quota error, so once setItem starts throwing we silently lose the whole session save.

Cross-reload revert was never the intent here — that is what the restore-point path covers (restoreVersionId + flow versions), and that one survives reloads fine because it lives on the backend. The snapshot only exists to power the in-session undo on the proposal card. So I will go with your second option and drop it in the destructure, same as inProgressTask. After restoring a session the card just renders with canRevert=false and handleRevertFlowProposal already no-ops without a snapshot, so nothing else needs to change.

Will push the fix with a serialization test. Thanks!

@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 24, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 24, 2026
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Build successful! ✅
Deploying docs draft.
Deploy successful! View draft

@keval718 keval718 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

FE looks good to me

@github-actions github-actions Bot added the lgtm This PR has been approved by a maintainer label Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants