* fix: route IBM WatsonX selections to model_id endpoint in unified get_llm
A model selection sourced from the GET /api/v1/models catalog (which the
frontend uses to augment the Language Model / Agent dropdown right after a
provider is configured) carries only raw create_model_metadata fields — none
of the enriched *_param keys that get_language_model_options injects. get_llm
already derived model_class from the provider mapping for this case but still
let model_name_param / api_key_param / url_param / project_id_param fall back to
the generic defaults.
For IBM WatsonX this is load-bearing: langchain_ibm.ChatWatsonx exposes both a
`model` field (routes to the OpenAI-style Model Gateway, a different catalog)
and a `model_id` field (routes to ModelInference, the foundation-models
endpoint the dropdown is populated from). Falling back to the generic `model`
sent the selected foundation-model id to the gateway, failing with
"model <id> not found" / IAM "Provided user not found or active" — even though
the dropdown, connection test, and standalone IBM watsonx.ai component all work.
Derive all param names from get_provider_param_mapping(provider) when the
selection metadata lacks them. Only WatsonX (model_id/apikey) differs from the
generic defaults, so OpenAI/Anthropic/etc. are unaffected.
Fixes#13671
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* fix(load): bound remote flow fetches
* test(load): cover get_flow timeout path and cap error body size
Builds on the bounded-timeout fix for #13653:
- add a direct test for the httpx.TimeoutException -> UploadError mapping
(the core hang scenario; previously only the timeout *config* and HTTP
error path were covered)
- truncate large upstream error bodies (GET_FLOW_ERROR_BODY_LIMIT) so an
HTML 500 page can't bloat the UploadError message/logs
- assert against GET_FLOW_TIMEOUT instead of a magic 30.0
---------
Co-authored-by: Lucas Ma <7184042+pony-maggie@users.noreply.github.com>
Co-authored-by: Eric Hare <ericrhare@gmail.com>
* fix(security): gate public user self-registration (CWE-862)
POST /api/v1/users/ declared no authentication dependency, so any anonymous
caller could create accounts on any instance (unrestricted account creation;
immediately usable when NEW_USER_IS_ACTIVE=true). Privilege escalation is not
possible (UserCreate excludes is_superuser), but open registration is.
Add an ENABLE_SIGNUP auth setting (default True) and refuse registration when
AUTO_LOGIN is enabled (single-user mode has no signup concept) or ENABLE_SIGNUP
is False. Multi-user instances keep working sign up; operators can disable it
explicitly.
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* Update test_users.py
* Update .secrets.baseline
* fix(security): allow authenticated superusers to create users when public signup is disabled
The public signup gate on POST /api/v1/users/ ran before any identity check, so it rejected authenticated superusers exactly like anonymous callers. Because the condition also includes AUTO_LOGIN, it fired on the default local config too, breaking the admin "add user" UI (AdminPage -> useAddUser -> POST /api/v1/users/) on both multi-user (ENABLE_SIGNUP=False) and default (AUTO_LOGIN) deployments.
Resolve the optional current user via get_current_user_optional and skip the gate for an authenticated active superuser, so disabling public signup only blocks the anonymous path. get_current_user_optional short-circuits to None for credential-less requests, so the anonymous path can never be promoted to a superuser (even under skip_auth_auto_login), while still honoring the access_token_lf cookie the browser admin UI relies on.
Add tests pinning superuser-success and non-superuser/anonymous-refusal when signup is disabled, and fold the ENABLE_SIGNUP docstring into the Field description to match ENABLE_SUPERUSER_CLI.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
The scanner-flagged uuid 10.0.0 was already resolved on this branch by the
direct bump to uuid ^14. The only remaining old uuid was a dev-only transitive
uuid 8.3.2 pulled by jest-junit (deprecated "uuid@10 and below"). Add a scoped
npm override forcing jest-junit's uuid to ^11 (the CJS-compatible version
upstream recommends), clearing the deprecated transitive from the lockfile.
Dev-dependency / test-reporter only; no runtime impact.
* fix(security): block code-bearing nodes with empty type in flow validation (GHSA-mfp9-86w4-493f)
_get_invalid_components() did "if not component_type: continue", so a flow node
with an empty/missing data.type but a populated template.code.value was skipped
by the custom-component gate - yet instantiate_class still executed the node's
stored code at build time (it keys off the code, not the type). An authenticated
user could therefore bypass allow_custom_components=false and run arbitrary
Python.
Now a node carrying code with an unresolvable/empty type is classified as
blocked (it can never match a trusted code hash) instead of being skipped.
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
`PreToolValidationWrapper.convert_langchain_tools_to_sparc_tool_specs_format`
degrades to a minimal tool spec when a tool can't be introspected, but its
`except` tuple omitted `RuntimeError`. On Python 3.14 + langchain-core 1.4.7,
reading `tool.args` for a tool whose `args_schema` is not a usable model (e.g. a
`@property` that shadows the inherited Pydantic field) returns the raw property
object, so langchain's `get_all_basemodel_annotations` recurses on
`get_origin(<property>) -> None -> None -> ...` and raises `RecursionError` (a
`RuntimeError` subclass) -- which escaped the handler and crashed conversion
(surfaced by test_altk_agent_tool_conversion.py::test_error_handling).
Add `RuntimeError` to the caught tuple, matching the two sibling handlers in the
same module that already catch it. This restores the intended fall-back to a
minimal spec and hardens real agent runs against the same recursion.
FastAPI 0.137 made `include_router` lazy: included sub-routers are stored as
`_IncludedRouter` wrappers (no `.path`) in `app.routes` instead of being
flattened. `opentelemetry-instrumentation-fastapi` names spans by walking
`app.routes` and reading `route.path`; its `Match.FULL` branch already guards a
missing `.path`, but the `Match.PARTIAL` branch does not. A partial match -- e.g.
an OPTIONS/CORS preflight against a GET-only route -- raised
`AttributeError: '_IncludedRouter' object has no attribute 'path'` mid-request and
turned into a 500 (surfaced by test_security_cors.py::TestCORSIntegration).
`instrument_app` hard-codes the span-detail callback and exposes no override hook,
so patch the module-level `_get_route_details` (resolved as a global on every call)
with a guarded copy that falls back to the include prefix, then the request path,
when the matched route has no `.path`. Applied in `create_app` before
`FastAPIInstrumentor.instrument_app`; idempotent and a no-op on FastAPI <=0.136.
Follow-on to #13710 (same lazy-include root cause, different consumer).
The recent uv update bumped FastAPI 0.136.3 -> 0.137.1 (Starlette 1.2.1 ->
1.3.1), which changed `include_router` to lazy inclusion: an included sub-router
is now stored as an internal `_IncludedRouter` wrapper instead of eagerly
flattening its `APIRoute` objects onto the parent. Anything that introspects
`app.router.routes` no longer sees nested routes.
Production impact: `_get_route_keys` (plugin conflict-protection) iterates
`app.router.routes` to build the reserved set before loading plugins. With the
core routers now behind `_IncludedRouter` wrappers, the reserved set was empty,
so a plugin could silently shadow core Langflow routes. Fix by descending
through the wrapper via its public `original_router` / `include_context`
(accumulating the include-time prefix), so discovery works on both eager
(<=0.136) and lazy (>=0.137) inclusion.
The same assumption broke route-introspection tests, now made version-agnostic:
- test_deployments_routes.py: read routes from the router via a flattener
- test_extensions_route_guard.py: `collect_paths` descends through the wrapper
These failures surfaced on release-1.10.1 and are unrelated to any PR content.
* fix: accept Data and Message inputs in LoopComponent
LoopComponent.input_types only listed DataFrame and Table, rejecting
connections from Data- and Message-producing components at build time.
The class description and _convert_message_to_data method already
intended to support these types.
- Add Data and Message to input_types on the data HandleInput
- Add types=["Data"] to Item output, types=["DataFrame", "Table"] to Done output
- Convert Message to Data in _validate_data before calling validate_data_input
Fixes#13636
* fix: normalize mixed Message/DataFrame lists in Loop._validate_data
Addresses the CodeRabbit review on #13646. The list branch converted
Message items to Data but left DataFrame items untouched, so a mixed
[Message, DataFrame] input became [Data, DataFrame] — which
validate_data_input rejects because DataFrame is not a Data subclass.
Normalize each list item: convert Message via _convert_message_to_data and
expand DataFrame/Table to its rows via to_data_list(), so any accepted input
shape (including a mixed list) yields a homogeneous list[Data].
Add lfx regression tests covering the input/output type metadata, the
connect-time type-compatibility check, and _validate_data across single
Message/Data/DataFrame, list[Message], the mixed-list case, and rejection
of lists with non-coercible items.
* chore: regenerate Loop component index, starter project, and locale
Rebuild the component index, the "Research Translation Loop" starter
project, and the en.json locale string for the Loop input_types / output
types / info changes on release-1.10.1.
* chore: trigger CI re-run
---------
Co-authored-by: dymux <putramkti@users.noreply.github.com>
Co-authored-by: Eric Hare <ericrhare@gmail.com>
A model invoked as the root LangChain run (no wrapping chain) — reproduced
with Ollama — was emitted by the langfuse v3 CallbackHandler as a separate
orphan trace: parent=None, userId=None, sessionId=None, with the token usage
detached from the flow trace, breaking cost/usage attribution.
Root cause: the SDK only applies the constructor `trace_context` on the chain
path (`on_chain_start`); the generation path calls `start_observation` without
it, so with no active OpenTelemetry span the generation starts a brand-new
trace (metadata `is_langchain_root: true`).
`get_langchain_callback` now returns a `CallbackHandler` subclass that, for
root LLM runs only (`parent_run_id is None`), activates the flow's component
(or root) span as the current OTel span while the SDK creates the generation.
The generation then inherits the flow `trace_id` and nests under the component
span, restoring user/session attribution and token metrics. Non-root runs
(wrapping chain/agent present) are left untouched.
Adds focused unit tests plus an end-to-end test that drives the real langfuse
SDK with an in-memory OpenTelemetry exporter and asserts the generation shares
the flow trace_id and parents under the component span.
The dep upgrade in 9266b08e5e bumped uuid to ^14.0.0, which ships ES
modules only ("type": "module"; its sole node export, dist-node/index.js,
is ESM). Jest's CommonJS runtime cannot parse it, so the only suite that
imports uuid (useGetFlowId.test.ts) failed to run with "SyntaxError:
Unexpected token 'export'", failing the Frontend Jest Unit Tests job.
Add a moduleNameMapper entry routing uuid to a project mock, mirroring how
the repo already handles other ESM-only packages (vanilla-jsoneditor,
@jsonquerylang/jsonquery). The mock is RFC 4122-correct (crypto.randomUUID
for v4, deterministic SHA-1 v5 / MD5 v3 with namespace constants), so output
is byte-identical to the real package.
* fix: run trusted server copy on custom-component hash-gate match (#13496)
When allow_custom_components=False (or admin-only mode), the /custom_component
and /custom_component/update endpoints gated arbitrary code execution solely on
a 48-bit truncated SHA-256 (sha256(code)[:12]) match against public built-in
component hashes. A second-preimage collision (feasible in minutes on commodity
hardware) let an authenticated user clear the gate with attacker-controlled
bytes that were then exec'd — an RCE in the very multi-tenant hardening mode the
flag is meant to provide.
Fix: once the hash gate passes in restricted mode, execute the server's trusted
copy keyed by that hash instead of the client-submitted bytes, failing closed if
no trusted source is found. A collision now merely re-runs the server's own
known-good component. The 12-char hash is intentionally left intact as the
component-index key (widening it would force a full index regeneration); the
security decision simply no longer trusts client bytes.
- collect_code_by_hash() / get_trusted_code_for_validation() in
lfx.utils.flow_validation (the collector drops any source whose recomputed
hash != its key, so a poisoned index entry can't smuggle in code)
- ComponentCache.code_by_hash, populated with the existing hash lookups and
invalidated on bundle reload
- substitution in both custom_component handlers, gated by
_requires_component_hash_lookups
Verified on the real 355-component index that all_known_hashes == code_by_hash
keys, so legitimate known-template refreshes never hit the fail-closed path.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: return trusted copy in custom-component update response (#13496)
In restricted mode the /custom_component/update endpoint executed the
server's trusted copy (effective_code) but rebuilt its response template
from the raw client bytes. Because the saved node's code field is what
instantiate_class exec's at flow-build time, a colliding payload echoed
back into a saved flow could be re-executed on the build path, bypassing
the substitution. Write effective_code into the returned template instead
(no-op in default mode, where effective_code == code_request.code).
Add tests: update-endpoint collision case (asserts trusted code is
returned and the attacker sentinel never fires) and a fail-closed 403
case (gate passes but no trusted copy exists).
* fix(frontend): align jest jsdom environment with jest-runtime 30.4.x
The lockfile had jest-runtime and the @jest core packages at 30.4.2 while
the jsdom environment cluster (jest-environment-jsdom, @jest/environment,
@jest/fake-timers, @jest/environment-jsdom-abstract, jest-mock) stayed
pinned at 30.3.0. jest-runtime 30.4.x calls
moduleMocker.clearMocksOnScope() during resetModules, and that method
only exists in jest-mock 30.4.x. Because the jsdom environment built its
ModuleMocker from the stale jest-mock 30.3.0, every Jest suite crashed at
load with "this._moduleMocker.clearMocksOnScope is not a function"
(384 suites failed, 0 tests run).
Bump the jsdom-environment jest cluster to 30.4.1 so the environment's
ModuleMocker matches jest-runtime. No package.json range changes; the
only non-jest delta is a transitive nwsapi patch bump pulled in by jsdom.
https://claude.ai/code/session_01J8U3i2WH2863cDuwVu9awa
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: guard event serialization against unserializable component payloads (#12591)
Loop flows containing a vector store (e.g. Chroma) failed to build with:
Error building Component Loop:
[TypeError("'_thread.lock' object is not iterable"),
TypeError('vars() argument must have __dict__ attribute')]
The Loop runs its body in an isolated subgraph and streams an on_end_vertex
event for every completed inner vertex. EventManager.send_event serialized
that payload with a raw fastapi.jsonable_encoder call. When a payload carries
an object jsonable_encoder cannot serialize -- most notably a threading.Lock
held by a vector-DB client -- its last-resort fallback raises
ValueError([TypeError, TypeError]), which propagated out of the subgraph and
aborted the whole flow build.
The earlier fix (#12877) only guarded ResultData.validate_model and
build_output_logs (both already routed through the fail-safe serialize()), so
this jsonable_encoder path was never covered and the issue persisted.
send_event now falls back to lfx's fail-safe serialize() when jsonable_encoder
raises, degrading unknown objects to a string representation instead of
crashing. The happy path is unchanged (the fallback only runs on failure).
Adds a focused EventManager unit test and an end-to-end Loop regression test
whose body emits a lock-bearing Data (both fail without the fix).
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* fix(security): run trusted server code on unauthenticated public flow builds
The unauthenticated public build path (POST /api/v1/build_public_tmp/{flow_id}/flow)
builds a public flow as its owner and executes its components, running each node's
stored `code` via eval_custom_component_code. The custom-component hash gate
(validate_flow_for_current_settings) is a no-op under the default
allow_custom_components=true, so a public flow containing a plain CustomComponent —
or any node carrying arbitrary code — would execute on that path without
authentication (follow-up to H1-3754930).
Enforcing the hash gate on the public path is not viable: it rejects legitimate
flows whose built-in component code has merely drifted across versions ("outdated"),
which would break the public playground on every upgrade.
Instead, on the public path substitute the server's trusted code for each known
component type and reject nodes whose type is not a known server component:
- known type -> stored code replaced with the server's current code, so version
drift cannot break the build and a relabelled node cannot smuggle in its bytes;
- unknown/custom type carrying code -> rejected (400);
- codeless nodes (group/note) untouched; inlined sub-flows handled recursively.
The build then runs from this server-sanitized data. Operators who knowingly want
public flows to run custom component code can restore the prior DB-loaded build with
LANGFLOW_ALLOW_PUBLIC_CUSTOM_COMPONENTS=true (default false).
Authenticated builds are unaffected.
* Update src/lfx/src/lfx/utils/flow_validation.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* test(settings): add allow_public_custom_components to composition field list
The public-flow trusted-code fix added the allow_public_custom_components
setting to SecuritySettings, which bumped Settings.model_fields to 147 and
tripped test_field_count_unchanged (147 != 146). Add the field to the
curated EXPECTED_FIELDS set under a 1.10.1 section.
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
fix(database): resolve Alembic log to writable config dir, never crash on read-only FS
The default Alembic migration-log path ("alembic/alembic.log") resolved a
relative path against the installed package directory, then opened it for
writing with no error handling. On a read-only filesystem -- a standard
Kubernetes hardening posture (non-root pod / read-only root filesystem) and
the default for read-only container images -- this raised an unhandled
OSError ([Errno 30] Read-only file system) during startup, aborting the
FastAPI lifespan and putting the pod into CrashLoopBackOff.
Root cause: writing mutable runtime state into the package install location
(expected to be immutable). Every other writable Langflow artifact resolves
to config_dir/cache_dir; only the Alembic log resolved into site-packages.
Changes:
- Resolve relative alembic_log_file paths against the writable config_dir
(platformdirs user cache dir, always created on startup) instead of the
read-only package directory. Absolute paths and stdout mode are unchanged.
- Add _open_alembic_log_buffer(): create the parent dir, then fall back to
stdout (with a warning) if opening the diagnostic log raises OSError. This
is the actual crash point in _run_migrations, which runs before
initialize_alembic_log_file(), so guarding only the latter was insufficient.
- Make initialize_alembic_log_file() swallow OSError for the same reason.
The migration log is diagnostic-only and must never abort startup. Existing
deployments that set LANGFLOW_ALEMBIC_LOG_FILE or LANGFLOW_ALEMBIC_LOG_TO_STDOUT
are unaffected.
Fixes#11143
The Lint Frontend job runs against `main` as the base. In a release
(workflow_dispatch) run it diffs the entire release branch (~915 files) and
re-lints nearly the whole frontend, exposing two issues that per-PR linting
never hits together:
1. xargs split starter-project spec paths containing spaces (e.g.
"News Aggregator.spec.ts" -> "News" + "Aggregator.spec.ts"), producing
`internalError/io: No such file or directory`. NUL-delimit the file list
so spaces are preserved. (supersedes #13381)
2. The whole-branch diff surfaced 30 pre-existing Biome errors: 22
noExplicitAny + 8 organizeImports. Resolved with real types where safe
(freezeObject generic, ColDef defaults, messagesSorter field shape,
VertexBuildTypeAPI, Record<string,string>, DragEvent<HTMLElement>,
unknown for narrowed values) and justified biome-ignore for genuinely
loose cases (polymorphic display values, test global stubs, captured
unexported StreamCallbacks). Imports auto-sorted via biome.
Verified locally: biome check on the full release-vs-main file set is now 0
errors (was 30); tsc unchanged at its 303-error baseline (no new type errors).
* fix(components): follow HTTP redirects in URL component with per-hop SSRF revalidation
The URL component sent every request with follow_redirects=False, so any
site whose entered URL 301s to its canonical address (http->https or
www/non-www normalization) returned the redirect stub - e.g. a bare
"301 Moved Permanently / nginx" page - as the scraped content, or failed
outright when the redirect response had an empty body.
Redirects are now followed via a new advanced "Follow Redirects" input
(default on). When SSRF protection is enabled, hops are followed manually
and each Location target is re-validated with the same blocked-IP denylist
and DNS pinning as the initial request before any connection is made,
mirroring the API Request component; cross-host hops drop sensitive
headers and chains are capped at 20 redirects.
* fix(components): compare full origin when keeping credentials across redirects, crawl from post-redirect base
Addresses CodeRabbit review:
- _headers_for_redirect now keeps Authorization/Proxy-Authorization/Cookie
only for same-origin hops (scheme, host, port) or a direct http->https
upgrade on default ports, exactly the cases where httpx keeps the
Authorization header. Applied to both the URL and API Request
components (the helper was copied from the latter).
- _crawl_recursive resolves relative links and the prevent_outside check
against the final post-redirect URL, and marks it visited, so depth>1
crawls work on sites that 301 to their canonical address.
* chore: regenerate component index and starter projects for release-1.10.1 base
The autofix.ci jobs uploaded but never pushed the regeneration after the
rebase, leaving the 4 URL-component templates with a stale field_order
(missing follow_redirects) and the index without the new code hashes.
Generated with the same commands CI uses: LFX_DEV=1 make
build_component_index + scripts/ci/update_starter_projects.py.
Pokedex Agent / Structured Data Analysis Agent pick up the API Request
component's new code_hash from the origin-comparison fix.
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
fix(ci): resolve validate-version output in release-lfx changelog link
The create-release job references
needs.validate-version.outputs.current_version in its generated release
notes (the Full Changelog compare link), but validate-version was not in
the job's needs array, so the expression evaluated empty and the link
rendered as compare/v...lfx-vX.Y.Z (broken base).
Add validate-version to the create-release needs. This adds no real
serialization: create-release already waits on release-lfx, which
transitively requires validate-version via run-tests, and the job's
always() if-condition is unaffected.
Flagged by actionlint: property "validate-version" is not defined in
object type {build-docker, release-lfx}.
fix(ci): create GitHub releases on the dispatched v-prefixed tag
The create_release job passed the bare version (v stripped) as the
release tag with no commit target, so when that tag did not exist
GitHub minted a new lightweight tag at the default-branch HEAD -- the
wrong commit, still carrying the previous version (main only adopts a
release's version via the post-release back-merge). Every release since
1.8.2 shipped a stray bare tag (1.8.2, 1.8.3, 1.9.0-1.9.6, 1.10.0)
pointing at a previous-version commit, and the GitHub release had to be
manually re-pointed to the real vX.Y.Z tag after each release.
- create_release now attaches the release to inputs.release_tag for
stable releases; pre-releases keep their computed tag (e.g.
1.10.0rc1) but it is minted at the release commit via 'commit:'.
- release-lfx.yml pins the minted lfx-v* tag to github.sha instead of
the default branch.
The validate-tag-format guard (#12847) only blocks at dispatch time;
create_release was re-creating the very duplicates it guards against.
fix(ci): scope nightly migration-test pre-releases to the langflow stack
The previous fix (#13599) added a global --prerelease=allow, which let
UNRELATED dependencies resolve to alphas: on nightly run 27274206250
the stable->nightly upgrade pulled pydantic 2.14.0a1 + pydantic-yaml
1.6.1a1, and the pydantic alpha breaks langchain-core at import time
(RunnablePassthrough pydantic ValidationError), failing the nightly
boot right after a successful install. Clean installs were fine - only
this upgrade path resolved the alpha combo.
Scope pre-release eligibility to the langflow lockstep stack instead:
uv accepts a pre-release when the package's own requirement carries a
pre-release marker, but not via transitive pins, and the nightly chain
is langflow -> langflow-base -> lfx -> langflow-sdk with exact ==devN
pins. Request each directly; langflow-sdk versions independently
(0.2.0.devN), so an explicit .dev0 floor marks it eligible while lfx's
exact pin selects the version. The 'latest' branch gets the same
treatment via .dev0 floors on all four.
Verified by dry-run against PyPI: langflow/langflow-base/lfx at
1.11.0.dev2 + langflow-sdk 0.2.0.dev2 resolve with pydantic staying at
stable 2.13.4.
fix(ci): allow pre-releases when pinning the nightly in migration validation
Migration Test: pip/venv (stable -> nightly) failed deterministically on
nightly run 27260425158 (twice, including a rerun):
hint: langflow-base was requested with a pre-release marker (e.g.,
langflow-base==1.11.0.dev1), but pre-releases weren't enabled
(try: --prerelease=allow)
This is the first nightly publishing as a canonical .devN pre-release
of the langflow distribution (nightly -> stable bundle cutover). The
'latest' branch of the upgrade step already passes --prerelease=allow,
but the pinned-version branches do not. uv implicitly allows the
pre-release for the directly requested ==X.Y.Z.devN pin, yet langflow's
metadata pins langflow-base==X.Y.Z.devN transitively, and uv rejects
transitive pre-releases unless they are enabled - so the install fails
after the stable uninstall, sinking the migration test.
Add --prerelease=allow to both pinned-version install lines.
fix(test): gate models.dev background refresh out of tests
Integration tests failed twice in nightly run 27260425158 with pyleak
EventLoopBlockError - first Integration Tests 3.14, then 3.12 on the
rerun, each time in a different test. The blocking stack points at
refresh_models_dev_periodically: every app boot unconditionally starts
a lifespan task that immediately fetches https://models.dev/api.json,
so the request lands mid-test in whatever test happens to be running.
Under pyleak's asyncio debug instrumentation the fetch blocked the loop
0.797s against a 0.2s threshold. Whichever test draws the short straw
flakes - which is why it looked transient and moved between versions.
Add a LANGFLOW_MODELS_DEV_REFRESH env gate (default unchanged: enabled)
and disable it session-wide in the backend test conftest. Tests fall
back to the bundled static model lists, which is also deterministic.
Verified: with the gate set, app boot makes zero models.dev requests;
the previously failing integration test passes.
fix(ci): anchor langflow-base version extraction in nightly docker build
The first nightly on the 1.11 workspace (tag v1.11.0.dev0, run
27253229568) failed in Build Nightly Base Package within seconds:
'Base version format is incorrect'. The extraction (uv tree, grep
langflow-base unanchored, awk field 3, first line) broke because uv
tree now prints the langflow-base workspace-root line
('langflow-base v1.11.0.dev0', two fields) before any dependency line
('langflow-base[complete] v1.11.0.dev0' under the langflow root, three
fields), so the first match yields an empty field 3 and the format
check exits 1. uv tree's stderr is discarded, which made the real
cause invisible in CI.
Anchor to the root line and take field 2 instead - the exact pattern
the langflow (main package) extraction in this same file already uses,
which is why the main-package builds passed on the same tag. Verified
both extractions print 1.11.0.dev0 against a local checkout of
v1.11.0.dev0.
fix(test): raise spawn-child join timeout in test_multi_process_visibility
The test spawns a child via multiprocessing spawn context, which
cold-imports the full langflow package (plus coverage's multiprocessing
hooks in CI) before appending a single event. The 10s join timeout is
routinely exceeded on a loaded CI runner sharing 4 vCPUs with a second
xdist worker: in nightly run 27253229568 (Unit Tests - Python 3.12 -
Group 5) the test failed all 12 executions (5 reruns x 2 step attempts),
each rerun exactly 10s apart - the join deadline, not a product bug.
Raise the liveness bound to 60s (join returns immediately when the
child exits, so the passing case is unaffected) and kill the child on
timeout so a hung spawn can't leak into later tests.
fix(ci): rebalance backend test splits with measured durations + raise unit-test step timeout
Unit Tests - Python 3.12 - Group 3 has been failing at 98-99% on the
nightly: the job hits the nick-fields/retry 40-minute per-attempt timeout
and pytest is SIGTERM'd mid-test, so it looks like one flaky last test
when it is actually a deterministic timeout (and the internal retry plus
run-level retries can never succeed).
Root cause is twofold:
1. .test_durations was last regenerated ~May 2025 and covered only 2,219
of ~9,500 current unit tests, so pytest-split weighted 77% of the
suite at the 0.73s average. The expensive client-fixture tests
(test_webhook.py, test_login.py - each pays a full create_app +
lifespan boot per test, 60-120s late in a CI run) clustered into
group 3's tail, making it ~8-10 minutes slower than its siblings
(33:15 on 3.13, >40min on 3.12 which is additionally slowed by
astrapy disabling SSL connection reuse on Python 3.12.0-11).
The weekly store_pytest_durations workflow that should refresh the
file has been dying at the 6-hour GitHub job limit every week (serial
full-suite run no longer fits), so the file silently froze.
This regenerates the file from real per-test wall-clock measured in
the passing Python 3.13 nightly jobs (run 27246228762 attempt 1, all
5 groups, parsed from the -vv xdist logs: per-worker start-to-start
deltas). 9,508 tests now have measured durations; old entries are
kept where no new measurement exists. Simulated least_duration
split goes from one outlier group to 5 even groups (~24.6 min each)
with the >50s tests spread 1-2 per group instead of 7 in one.
2. timeout_minutes 40 -> 50 gives headroom for matrix-cell variance
(3.12 runs ~20% slower than 3.13) so a slightly slow cell degrades
gracefully instead of burning 2x40min and failing the whole run.
Follow-ups (not in this PR): fix store_pytest_durations to run with
xdist or split groups so it fits the 6h limit; investigate the in-worker
degradation that makes client-fixture boots cost 8-12s early in a run
but 60-120s after ~30 minutes.
Companion to the release-1.11.0 fix (#13574). The 1.10.1 fork bump left component_index.json's version at 1.10.0; _read_component_index fails closed on the exact-version mismatch, so the bundled registry loads as None and the upgrade-gate LFX tests fail on this branch's CI.
Surgical restamp: version -> 1.10.1, sha256 recomputed with the build script's exact hashing/serialization. Entries unchanged; 2-line diff. The three affected tests pass locally.
* docs: record nightly→stable bundle cutover plan (gated on lfx 1.10.0)
Add src/bundles/NIGHTLY.md documenting why langflow-nightly currently
renames the bundles (lfx and lfx-nightly ship the same lfx/ import, so a
stable bundle would co-install both and collide) and the deferred cutover
(Approach A: canonical pre-releases; B: lfx as a bundle extra), gated on
stable lfx 1.10.0 being published to PyPI.
Also expand two docstrings in scripts/ci/update_lfx_version.py to state
the deeper install-conflict reason, not just the resolve failure. No
behavior change.
* feat(ci): nightly Approach A — canonical pre-releases, drop nightly bundles [DRAFT/gated] (#13529)
feat(ci): nightly Approach A — canonical pre-releases, drop nightly bundles
DRAFT reference implementation of the nightly→stable-bundle cutover documented
in src/bundles/NIGHTLY.md. Publishes the nightly under CANONICAL package names as
.devN pre-releases instead of separate *-nightly distributions, so the stable
lfx-* bundles resolve against a single canonical lfx (no dual-lfx install
collision) and no nightly bundle packages are produced.
- tag scripts (pypi/lfx/sdk_nightly_tag.py): count .devN against the canonical
PyPI histories instead of the *-nightly projects
- update scripts: stop renaming to *-nightly; set .devN versions; re-pin
inter-package deps to exact canonical dev versions; delete the bundle
rename/repin (update_lfx_dep_in_bundles, rename_bundles_for_nightly)
- release_nightly.yml: publish canonical pre-releases; remove bundle build,
dist-nightly-bundles artifact, publish-nightly-bundles job + its gate; verify
canonical names; main wheel glob dist/langflow-*.whl
- nightly_build.yml: drop the bundle git-add in the tag commit
- NIGHTLY.md: Approach A marked implemented + activation gate + A1/A2 follow-ups
Held as DRAFT: do not activate until stable lfx 1.10.0 is published AND the
nightly base is the next minor (release-1.11.0). A 1.10.0.devN core sorts below
1.10.0 and would fail the bundles' >=1.10.0 floor. Stacked on #13528.
(.secrets.baseline: incidental line-number shifts for the two workflows + prune
of pre-existing stale Pokédex Agent.json entries.)
* docs(ci): drop internal 'Approach A' label from nightly cutover comments
Comment- and docstring-only change across scripts/ci/* and the two nightly
workflows; no logic change. The two workflow edits stay single-line so
.secrets.baseline line numbers are unaffected. src/bundles/NIGHTLY.md keeps
its A/B decision-record framing intentionally.
* feat(ci): make nightly consumers work with canonical pre-releases
Follow-ups from the nightly cutover that are part of its blast radius (the
nightly now publishes canonical `.devN` pre-releases, not `*-nightly`
distributions):
- version.py: derive the "Nightly" label from the `.dev` version marker, since
the canonical `langflow`/`langflow-base` distribution matches first in the
lookup. Keeps the startup banner and telemetry `package` field identifying
nightlies. Adds a canonical-dev test; updates the base-dev assertion.
- ci.yml check-nightly-status: query the canonical `langflow` project and pick
the latest `.devN` release date instead of `langflow-nightly`'s `.info.version`.
- db-migration-validation.yml: install the nightly as `langflow[postgresql]==<dev>`
(pre-release) instead of `langflow-nightly[...]`; verify via version("langflow").
- src/lfx/README.md: nightly install is `uv pip install --pre lfx`.
- NIGHTLY.md: rewrite the follow-ups section (these are addressed; Docker image,
A2 meta-package, and website docs remain deferred by design).
The `langflowai/langflow-nightly` Docker image name is intentionally unchanged.
* fix(ci): correct nightly verify uv tree parsing + stale base-dep regex
Addresses review of #13528:
- release_nightly.yml LFX verify: `uv tree | grep lfx | head -n1` matches the
bundle `lfx-ibm` first → 'Name lfx-ibm does not match lfx'. Root the tree with
`uv tree --package lfx` so the first line is the lfx package itself.
- release_nightly.yml base verify: under canonical naming `langflow-base` prints
as a top-level `langflow-base v<ver>` line, so the old $2/$3 field parse read
name="v0.10.0" and version="". Use `uv tree --package langflow-base` and $1/$2.
- update_lf_base_dependency.py update_base_dep: regex only accepted ~=/==, so its
CLI entry point couldn't match the current root dep `langflow-base[complete]>=0.10.0`.
Add >= (parity with update_uv_dependency.py). The active nightly path uses
update_uv_dependency.py and was unaffected.
* docs(nightly): point NIGHTLY.md status at the activation gate, not draft state
Per review of #13528: this file ships inside #13528 (#13529 was folded in), so
the 'stacked on prep #13528' + 'held as a draft' framing is stale and misleading.
Reword the status block to state the real guard is the activation gate (stable
lfx 1.10.0 published AND next-minor base), not merge/draft state. Also reword the
follow-ups heading 'decide before un-drafting' -> 'decide before activating'.
The reference stack README pointed LANGFLOW_LOG_FILE and LANGFLOW_LOG_DIR at
different directories, so following it produced an empty Grafana dashboard:
Langflow wrote to one path while Promtail scraped another. It also documented a
stdout-scrape alternative the shipped Promtail config does not implement.
Make the two paths consistent, require an absolute log path, correct the stdout
note, and add a no-Langflow smoke test that writes a sample record and confirms
it reaches Loki.
* fix(security): remove the disabled Python Code Structured tool component
Follow-up to #13538, which neutered PythonCodeStructuredTool to a
non-executable stub "for one release cycle, full removal later." This
completes that removal.
- Delete the component and its registration in lfx.components.tools.
- Drop its entry from the component index (num_components 355 -> 354,
sha256 recomputed surgically) and from stable_hash_history.json.
- Remove its 18 i18n keys from every locale file.
- Replace the dedicated stub unit test with a removal test in
test_dynamic_import_integration.py.
- Add a regressions entry to regressions/1.10.x.yaml.
The unauthenticated public-build RCE fix (report H1-3754930) is
unaffected: PythonCodeStructuredTool stays in
CODE_EXECUTION_COMPONENT_TYPES, so build_public_tmp still rejects any
saved or crafted flow that carries the type. instantiate_class execs the
node's stored `code` field regardless of whether the class still exists,
so the type-name block -- not the class -- is what closes the path.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* docs: document removal
* docs: typo
* Apply suggestion from @mendonk
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
When ci.yml is called from release.yml (inputs.release == true), a
Biome failure was blocking all downstream publish and docker jobs via
needs.ci.result == 'success'. Biome was already excluded from the
ci_success gate for PR merges, but the reusable CI workflow itself
could still fail when the lint job errored.
Add continue-on-error: ${{ inputs.release == true }} to lint-frontend
so Biome failures are informational-only during release runs, while
remaining visible (and blocking ci_success) on regular PRs.
* fix(bundles): bump lfx-* bundles to 0.1.1 to republish with corrected lfx pin
The published 0.1.0 artifacts on PyPI carry stale lfx pins from before the lfx 0.5.0->1.10.0 version realignment:
- lfx-arxiv, lfx-duckduckgo: lfx>=0.5.0,<0.6.0 (hard-broken; the <0.6.0 cap can never resolve lfx 1.10.0)
- lfx-docling, lfx-ibm: lfx>=0.5.0 (uncapped floor/cap mismatch)
The source pin was already corrected to lfx>=1.10.0,<2.0.0 in #13516, but the bundles were never re-published. PyPI versions are immutable, so shipping the fix requires a version bump. Bump all four to 0.1.1 so the Release Bundles workflow cuts fresh wheels carrying the correct pin. Root pyproject keeps its >=0.1.0 floors (satisfied by 0.1.1); only the bundle dist versions and their uv.lock stamps change.
* fix(release): relax bundle lfx floor for pre-release builds + idempotent bundle publish
The RC pre-release run builds lfx as 1.10.0rc0, but bundles floor lfx at >=1.10.0. Under PEP 440 a pre-release sorts below the final, so 1.10.0rc0 fails >=1.10.0 and the cross-platform install test cannot resolve the bundle wheels against the RC lfx wheel.
build-base/build-main/build-lfx already rewrite their inter-package deps to the pre-release version when pre_release=true; build-bundles was the only release artifact missing that step. Add it: when pre_release=true, rewrite each bundle's lfx floor to the exact pre-release version, keeping the wide <2.0.0 BUNDLE_API cap. Stable source stays at >=1.10.0 -- only RC wheels are relaxed, at build time, so no source churn or re-tag.
Also make publish-bundles tolerate 'already exists' duplicate wheels on rerun, matching release_bundles.yml.
* fix(security): block code-execution components on unauthenticated public flow builds (H1-3754930)
PythonCodeStructuredTool exec()'d its attacker-controlled `tool_code` field at
flow-build time. Because a PUBLIC flow can be built with no authentication via
POST /api/v1/build_public_tmp/{flow_id}/flow, that sink was reachable as an
unauthenticated server-side RCE — and other components (Python Interpreter/REPL,
Smart Transform) execute code on the same path, so removing one component alone
would not close the gap.
- Harden the public build path: build_public_tmp now rejects flows containing
code-execution components via validate_public_flow_no_code_execution(). The
check keys on the node `type`, so it holds regardless of the stored component
`code`, and is enforced ONLY on the unauthenticated public path —
authenticated /build is unchanged.
- Neuter PythonCodeStructuredTool to a non-executable compatibility stub: all
exec()/eval() sinks removed; build_tool returns a tool that raises a
deprecation error. The component stays registered with identical
display_name/inputs so saved flows still load and locale keys don't change.
It will be fully removed in a future release.
component_index.json (code_hash) is regenerated by autofix.ci.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* [autofix.ci] apply automated fixes
* fix: validate_public_flow_no_code_execution
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* fix: serialize DataFrames in tool mode to prevent pandas truncation
When Memory Base or Knowledge components are wired as agent tools, the DataFrame
result was returned directly without serialization. LangChain would then stringify
this for the agent observation using pandas' default repr, which truncates all
cells to 50 characters (display.max_colwidth=50), inserting "...".
This breaks the F3 agent use case where agents need to reliably recall facts from
memory. The agent receives truncated content and cannot see the full text.
The fix serializes DataFrames through the existing serialize() function, which
converts them to list[dict] format with full, untruncated content. This maintains
consistency with how other result types (Message, Data, etc.) are handled in tool mode.
- Affects: Memory Base and Knowledge components used as agent tools
- Does not affect: Component-to-component wiring or normal (non-tool) execution
- Testing: Added tests verifying DataFrames serialize to list[dict] with complete content
Improved MB GUI component description
* chore: auto-bake note keys and regenerate backend locales/en.json [skip ci]
* [autofix.ci] apply automated fixes
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>