Commit Graph

17523 Commits

Author SHA1 Message Date
71fbf5ff00 docs: cut version 1.9.0 (#12681)
* version-1.9.0-docs

* [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>
2026-04-14 02:07:01 +00:00
2fa3d1c759 feat: add langflow-sdk support to release workflow (#12679)
* feat: add langflow-sdk build and publish support to release workflow

Add support for building and publishing the langflow-sdk package in the
release workflow, mirroring the nightly build support added in #12491.

Changes:
- Add `release_sdk` workflow input for controlling SDK release
- Add `determine-sdk-version` job with first-release PyPI handling
- Add `build-sdk` job with version verification and import testing
- Add `publish-sdk` job that publishes SDK to PyPI before LFX
- Update `build-lfx` to download SDK artifact and test both wheels together
- Update `build-base` and `build-main` to use SDK wheel as find-links
- Pass SDK artifact to cross-platform tests
- Add validation: releasing LFX requires releasing SDK
- Add pre-release version handling for SDK and LFX's SDK dependency

* Update release.yml

* Update release.yml

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-04-14 01:43:25 +00:00
389b11b884 docs: update wxo signup link (#12683)
Update wxo signup link:
2026-04-13 22:04:24 -04:00
40c5973292 fix: Allow >= specifications in dependencies (#12682)
* fix: Allow >= specifications in dependencies

* [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>
2026-04-13 21:35:21 -04:00
19df4606ae chore: update deps (#12657)
* chore: update deps

update deps due to sec vuln

* chore: langchain-core>=1.2.28

langchain-core>=1.2.28

* chore: update pypdf

pypdf 6.10

* chore: pyarrow, openai, litellm, mem0ai, toolguard

picomatch, pyarrow, openai, litellm, mem0ai, toolguard

* chore: override litellm

* chore: match base uv.lock to root

* chore: update tool.uv position

update tool.uv position

* chore: langflow-base[complete]>=0.9.0

langflow-base[complete]>=0.9.0

* chore: revert pyarrow

revert pyarrow

* chore: revert "lfx~=0.4.0",

* chore: lfx white space

* chore: remove allow-direct-references = true

* chore: uv lock --upgrade after merge
2026-04-13 23:23:37 +00:00
26c415056c feat: add SHA-256 hash-based API key lookup (#12597)
* feat: add SHA-256 hash-based API key lookup

Replace the O(n) full table scan in check_key with an indexed
SHA-256 hash column for O(1) lookup. Legacy keys without a hash
fall back to decrypt-and-compare and get their hash backfilled
on first successful match.

- Add api_key_hash column to ApiKey model (nullable, indexed)
- Hash stored at key creation time
- Migration adds column and backfills hashes for existing keys
- Fail closed when multiple keys share the same hash
- Remove unused fernet_obj parameter from decrypt_api_key

* fix(migration): skip hashing duplicate-plaintext API keys

Two-pass backfill: decrypt all rows, group by plaintext, then hash only
unique-plaintext rows. Duplicate-plaintext groups are left with NULL
hash so the runtime fast-path lookup cannot return multiple matches and
fail closed. The runtime slow-path matches and backfills exactly one
row per group on first use; remaining NULL rows become harmless
orphans.

Logs counts only (no key IDs or plaintexts) to avoid leaking
operational info via deployment logs.

Extracts _backfill_hashes helper for testing; adds 9 unit tests.

---------

Co-authored-by: Eric Hare <ericrhare@gmail.com>
2026-04-13 23:06:44 +00:00
83acc4143d docs: mcp client and other changes (#12627)
* tools-component

* tools-partial-and-release-notes

* mcp-astra-changes

* tutorial-changes

* client-page-and-release-notes

* langflow-mcp-client-for-coding-agents

* fix-links

* Apply suggestions from code review

Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>

* include-explanation-for-step-4

---------

Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
2026-04-13 22:28:05 +00:00
a425540bdb docs: add flow versioning (#12634)
* add-flow-versioning-and-release-note

* add-flow-db-location
2026-04-13 22:20:05 +00:00
17ab88fca7 fix: fix base64 padding bug and empty Fernet error messages (#12595)
Extract shared `add_base64_padding` and `ensure_fernet_key` functions
to eliminate duplicated key derivation logic between AuthService and
auth/utils.py.

Fix `_add_padding` adding 4 `=` characters instead of 0 when key length
is a multiple of 4, which broke Fernet key derivation for 44-char keys.

Change `%s` to `%r` in decryption failure logs so InvalidToken exceptions
(which have no message string) render as `InvalidToken()` instead of
empty strings.
2026-04-13 21:18:29 +00:00
95d4c94ef9 fix: upgrade playwright to 1.58.0 to address Chromium CVEs (#12668)
* fix: upgrade playwright to 1.58.0 to address Chromium CVEs

- Add playwright>=1.58.0 to override-dependencies in pyproject.toml
- Update uv.lock: playwright 1.49.0 -> 1.58.0, pyee 12.0.0 -> 13.0.1
- Fixes CVE-2026-2313, CVE-2026-2314, CVE-2026-2315, CVE-2026-2319,
  CVE-2026-2321, CVE-2026-2441, CVE-2026-2648, CVE-2026-2649
- Ensures Docker builds download updated Chromium with security patches

* fix: update npm to latest version to address brace-expansion CVE-2026-33750

- Add npm update after Node.js installation in Dockerfile
- Fixes CVE-2026-33750 in system npm's brace-expansion dependency
- System npm had brace-expansion 2.0.2, update gets 5.0.5+
- Low risk change: npm is backward compatible, only affects CLI tool

* revert: remove npm update from Dockerfile

- npm update attempts were causing CI build failures
- Bundled npm has issues but updating it is proving problematic
- Focus on playwright CVE fix which is the primary concern
- brace-expansion CVE-2026-33750 is lower priority (DoS only)

---------

Co-authored-by: Janardan S Kavia <janardanskavia@Janardans-MacBook-Pro.local>
2026-04-13 21:04:34 +00:00
42e84d0fdf fix: resolve race condition in test_component_logging for Python 3.13 (#12676)
Replace queue.get_nowait() with asyncio.wait_for(queue.get(), timeout=5.0)
to properly wait for async events in the queue, preventing QueueEmpty errors
in Python 3.13.

Fixes flaky test failure in release workflow.
2026-04-13 18:28:04 -04:00
4be5f7f52f chore(i18n): disable automatic browser language detection (#12671)
* chore(i18n): disable automatic browser language detection, hardcode English

* chore(i18n): remove language selector from Settings page
2026-04-13 20:26:42 +00:00
2da54a50d1 fix(ui): show moved flow in destination project without page refresh (#12670)
* fix move flows folders

* fix folder spec

* fix folder spec test

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-04-13 20:07:12 +00:00
953ccd05c1 fix: Build the correct oauth callback URL for MCP Composer (#12662)
* fix: Build the correct oauth callback URL for MCP Composer

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Clean up the normalization function

* Update service.py

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-04-13 20:06:04 +00:00
ac414d369a fix: Root path option in settings for reverse proxy (#12603)
* fix: Root path option in settings for reverse proxy

* Update test_security_cors.py

* fix: Better test for middleware

* Update test_security_cors.py

* Update src/lfx/src/lfx/services/settings/base.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/backend/tests/unit/api/v1/test_mcp_reverse_proxy.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* [autofix.ci] apply automated fixes

* Ruff fixes

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-04-13 19:23:39 +00:00
0982030961 fix: Resolve relative path issues in bundled environment (#12625)
fix assistant path lfx

Co-authored-by: Antônio Alexandre Borges Lima <104531655+AntonioABLima@users.noreply.github.com>
2026-04-13 19:18:07 +00:00
a216aa9060 fix(ui): refactor connection panel and fix search empty state (#12659)
* fix(ui): refactor connection panel and fix search empty state rendering

Extract connection state management into useConnectionPanelState hook
and search/list UI into ConnectionSearchList component. Fixes bug where
blank list items rendered before the empty state when search returned
no results.

* fix(ui): prevent modal jump when clicking connection items in Chrome

Chrome scrolls the nearest scrollable ancestor when focusing sr-only
inputs inside labels. Adding relative + overflow-hidden to the label
contains the scroll-into-view behavior within the label bounds.
2026-04-13 19:10:07 +00:00
73a48b5810 docs: generate and bump open API spec to 1.9.0 (#12638)
generate-and-bump-openapi-spec-to-1.9.0
2026-04-13 18:59:43 +00:00
d698666a1f fix: restore webhook SSE authentication using FastAPI dependency injection (#12661)
fix sse webhook
2026-04-13 18:55:48 +00:00
faac7ad007 fix: allow booleans, numbers, etc. in root-level tweaks (#12605)
fix: allow booleans, numbers, etc. in root-level tweaks (#11830)

Widen the Tweaks schema to accept bool, int, and float values alongside
str and dict, so scalar tweaks like {"stream": false} are no longer
rejected by Pydantic validation.

bool is listed before int in the union to prevent Pydantic from coercing
booleans to integers (since bool is a subclass of int).

Adds unit tests for boolean and numeric root-level tweaks, as well as
direct Tweaks Pydantic model validation tests.

Co-authored-by: Alex Kuligowski <alekuligowski@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 18:10:36 +00:00
7e786a728f fix: Raw input value leaks into Global Variables dropdown list (#12660)
* Variable input shown in dropdown

* added testcases

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Olayinka Adelakun <olayinkaadelakun@Olayinkas-MacBook-Pro.local>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-04-13 17:39:49 +00:00
349e78c758 fix: propagate resource-specific conflict error to api (#12580)
* fix: preserve resource-specific conflict mapping in wxo deployment flow
- rename DeploymentConflictError to ResourceConflictError (with a backward-compatible alias) and propagate resource/resource_name across deployment error handling
- extend raise_for_status_and_detail to accept explicit conflict hints and only infer resource/resource_name from provider detail as a fallback
- update deployment mappers/helpers to use resource/resource_name and format conflict details from structured fields
- add explicit conflict metadata at known wxo catch/re-raise points (connection/tool/agent paths) and enforce hint passing through raise_as_deployment_error
- prevent create/update top-level handlers from over-tagging conflicts as agent when downstream errors are tool/connection conflicts
- centralize create-agent provider error translation via raise_as_deployment_error
- add/adjust unit tests for route handlers, mapper conflict formatting, wxo service conflict propagation, and lfx deployment exception behavior (including Simple_Agent regression)

* remove DeploymentConflictError shim

* pass resource_name only on creation paths

* allow None

* fix(deployments): simplify conflict mapping and tighten error handling
Remove conflict-hint inference fallback, keep pass-through conflict detail formatting, tighten ClientAPIException status extraction, and drop temporary debug prints in deployment error paths.

* fix(deployments): simplify conflict hint mapping and align test expectations
Remove redundant conflict-hint normalization in deployment exceptions, clarify base mapper conflict-detail docs, and improve invalid flow-version guidance. Update watsonx deployment tests to assert current service-layer conflict/resource and exception-chain behavior.

* get rid of tool name fallbacks

* hard code fallback message
2026-04-13 16:08:40 +00:00
5cb8567130 fix: make logs and outputs visible for components in tool mode (#11923)
* fix: display proper tool name and description in tool mode output

When a component runs as a tool (connected to an Agent), the output modal
now shows the proper tool name, description, and tags instead of "Tool 1".

This builds tool metadata from the component's output method name and
description for proper display in the ToolOutputDisplay component.

* test: add unit tests for tool mode event emission

Add tests to verify that components running in tool mode properly emit
events to the frontend for logs visibility and tool metadata display.

* [autofix.ci] apply automated fixes

* fix: use public accessor for component logs instead of private attribute

Add get_logs() method to Component class and use it in component_tool.py
to fix Ruff SLF001 (private-member-access) violation flagged by CodeRabbit.

* fix: emit real-time log SSE events for components running in tool mode

- Set _current_output = TOOL_OUTPUT_NAME in tool wrappers so self.log()
  fires and logs are attributed to the component_as_tool output
- Register on_log event in EventManager with thread-safe queue enqueue
  via call_soon_threadsafe for sync tools running in thread executor
- Register on_log in production event manager (JobQueueService)
- Add appendLogToFlowPool Zustand action to incrementally add logs
- Handle "log" SSE event in buildUtils to update flowPool in real-time
- Fix displayOutputPreview to also check data.logs[outputName].length

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* [autofix.ci] apply automated fixes (attempt 3/3)

* fix: address PR review issues for tool mode logs visibility

- Fix TypeError: add output_name param to _build_output_function and
  _build_output_async_function (called with 4 args but only took 3)
- Fix double-dispatch bug in event_manager.send_event: separate loop
  detection from queue dispatch to avoid misdiagnosing queue RuntimeErrors
- Improve event_manager error handling: warn on QueueFull, error with
  traceback on unexpected failures, warn when loop is unavailable
- Fix TypeScript type: VertexDataTypeAPI.logs uses LogsLogType[] (array)
  and remove the 3 as any casts in appendLogToFlowPool
- Add input validation in buildUtils.ts log event handler to guard
  against undefined keys corrupting the flow pool
- Add server-side logger.error on tool execution failure with exc_info
- Fix tests: replace end_vertex assertions (never emitted by tool path)
  with build_end/log assertions; add LoggingCalculator subclass to test
  real-time log event emission

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* [autofix.ci] apply automated fixes

* fix: store tool mode logs under component_as_tool output key

- In get_tools(), pass TOOL_OUTPUT_NAME instead of output.name to
  _build_output_function/_build_output_async_function so self.log()
  events are stored under 'component_as_tool' key in flowPool, matching
  what the component_as_tool output's inspect modal reads
- Fix emptyOutput in NodeOutputfield to return false when logs exist,
  preventing disabledInspectButton being vacuously true when outputs={}
- Fix TypeScript undefined index type on internalOutputName in both
  displayOutputPreview and emptyOutput checks

* fix: address ruff violations and test failures in tool mode logs

- Fix ruff I001/SIM117/F401/TRY003/EM101 violations in test_component_toolkit.py
- Replace private _event_manager/_current_output access with public setters in component_tool.py
- Add set_current_output() public method to Component
- Fix send_event() to call put_nowait directly in sync context (no event loop)
- Fix _build_output_function/async to use getattr default fallback for non-component methods
- Fix tests to use constructor-based _id to survive __deepcopy__
- Add TypeError guard in _get_method_return_type for mocked methods
- Remove incorrect pytest.raises(ToolException) since handle_tool_error=True swallows it

* fix: handle array logs in switchOutputView and guard build_end/log events

- Export onEvent for testability
- Guard build_end event against missing data.id to prevent state corruption
- Type results as OutputLogType | LogsLogType[] in SwitchOutputView to handle
  tool mode logs arriving as an array
- Guard resultType/resultMessage against array case to prevent crashes
- Add tests for onEvent log/build_end paths and appendLogToFlowPool store method

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 16:05:54 +00:00
da24dfad61 docs: components index path env var (#12630)
* env-var

* allowlist-for-custom-components

* clarify-which-wins
2026-04-13 15:06:14 +00:00
e89c124153 feat: harden /variables/detections to return only global variables (#12650)
* refactor: simplify /variables/detections to return only verified global variable names
Drop the two-tier detection model (load_from_db + password-field heuristics)
in favor of a single source: fields with load_from_db=True. Candidates are
cross-checked against the user's existing global variables before being
returned, preventing accidental secret leakage via template values.
- Remove DetectedEnvVar model and unresolved_ids from the response
- Flatten response to list[str] of verified global variable names
- Fail fast (404/422) on missing or malformed flow versions
- Add min_length=1 validation on flow_version_ids
- Update frontend types and consumers to match simplified response

* refactor: batch flow-version loading for variable detection
Reduce /variables/detections query fanout by fetching flow versions in one CRUD call and validating IDs up front in the request schema. Add a bounded filter-size guard in flow_version CRUD, keep payload-shape validation explicit in the endpoint, and align unit/API tests with the new batch helper path.
- Deduplicate DetectVarsRequest.flow_version_ids via schema validation
- Add get_flow_version_entries_by_ids() with MAX_VERSION_ID_FILTER_SIZE guard
- Replace per-ID flow-version lookups in detect_env_vars with one batch fetch
- Update detect-env-vars unit tests to mock the batch helper and cover dedup/validation paths
- Add CRUD guard test for oversized ID filters
- Update variable endpoint tests to patch get_flow_version_entries_by_ids
2026-04-13 14:45:28 +00:00
d40e316622 feat(templates): replace AstraDB with native Knowledge Base in Vector Store RAG (#12629)
* feat(templates): replace AstraDB with native Knowledge Base in Vector Store RAG starter project

Swaps the AstraDB vector store components for Langflow's native
KnowledgeIngestion and KnowledgeBase components, removing the need
for external Astra credentials. Updates README and Load Data notes
to reflect the new components, removes the disconnected AstraDB node,
and updates the template tags accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: clean up hardcoded local state from template export

- clear REDACTED api_key placeholder
- clear hardcoded knowledge_base name "release"
- clear hardcoded model options (populated dynamically at runtime)

* Sanitize the KB options

* Sanitize the KB options

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: ogabrielluiz <gabriel@langflow.org>
Co-authored-by: Eric Hare <ericrhare@gmail.com>
2026-04-11 23:55:50 +00:00
922e7310fc fix: Make sure flow upgrades work with Agent component and ModelInputs generally (#12620)
* fix: Flow upgrade works for Agent component

* Add test coverage

* Better behavior for model providers

* Update index.tsx

* Combobox in language model

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* [autofix.ci] apply automated fixes (attempt 3/3)

* Update test_unified_models.py

* Update index.tsx

* Make sure all templates start with blank options for MI

* Make sure all templates start with blank options for MI

* Update test_flow_requirements.py

* Update component_index.json

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-04-11 22:11:14 +00:00
cfaba3ede7 fix: Remove redundant api key field in KB Ingest (#12624)
* fix: Remove redundant api key field in KB Ingest

* Update component_index.json
2026-04-11 21:19:17 +00:00
ca8547b6e6 fix: MCP Tools loses optional field types (#12622)
* fix: MCP Tools loses optional field types

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* [autofix.ci] apply automated fixes (attempt 3/3)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-04-11 20:32:16 +00:00
3fba536f03 fix(ui): Show welcome page for new users when AUTO_LOGIN is false (#12626)
* fix page displayed on AUTO LOGIN false

* fix: translate Portuguese test comments to English

---------

Co-authored-by: ogabrielluiz <gabriel@langflow.org>
2026-04-11 14:56:16 +00:00
976bb699ce fix: Update WXO tests for handling none keys (#12636) 2026-04-11 03:27:11 +00:00
2cc8460f2a fix: Remove test that doesnt test anything (#12633) 2026-04-11 01:56:19 +00:00
4eb35b2261 feat: add project_id query param to list /deployments endpoint (#12574)
* feat: add project_id query parameter to deployments list endpoint
Allow filtering GET /api/v1/deployments by project (folder) via an
optional project_id query param. Threaded through list_deployments_synced,
list_deployments_page, and count_deployments_by_provider. Rejected with
422 when combined with load_from_provider=true.

* make FE use project_id query param for listing deployments

* friendly message

* feat: send project_id when creating a deployment from the frontend
Resolve the current project context (flow's folder_id, URL folderId,
or default collection) and pass it as project_id in the deployment
create payload so deployments are scoped to the active project.

* test(deployments): add project-scoped filter coverage
Add database-backed tests that assert deployment list and count queries
return only records for the requested project_id.
2026-04-10 22:57:34 +00:00
75e596a4af feat: wxo api provider data url for provider accounts (#12607)
* feat: deployment page list

* feat: add deployment stepper modal with context-based state management

Implement a multi-step deployment creation flow with 4 steps (Provider,
Type, Attach Flows, Review). State is centralized in a scoped
DeploymentStepperContext to avoid prop-drilling across step components.
Includes bug fixes for version re-selection and connection pre-selection.

* feat: replace mock flows and versions with real API data in deployment stepper

Fetch real flows from the API (scoped to current folder) and versions
per-flow lazily when selected. Enrich selectedVersionByFlow context to
store versionTag alongside versionId so the review step can display it
without re-fetching. Remove MOCK_FLOWS_WITH_VERSIONS from mock-data.

* refactor: improve deployment stepper code quality and conventions

Rename all new deployment files to kebab-case per project conventions,
fix context re-render issues with useMemo/useCallback, replace raw
Tailwind colors with design tokens, add missing data-testid and ARIA
attributes, fix Deploy button disabled on review step, and move shared
FlowTabType to a dedicated types file.

* refactor: align deployment provider types and UI to backend contracts

- Rename ProviderInstance -> ProviderAccount to match backend naming
- Update ProviderAccount fields to match DeploymentProviderAccountGetResponse (provider_key, provider_url, provider_tenant_id, created_at, updated_at)
- Update ProviderCredentials fields to match DeploymentProviderAccountCreateRequest (provider_key, provider_url, api_key)
- Rename all "instance" UI terminology to "environment" (tabs, labels, components)
- Auto-select watsonx Orchestrate on mount as the only supported provider
- Remove Kubernetes from mock providers; update mock data to use watsonx_orchestrate only

* feat: add react-query hooks for deployments and provider accounts with mock data

- Add useGetProviderAccounts hook (GET /deployments/providers) replacing direct MOCK_PROVIDER_INSTANCES import in step-provider.tsx
- Add useGetDeployments hook (GET /deployments) replacing direct MOCK_DEPLOYMENTS import in deployments-page.tsx
- Replace fake setTimeout loading state with hook isLoading state
- Register DEPLOYMENTS and DEPLOYMENT_PROVIDER_ACCOUNTS URL constants
- Real API calls are commented out with TODO markers for easy swap when backend is ready

* chore: remove stale biome-ignore suppression in step-attach-flows

* fix: replace button role=radio with semantic input type=radio in ProviderCard

* fix: replace button role=radio with semantic radio inputs across deployment stepper

- Extract RadioSelectItem component (label + sr-only input + checkbox indicator)
  used by version, connection, and environment selectors
- Fix step-type.tsx type cards with label/input pattern (matching ProviderCard)
- Add role="radiogroup" wrapper to EnvironmentList
- Fix envVars key: use stable crypto.randomUUID() id instead of array index

* feat: add name field to provider accounts, multi-select connections, and real API call

- Add `name` field to ProviderAccount, ProviderCredentials, and mock data
- Switch connection selection from single to multi-select (CheckboxSelectItem)
- Allow creating new connections inline from the attach flows step
- Lift connections state up to DeploymentStepperContext
- Move ConnectionItem type from step-attach-flows to shared types.ts
- Wire up real API call in useGetProviderAccounts (remove mock)

* feat: wire deploy button and populate deployments page with real API data

- Add usePostDeployment and usePostProviderAccount mutation hooks
- Wire Deploy button in stepper modal: creates provider account if needed,
  then POSTs to /api/v1/deployments with WXO provider_data shape
- Fix environment_variables payload: wrap values as { value, source: "raw" }
  to satisfy EnvVarValueSpec schema
- Fix connection app_id: prefix with conn_ so WXO name validation passes
  (names must start with a letter)
- Multi-select connections with checkbox UI; persist connections in context
  so they survive back/forward navigation
- Update Deployment type to match API response shape; remove mock fields
  (url, status, health, lastModifiedBy)
- Wire useGetDeployments to real API; load provider ID from useGetProviderAccounts
- Update deployments table to display real fields: name, type, attached_count,
  provider name, updated_at

* refactor: extract DeploymentsContent component to eliminate nested ternary

* feat: add Test Deployment chat modal for deployed agents

Implements a chat interface to test deployments directly from the UI.
Wires up two entry points: the stepper modal "Test" button (inline
transition) and the deployments table play button (standalone dialog).

- Add usePostDeploymentExecution and useGetDeploymentExecution hooks
  hitting POST/GET /api/v1/deployments/executions
- Build test-deployment-modal: ChatHeader, ChatMessages, ChatInput,
  ChatMessageBubble with user/bot avatars, loading dots, tool traces
- useDeploymentChat hook: recursive setTimeout polling (max 30 × 1.5s),
  thread_id persistence for multi-turn, watsonx response parsing
  (response_type/type text, wxo_thread_id extraction)
- Stepper modal transitions inline to TestDeploymentContent on Test click
- Deployments table play button opens standalone TestDeploymentModal

* feat: add syntax highlighting to chat code blocks using SimplifiedCodeTabComponent

* feat: add action menu and icon-based type badge to deployments table

- Add dropdown action menu (Duplicate, Update, Delete) to each row
- Replace left-border type badge with icon-based badge (Bot for Agent, Plug for MCP)

* refactor: remove connected status from provider card in stepper

* feat: auto-detect flow env vars in deployment connection form

- Add POST /deployments/variables/detections backend endpoint that scans
  flow version data for credential fields (load_from_db=True globals and
  password=True fallbacks) and returns detected variable names
- Derive meaningful env var names from the model field's category when no
  global variable is linked (e.g. OPENAI_API_KEY from category "OpenAI")
- Add DetectEnvVarsRequest/DetectedEnvVar/DetectEnvVarsResponse schemas
- Add usePostDetectDeploymentEnvVars frontend mutation hook
- Pre-populate Create Connection env var rows with detected keys/values
  when attaching a flow version; global variable selections render as tags
  via InputComponent with global variable picker support

* feat: add empty state and smart default tab for available connections

- Default to "Create Connection" tab when no connections exist
- Show empty state with icon, description, and shortcut link when
  the Available Connections tab has no items

* feat: redesign review step with two-column layout and env vars section

Match new design reference with Deployment/Attached Flows columns
and a masked Configuration section showing env variable keys.

* feat: integrate delete deployment with loading state and fix test modal flow

- Add useDeleteDeployment hook (DELETE /deployments/{id}, refetches list)
- Show spinner + faded row while deletion is in progress; fix race where
  deleteTarget was cleared before isPending resolved by using separate deletingId state
- Redesign StepDeployStatus with animated spinner, ping ring, and success checkmark
- After deploy, "Test" closes the stepper and opens the standalone TestDeploymentModal
  (consistent UI, correct providerId, chat reset on close)
- Prevent closing the stepper modal while deployment is in progress

* refactor: address PR review concerns for deployment UI

- Split step-attach-flows.tsx (656→274 lines) into FlowListPanel,
  VersionPanel, and ConnectionPanel sub-components
- Extract Watsonx parser utilities into watsonx-result-parsers.ts,
  reducing use-deployment-chat.ts from 384 to 277 lines
- Surface detectEnvVars errors via setErrorData instead of silently
  resetting state
- Add EnvVarEntry named type to types.ts, replacing inline shape
  repeated across two files
- Move import json to module level in deployments.py (PEP 8)
- Fix URL construction in useGetDeploymentExecution to use axios
  params option, consistent with other hooks
- Remove commented-out MOCK_CONNECTIONS dead code
- Add TODO comment to hardcoded "watsonx-orchestrate" provider key

* refactor: apply React best practices and remove mock data from deployment UI

- Fix barrel imports: import directly from source files in deployments-page,
  step-provider, and step-attach-flows
- Replace useEffect auto-select with derived effectiveFlowId in step-attach-flows
- Fix async state init bug for environmentTab using useRef guard pattern
- Fix stale closure in handleAddEnvVar with functional setState
- Wrap useState initial value in lazy initializer for envVars
- Wrap all 8 handlers in useCallback; wrap panel components in memo()
- Remove mock-data.ts; move PROVIDERS constant inline to step-provider
- Drop MOCK_CONNECTIONS (was empty array) from context
- Simplify step-provider UI: remove provider selection radio group since
  only one provider exists; show watsonx Orchestrate as a static display

* feat: add Deploy button to canvas toolbar

Adds a primary-colored Deploy button at the far right of the canvas toolbar.
Clicking it saves the flow, creates a version snapshot, and opens the
deployment stepper modal with the current flow and version pre-selected in
the Attach Flows step, including auto-detection of environment variable keys.

* chore: disable ENABLE_DEPLOYMENTS feature flag

* fix: forward LANGFLOW_FEATURE_WXO_DEPLOYMENTS env var to frontend

The feature flag was reading from import.meta.env but the variable
was never injected by Vite's define config, so the deployments
feature was always disabled regardless of the .env value.

* feat: implement providers tab with environment list

Replace the "coming soon" placeholder in the Providers sub-tab with a
real table showing existing provider accounts (name, URL, provider key,
created date) fetched from the API, including loading skeleton and
empty state.

* feat: add provider creation modal with tab-aware action button

Create AddProviderModal with name, API key, and URL fields matching
the deploy modal. The top-right button now switches between
"New Deployment" and "New Environment" based on the active sub-tab.

* feat: implement provider account deletion with confirmation modal

Add useDeleteProviderAccount hook, wire it through ProvidersContent
and ProvidersTable with loading/disabled row state on delete, and
reuse DeleteConfirmationModal for the confirmation flow.

* fix: correct provider_key to watsonx-orchestrate and add API key visibility toggle

Fix the provider_key value sent to the API. Add eye/eye-off toggle
to the API Key input in both the add provider modal and the deploy
stepper's provider step.

* feat: navigate to deployments tab and open test modal after canvas deploy

After a successful deployment from the canvas deploy button, clicking
"Test" navigates to the deployments tab and auto-opens the test modal.
Also adds eye toggle to the deploy stepper's API Key field.

* Add llm config to deployment creation workflow

* [autofix.ci] apply automated fixes

* feat: add useGetDeploymentLlms query hook

Add missing query hook for the GET /deployments/llms endpoint,
resolving the broken import in step-type.tsx.

* Create provider env inline of step

Ensures the list llm call has an authed provider account to use

* feat: add extensibility for wxo tools in deployments api (#12425)

* feat(deployments): surface tool_ids in WXO API for explicit tool control
- Fix bind to reuse existing WXO tools via attachment lookup instead of
  always creating new ones
- Add tool_id-based operations (bind_tool, unbind_tool, remove_tool_by_id)
  alongside existing flow_version_id operations
- Add PATCH /deployments/snapshots/{provider_snapshot_id} endpoint to
  update snapshot content with a new flow version (blast-radius bounded
  to Langflow-tracked tools only)
- Add update_snapshot method to WXO adapter
- Enrich flow version list with deployment info (tool_id, tool_name,
  app_ids) via FlowVersionReadWithDeployments API schema
- Surface tool_id in WatsonxApiToolAppBinding responses; flow_version_id
  becomes optional for tool-id-based operations

* Revert "feat: Add Langflow Assistant chat panel for component generation (#11636)"

This reverts commit 61fac94139.

* Add some comments

* Reapply "feat: Add Langflow Assistant chat panel for component generation (#11636)"

This reverts commit d7f08791f0.

* fix(deployments): review fixes for wxo tools extensibility PR

- Add best-effort compensating rollback to update_snapshot endpoint
- Add N+1 TODO for provider account batch-fetch in build_deployment_info_map
- Remove unpopulated app_ids field from FlowVersionDeploymentInfo
- Use elif chains in validate_operation_references for tool-id ops
- Strip provider_snapshot_id once at function entry
- Add note about WXO-only update_snapshot adapter method
- Replace call-count-based _MultiQueryFakeDb with table-name dispatch
- Fix SnapshotUpdateRequest docstring route path

* fix doc

---------

Co-authored-by: Jordan Frazier <jordan.frazier@datastax.com>

* feat: allow attaching flows without connections in deployment stepper

Connections are now optional when attaching flows in step 3. Users can
skip the connection panel and proceed with just a version selected.
The deploy payload iterates selectedVersionByFlow so flows without
connections are included with an empty app_ids array.

* feat: show attached connections per flow in deployment stepper

Display connection names under each flow in the flow list panel so
users can see what's attached at a glance. Refactor the review step
to show configuration scoped per flow instead of a flat list.

* remove unused enriched flow version data. to be replaced by a new endpoint in /deployments

* Allow nonraw env vars wxo (#12435)

Allow vars to be interpreted through global vars

* feat: add update existing deployment from canvas deploy button (#12440)

* feat: add update existing deployment from canvas deploy button

When clicking Deploy on the canvas, if the flow already has existing
deployments, a choice dialog is shown allowing the user to either
update an existing deployment or create a new one. Updating calls
PATCH /deployments/snapshots/{provider_snapshot_id} with the new
flow version.

Backend changes:
- New GET /deployments/flow-attachments/{flow_id} endpoint to discover
  existing deployments for a flow
- New CRUD function list_attachments_for_flow_with_deployment_info
- New schemas FlowDeploymentAttachmentItem/FlowDeploymentAttachmentsResponse
- Fix update_snapshot to properly construct flow_definition with nested
  data structure, name, description, and last_tested_version
- Fix rollback path to cache ORM values before session.rollback()

Frontend changes:
- New useGetFlowDeploymentAttachments and usePatchSnapshot hooks
- New DeployChoiceDialog component with radio selection
- Modified deploy button to check for existing deployments on click

* feat: add flow_ids filter to deployments endpoint and fix snapshot update
Add a `flow_ids` query parameter to GET /deployments so the frontend can
discover which deployments a flow is part of. The response includes a new
`matched_attachments` field with per-attachment `flow_version_id` and
`provider_snapshot_id`, replacing the non-existent flow-attachments endpoint.
Refactor PATCH /snapshots to accept BaseFlowArtifact (via the mapper's new
resolve_snapshot_update_artifact method) instead of a raw dict, fixing the
misleading "Deployment name must include at least one alphanumeric character"
error that occurred because flow_version.data lacks a name field.
Frontend: rewrite useGetFlowDeploymentAttachments to query the real
GET /deployments endpoint per provider account.

* feat: refactor deploy dialog with update-snapshot flow and phased UI

Restructure deploy-choice-dialog into modular phases (provider, review,
deployment, update) to support both new deployments and snapshot updates.
Add use-get-deployments-by-providers query replacing the removed
flow-attachments endpoint, extract provider-credentials-form component,
and add error/navigation helpers. Backend: validate flow_id as string
in WatsonX Orchestrate service before deployment.

* [autofix.ci] apply automated fixes

* ruff

---------

Co-authored-by: Hamza Rashid <hzarashid@gmail.com>
Co-authored-by: Hamza Rashid <74062092+HzaRashid@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* feat: reorder model field and add scrollable dropdown in deploy wizard type step

Move Model select to appear after Agent Name (before Description) and
constrain the dropdown with max-height + scroll. A bouncing chevron
indicator fades in/out to signal more items below.

* feat(deployments): add paginated deployment flow-version listing (#12453)

* feat(deployments): add paginated deployment flow-version listing with snapshot sync
Add a new read path for listing flow versions attached to a deployment:
- introduces GET /deployments/{deployment_id}/flows with page/size pagination
- returns attachment-scoped metadata (flow_version id, flow_id, version_number, attached_at, provider_snapshot_id)
- keeps provider-owned fields under provider_data on each item
Implement snapshot-aware synchronization behavior for this list endpoint:
- loads deployment attachments from DB, extracts provider_snapshot_id values, and verifies them via adapter list_snapshots(snapshot_ids=...)
- removes stale attachment rows when snapshot IDs no longer exist on the provider
- falls back to DB-only response without enrichment on any sync failure (including partial failures after list_snapshots)
Refactor mapper boundaries to follow shape_* contract conventions:
- helper now passes through SnapshotListResult | None instead of pre-building enrichment maps
- route delegates full response shaping to mapper.shape_flow_version_list_result(...)
- base mapper performs direct DB->API mapping for flow-version list items
- WXO mapper overrides list shaping to enrich provider_data with connection_app_ids from snapshot binding.langflow.connections
Normalize WXO connection extraction into a shared read-path helper:
- add extract_langflow_connections_binding(...) in core/tools.py
- reuse it in verify_tools_by_ids and service config listing to avoid duplicated nested payload parsing
Add/adjust persistence and tests:
- add CRUD helpers for paginated attachment+flow_version join and attachment counting
- extend schema and route tests for new response models/endpoint behavior
- add mapper tests for base direct mapping and WXO-specific enrichment
- add sync tests for snapshot-id verification, stale-row cleanup, and fallback semantics

* fix(deployments): normalize wxo snapshot provider_data contracts
Validate and normalize snapshot connection payloads across mapper/service flows, and align flow-version item provider_data to use app_ids.
Add typed snapshot-item schema support in lfx and expand tests for missing/malformed snapshot provider_data behavior.

* add flow name

* return empty app_ids list instead of null

---------

Co-authored-by: Jordan Frazier <jordan.frazier@datastax.com>

* ref: remove resource name prefix (#12459)

* refactor: remove resource_name_prefix from all naming paths

Remove the resource_name_prefix concept entirely. Tool names now use the
exact flow name (or user-provided name in the future). Agent names use the
deployment name directly with no prefix.

BE:
- Delete resource_name_prefix.py
- Remove field + validators from API schemas (create + update)
- Remove field + validators from adapter schemas (create + update)
- Remove from mapper _build_provider_payload_body
- Remove resource_prefix from ProviderCreatePlan and ProviderUpdatePlan
- Remove tool_name_prefix from all tool creation functions
- Remove resolve_resource_name_prefix from utils
- Remove prefix constants from constants.py
- Remove prefixed_deployment_name from config.py
- Clean 5 test files (remove prefix-only tests, update payloads)

FE:
- Remove toResourceNamePrefix function from types.ts
- Remove resource_name_prefix from DeploymentCreateRequest type
- Remove usage from deployment-stepper-context.tsx payload builder

* [autofix.ci] apply automated fixes

* refactor: remove resource_name_prefix from all naming paths

Remove the resource_name_prefix concept entirely. Tool names now use the
exact flow name (or user-provided name in the future). Agent names use the
deployment name directly with no prefix.

BE:
- Delete resource_name_prefix.py
- Remove field + validators from API schemas (create + update)
- Remove field + validators from adapter schemas (create + update)
- Remove from mapper _build_provider_payload_body
- Remove resource_prefix from ProviderCreatePlan and ProviderUpdatePlan
- Remove tool_name_prefix from all tool creation functions
- Remove resolve_resource_name_prefix from utils
- Remove prefix constants from constants.py
- Remove prefixed_deployment_name from config.py
- Clean 5 test files (remove prefix-only tests, update payloads)

FE:
- Remove toResourceNamePrefix function from types.ts
- Remove resource_name_prefix from DeploymentCreateRequest type
- Remove usage from deployment-stepper-context.tsx payload builder

---------

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

* feat: wxo custom tool naming (#12460)

feat: custom tool naming when attaching flows to deployments

Users can now name tools when attaching flows in the deployment stepper.
If left blank, the flow name is used as the tool name.

BE:
- Add optional tool_name field to WatsonxApiBindOperation
- Mapper overrides raw_name_by_flow_version_id with user-provided tool_name
- Apply custom name to both raw payloads and provider bind operations

FE:
- Add toolNameByFlow state + setToolNameByFlow to stepper context
- Include tool_name in bind operations when set (trimmed, omitted if empty)
- Tool Name input in version panel (shown when a version is selected)
- Review step shows tool name (custom or flow name) in config cards
  with flow name + version underneath

* feat(deployments): derive connection ID from user-provided name

Replace random UUID generation with a sanitized version of the
connection name. Input is restricted to alphanumeric, underscore,
and space characters; spaces are converted to underscores in the ID.

* feat(deployments): prevent duplicate connection names

Disable the Create Connection button and show a validation error
when a connection with the same name (case-insensitive) already exists.

* refactor(deployments): extract page logic into custom hooks and self-contained tab components

Extract state management from the monolithic DeploymentsPage into focused
custom hooks (useDeleteWithConfirmation, useProviderFilter, useTestDeploymentModal)
and consolidate each tab's modals into its own content component, reducing the
page from 270 to 62 lines.

* fix(deployments): forward thread_id through WxO execution lifecycle

* fix(deployments): extract WxO tool call traces from actual step_history format

The parser expected tool_use/tool_result fields but WxO returns
type: "tool_calls" with tool_calls[] and type: "tool_response" —
traces were never being extracted. Rewrites extractToolTraces to
correlate calls with responses via tool_call_id, captures
agent_display_name, and makes each trace individually expandable.

* feat(deployments): refactor WXO deployment schemas and create response mapping (#12454)

* feat(deployments): add paginated deployment flow-version listing with snapshot sync
Add a new read path for listing flow versions attached to a deployment:
- introduces GET /deployments/{deployment_id}/flows with page/size pagination
- returns attachment-scoped metadata (flow_version id, flow_id, version_number, attached_at, provider_snapshot_id)
- keeps provider-owned fields under provider_data on each item
Implement snapshot-aware synchronization behavior for this list endpoint:
- loads deployment attachments from DB, extracts provider_snapshot_id values, and verifies them via adapter list_snapshots(snapshot_ids=...)
- removes stale attachment rows when snapshot IDs no longer exist on the provider
- falls back to DB-only response without enrichment on any sync failure (including partial failures after list_snapshots)
Refactor mapper boundaries to follow shape_* contract conventions:
- helper now passes through SnapshotListResult | None instead of pre-building enrichment maps
- route delegates full response shaping to mapper.shape_flow_version_list_result(...)
- base mapper performs direct DB->API mapping for flow-version list items
- WXO mapper overrides list shaping to enrich provider_data with connection_app_ids from snapshot binding.langflow.connections
Normalize WXO connection extraction into a shared read-path helper:
- add extract_langflow_connections_binding(...) in core/tools.py
- reuse it in verify_tools_by_ids and service config listing to avoid duplicated nested payload parsing
Add/adjust persistence and tests:
- add CRUD helpers for paginated attachment+flow_version join and attachment counting
- extend schema and route tests for new response models/endpoint behavior
- add mapper tests for base direct mapping and WXO-specific enrichment
- add sync tests for snapshot-id verification, stale-row cleanup, and fallback semantics

* fix(deployments): normalize wxo snapshot provider_data contracts
Validate and normalize snapshot connection payloads across mapper/service flows, and align flow-version item provider_data to use app_ids.
Add typed snapshot-item schema support in lfx and expand tests for missing/malformed snapshot provider_data behavior.

* add flow name

* return empty app_ids list instead of null

* feat(deployments): refactor WXO deployment schemas and create response mapping
Restructure the Watsonx Orchestrate deployment contracts to remove redundant connection declaration and make create responses explicit and typed.
- Remove `existing_app_ids` from API and adapter `connections` payload schemas.
- Replace shared API payload base with separate create/update models and focused validators.
- Keep validation strict (no legacy/backward-compat handling for removed fields).
- Derive provider-side `existing_app_ids` in plan builders from:
  operation app_ids - connections.raw_payloads[*].app_id
- Stop passing `existing_app_ids` through mapper payload translation.
- Add explicit create response shaping via mapper (`shape_deployment_create_result`) and route integration.
- Introduce typed create provider_data structure with `created_app_ids` and `tool_app_bindings`.
- Document and enforce `source_ref` normalization semantics:
  UUID refs map to `flow_version_id`; non-UUID refs map to `None`; empty refs error.
- Remove obsolete create-response helper path and align mapper interface signatures.
- Update unit tests and assertions to reflect the new contract and validation wording.

* improve api error logs (remove internal details and surface more informative message when an invalid field is provided

* feat(deployments): API contract updates, bug fixes, and observability improvements
BREAKING CHANGES (API):
- Move variable detection endpoint from POST /deployments/variables/detections
  to POST /variables/detections (variables router)
- Rename `reference_ids` to `flow_version_ids` in DetectVarsRequest schema
- Remove `existing_app_ids` from WXO create/update connection payloads
- Remove `resource_name_prefix` from WXO create/update payloads
- Add optional `tool_name` field to WXO bind operations
Backend:
- Rename DetectEnvVarsRequest/Response to DetectVarsRequest/Response (internal)
- Fix tool name mismatch (`name_of_raw not found in tools.raw_payloads`) during
  deployment updates by applying tool_name override and aligning
  filtered_raw_payloads with name-updated artifacts in the WXO mapper
- Fix "Missing snapshot bindings for added flow versions on update" by filtering
  out already-attached flow version IDs in the route handler before calling
  resolve_added_snapshot_bindings_for_update (stateless, DB-backed filtering)
- Switch WXO adapter core modules (retry, update, shared, create, tools) from
  stdlib logging to lfx.log.logger (structlog) for consistent log output
- Upgrade rollback log calls from info to warning level for visibility
- Add logger.exception() calls in handle_adapter_errors() for
  DeploymentServiceError, NotImplementedError, and ValueError to surface
  provider errors (e.g. validation failures) in backend logs with tracebacks
Frontend:
- Remove existingAppIds from deployment stepper context and create payload
- Move detect-env-vars hook from deployments/ to variables/ query directory
- Update step-attach-flows import path and payload field (flow_version_ids)
Tests:
- Add 15 unit tests for detect_env_vars endpoint and _derive_env_var_name helper
- Add 3 route-handler tests for already-attached flow version filtering on update
- Update WXO adapter tests: drop existing_app_ids, fix agent name assertions,
  fix mock signatures, adapt logging test for structlog

* fix: harden detect_env_vars endpoint against abuse
- Add max_length=50 on flow_version_ids to prevent resource exhaustion
- Hide /detections from OpenAPI schema (consistent with other variable routes)
- Return unresolved_ids in response so callers know which version IDs were skipped

* feat: add update agent impl (#12475)

* Allow updating an agent

ONLY allows attaching and detaching Flows.
Does NOT allow attaching / detaching connections, or editing attached
tool names.

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* remove print

* add missing files

* mypy

* Add edit flow tests

* [autofix.ci] apply automated fixes

---------

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

* refactor(deployments): trim top-level deployment API surface for WXO-first flow
- Remove unused deployment stub routes and schemas:
  - drop POST /deployments/{deployment_id}/redeploy and /duplicate handlers
  - remove DeploymentRedeployResponse and DeploymentDuplicateResponse usage
  - remove corresponding route-handler unit tests
- Simplify deployment list response contract:
  - remove deployment_type from DeploymentListResponse
  - update deployments route and base/WXO mapper list shapers to stop passing deployment_type
- Make deployment request schemas API-owned and stricter:
  - replace shared-kernel strict wrappers with DeploymentSpec / DeploymentSpecUpdate
  - remove create/update top-level config and flow-version mutation fields
    (flow_version_ids, add_flow_version_ids, remove_flow_version_ids, config)
  - tighten update validation to only accept spec and/or provider_data
- Align mapper behavior with trimmed API contracts:
  - base mapper create/update now maps spec explicitly to BaseDeploymentData/BaseDeploymentDataUpdate
  - remove base create/update handling for top-level snapshot/config/flow-version passthrough
  - make base util_create_flow_version_ids and util_flow_version_patch return empty results by default
  - update WXO mapper to use explicit spec mapping and provider_data-only operation reconciliation
  - remove WXO 422 guards tied to removed top-level config/flow-version request fields
- Remove obsolete provider_spec plumbing in adapter schema/utilities:
  - drop ProviderSpecModel and T_DeploymentSpec usage from lfx deployment schema
  - make BaseDeploymentData inherit directly from BaseModel
  - remove unused build_agent_payload helper that depended on provider_spec from WXO utils
- Update tests to reflect the trimmed contracts and current behavior:
  - remove schema tests for removed config/flow-version helper models
  - update schema compatibility tests to reject provider_spec in API deployment spec
  - update base mapper tests for new create-result shaping and provider payload validation expectations
  - remove WXO mapper tests asserting rejected top-level config/flow-version inputs
  - adjust WXO mapper naming assertions to current flow/tool naming behavior
  - update sync/service/payload formalization tests for provider_data-driven operations and provider_spec removal

* feat: add list all conns impl for wxo create deploy workflow (#12476)

* feat(deployments): list all WXO tenant connections in create workflow

- Fix backend list_configs to handle SDK Pydantic model objects (not just dicts)
- Add useGetDeploymentConfigs hook to fetch tenant connections by provider
- Seed existing connections into the attach-flows step on mount
- Add search/filter input for the available connections list
- Raise configs endpoint page size cap to 10k for large tenants

* test(deployments): add list_configs tests for Pydantic model handling

Cover the fix where SDK ConnectionsClient.list() returns Pydantic
model objects instead of dicts: pure models, mixed dicts+models,
deduplication, and non-dict/non-model skip behavior.

* add todo

* [autofix.ci] apply automated fixes

* fix(tests): update imports for removed to_deployment_create_response helper

The helper was replaced by BaseDeploymentMapper.shape_deployment_create_result
in the schema refactor (#12454). Update both test files to use the new method.

* fix(tests): remove shape_deployment_create_result from passthrough test

Method signature changed from single-arg passthrough to (result, deployment_row)
in the schema refactor (#12454). It's now tested in test_deployment_description_and_type.py.

* tests

---------

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

* refactor(deployments): normalize deployment metadata and list payload contracts
- Source `get_deployment` name/description/type/timestamps from DB deployment rows and stop injecting `resource_key` into provider payloads.
- Clarify schema docs that `resource_key` is provider-originated but Langflow-owned once persisted.
- Replace `DeploymentConfigListItem`/`DeploymentSnapshotListItem` response envelopes with paginated `provider_data` payloads in API schemas.
- Update base deployment mapper to serialize config/snapshot items directly into paginated `provider_data.configs` and `provider_data.snapshots`.
- Add WXO API payload models and validation slots for config-list and snapshot-list provider result metadata.
- Add WXO adapter payload result contracts (`WatsonxConfigListResultData`, `WatsonxSnapshotListResultData`) and register them in deployment payload schemas.
- Update WXO service list-config/list-snapshot flows to parse and emit normalized provider result metadata (tenant scope now `{}`, deployment scope includes `deployment_id` and optional `tool_ids`).
- Remove `provider_data` from `lfx` `ConfigListItem` to align with the new list response contract.
- Update mapper registration tests to assert config/snapshot payload slots are wired.
- Update route-handler tests for new provider-result expectations and add regression coverage that `resource_key` is not injected into `provider_data`.
- Rewrite deployment schema tests around provider-data-only config/snapshot list responses and field-surface checks.
- Update WXO service tests for tenant-scope provider-result normalization.
- Update `lfx` schema tests to remove obsolete config-item `provider_data` assertions.

* feat(deployments): add WXO mapper shaping for config-list and snapshot-list responses
- Add `shape_config_list_result` and `shape_snapshot_list_result` to WXO
  deployment mapper with pagination, slot validation, and HTTP 500 on
  malformed payloads.
- Add `WatsonxApiConfigListItem` and `WatsonxApiSnapshotListItem` strict
  payload models with string normalization validators.
- Wire `configs` and `snapshots` item lists into the existing
  `WatsonxApiConfigListProviderData` and `WatsonxApiSnapshotListProviderData`
  provider-data envelopes.
- Add mapper unit tests for config-list slot validation, snapshot-list
  connections extraction, and malformed-payload rejection.
- Remove obsolete `resource_name_prefix` and `connections` from
  deployment-sync update test fixture.

* feat(deployments): add provider identity to responses, nest execution endpoints under deployments
Surface provider_id and provider_key on all deployment responses so
clients can identify which provider owns a deployment without a side
lookup. Nest execution endpoints under their parent deployment path
and drop redundant deployment_id / provider_id parameters that clients
previously had to supply.
Deployment responses:
- Add provider_id (UUID) and provider_key (str) to _DeploymentResponseBase,
  propagating to DeploymentGetResponse, DeploymentCreateResponse,
  DeploymentUpdateResponse, DeploymentStatusResponse, and DeploymentListItem.
- Add provider_key parameter to BaseDeploymentMapper.shape_deployment_create_result,
  shape_deployment_update_result, and shape_deployment_list_items.
- Update WatsonxOrchestrateDeploymentMapper overrides to match.
- Update resolve_adapter_from_deployment to return (row, adapter, provider_key)
  and resolve_adapter_mapper_from_deployment to return
  (row, adapter, mapper, provider_key).
- All route handlers pass provider_key through to shape methods and
  response constructors.
Execution endpoints:
- POST /executions → POST /deployments/{deployment_id}/executions.
  deployment_id moves from the request body to the URL path.
- GET /executions/{execution_id}?deployment_id=...
  → GET /deployments/{deployment_id}/executions/{execution_id}.
  deployment_id moves from a query param to the URL path.
- Remove deployment_id from ExecutionCreateRequest schema.
- Remove unused resolve_adapter_mapper_from_provider_id import.
Tests:
- Update all mapper tests to pass provider_key and assert provider_id /
  provider_key on shaped responses.
- Update route handler mocks for new helper return tuple sizes.
- Remove deployment_id from ExecutionCreateRequest test constructions.
- Fix pre-existing broken test_deployments_response_mapping.py (was
  importing removed to_deployment_create_response helper; now uses
  BaseDeploymentMapper.shape_deployment_create_result).

* refactor(deployments): delegate conflict error messaging to provider mappers
Move provider-specific conflict formatting out of shared helpers by adding a base mapper hook and a Watsonx override, thread mapper-aware conflict formatting through adapter error handling, and add tests for mapper delegation and fallback behavior.

* refactor(deployments): rename provider-account API fields and make update identifiers immutable
- rename provider-account API fields for cleaner contracts:
  - create/get: provider_tenant_id -> tenant_id
  - create/get: provider_url -> url
  - keep provider_key and provider_data unchanged
- enforce immutable provider-account identifiers on PATCH:
  - remove tenant_id and url from DeploymentProviderAccountUpdateRequest
  - remove update-path URL allowlist validation
  - trigger update credential verification only when provider_data changes
  - limit provider-account updates to name and provider_data
- simplify mapper update behavior:
  - resolve_provider_tenant_id now uses tenant_id parameter naming
  - remove no-op WXO resolve_provider_account_update override
  - remove dead auth_utils/decrypt path in WXO update verification
- align frontend deployment-provider-account usage with new API fields:
  - POST payload now sends url
  - ProviderAccount/ProviderCredentials now use tenant_id/url
  - deployment provider UI components now read/write url consistently
- update deployment mapper rules and backend tests for new contract
- verify with targeted backend tests: 245 passed

* fix(deployments): flatten API payloads, normalize execution routes, and trim null response fields
- flatten v1 deployment API request contracts by removing nested `spec` from create/update payloads
  - create now uses top-level `name`, `description`, `type`
  - update now uses top-level `name`, `description`, `provider_data`
- update backend handlers and mapper wiring to consume top-level deployment fields end-to-end
- fix execution route paths to avoid duplicated segment:
  - `/api/v1/deployments/{deployment_id}/executions`
  - `/api/v1/deployments/{deployment_id}/executions/{execution_id}`
- align frontend execution query hooks/chat flow with deployment-id path params and remove provider-id execution params
- add response null-trimming tweaks in deployment read/list endpoints:
  - set `response_model_exclude_none=True` on deployment list route
  - set `response_model_exclude_none=True` on deployment get route
  - normalize empty/non-dict `provider_data` to `None` before shaping detail response
- tighten watsonx API mapper payload contract:
  - type `connections.raw_payloads[*].environment_variables` as `dict[EnvVarKey, EnvVarValueSpec]`
  - remove unused API-level `provider_config` field from update raw connection payload
- refresh backend/frontend tests and deployment endpoint docs to match current API shapes and routes

* feat(deployments): improve attach flow step UX in deploy modal (#12482)

- Add detach flow button in both create and edit modes
- Defer version attachment until connection step is completed (skip/attach)
- Replace radio indicators with clickable version items that auto-advance to connections
- Move tool name editing to review page with inline edit/confirm pattern
- Sort newly created connections to top of list and remove variable count display
- Add visual distinction (blue border/bg) for attached versions
- Split review page connections into "Existing" and "New" sections

* feat(deployments): add expandable rows to show attached flows (#12483)

Allow users to click the "Attached" count in the deployments table to
expand a row showing the flow names and versions. Flows are fetched
lazily via GET /deployments/{id}/flows only when the row is expanded.

* feat(deployments): replace Duplicate with Details modal (#12492)

feat(deployments): replace Duplicate action with Details modal

Replace the unused "Duplicate" action menu item with a "Details" option
that opens a read-only modal showing deployment info, attached flows,
and their connections. Data is fetched via useGetDeployment,
useGetDeploymentAttachments, and useGetDeploymentConfigs.

* feat(deployments): redesign list contracts and normalize WXO payloads
Rework deployment list and flow attachment contracts to support flow-filtered list responses and lazy flow-version lookup in the frontend deploy dialog. Normalize WXO provider payload shapes by flattening provider entries, renaming identifier fields, and tightening adapter/API validation.
- replace deployment list-item matched_attachments with conditional flow_version_ids (omitted when no flow filter is provided)
- add flow_ids support to GET /api/v1/deployments/{id}/flows and propagate it through deployment sync helpers and flow_version_deployment_attachment CRUD filters
- flatten load_from_provider deployment entries, rename provider resource_key to id, and validate WXO entries with explicit fields
- rename WXO provider_data snapshot_ids to tool_ids for provider list/config metadata payloads
- inline WXO provider list entry model_validate payload construction for cleaner mapper logic
- add deployment description max-length contract in adapter/API schemas and enforce it in deployment CRUD create/update paths
- update frontend deploy-choice dialog to a two-request flow (list deployments first, fetch /flows on selection) and align FE deployment types/query hook params
- refresh mapper/route/schema/sync/frontend tests and add dedicated CRUD tests for deployment description length validation

* Add wxo lfx req override

* feat(deployments): align WXO provider_data list and connection payload contracts
- make provider-only deployment list responses use provider_data.deployments and omit top-level deployments/pagination fields
- rename config/snapshot provider_data list keys to connections and tools, and move page/size/total into provider_data
- remove provider_data.deployment_id from config/snapshot list payload shaping
- rename API connection input fields from raw_payloads to key_value and environment_variables to credentials
- add explicit credential item model (key/value/source) with duplicate-key validation
- map API credentials list back to adapter environment_variables dict in mapper for adapter compatibility
- make shared pagination fields optional in deployment response schemas and update config-list provider_data description to "connections"
- set response_model_exclude_none on /configs and /snapshots list routes to suppress unused top-level null pagination fields
- apply formatter quote normalization in WXO config validation debug log

* feat(deployments): add connection type to config listings, enforce security_scheme, and trim leaked adapter fields
- Config list items now expose a `type` field derived from the provider's
  `security_scheme`, enabling callers to distinguish connection types
  (e.g. `key_value_creds`) without a separate lookup
- Requests that return provider_data without a valid `security_scheme`
  now fail fast with HTTP 500 instead of silently omitting the type
- Config list responses no longer leak `tool_ids` or `deployment_id` —
  these were adapter-internal fields with no frontend or API consumers
- Snapshot list responses no longer leak `deployment_id`

* feat(deployments): flatten WXO API operations into per-entity keyed fields
Replace the discriminated `operations` array with explicit per-entity
fields for better type safety and developer experience:
- Create: `add_flows` + `upsert_tools` (create-only item, no remove_app_ids)
- Update: `upsert_flows` + `upsert_tools` + `remove_flows` + `remove_tools`
Each item carries its own add/remove app-id deltas instead of relying on
op-tag dispatch. The mapper consumes the new shapes directly and produces
unchanged adapter-layer operations, eliminating all isinstance dispatch.
Also corrects FlowVersionPatch semantics: upsert_flows.remove_app_ids
now only unbinds connections without detaching the flow from the agent;
detachment is exclusively driven by remove_flows.

* feat(deployments): align watsonx create/update payloads and created-tools responses
- Add `resource_key` to deployment create/update API responses and mapper output.
- Replace API-facing `tool_app_bindings` with `created_tools` in watsonx mapper responses.
- Shape `created_tools` from created snapshot/tool refs only (not all referenced tools).
- Flatten request `provider_data.connections` from nested `connections.key_value` to a direct list.
- Add duplicate `connections.app_id` validation using Counter and update related validation messages.
- Document connection typing strategy: implicit key_value today, future type field with default.
- Add strict `flow_version_id` validation on `WatsonxApiCreatedTool`
  (accept UUID or UUID string; reject other types/invalid UUIDs).
- Update mapper/unit tests for new response contract, flattened connections, and non-UUID rejection.

* feat(wxo): tool name handling, rename support, and ownership safety (#12502)

* feat(wxo): tool name handling, rename support, and ownership safety

- Fix update_snapshot to preserve existing wxO tool name instead of
  deriving from flow name (prevents overwriting custom tool names)
- Add _validate_tool_name at API boundary with deferred validation so
  user-provided tool_name overrides aren't blocked by invalid flow names
- Add rename_tool operation (API + provider + plan + apply) with safety
  checks: tool must be on agent, must exist, must have binding.langflow
- Add verify_langflow_owned guard to all tool mutation paths (create,
  update, rename) to prevent modifying non-Langflow-managed tools
- Add WXO_LFX_REQUIREMENT_OVERRIDE env var for lfx version pinning
- Pre-seed resolved_connections from existing agent tools during update
- Surface tool_name in /flows endpoint response from wxO snapshot data
- Pre-populate tool names and connections in edit mode stepper (FE)
- Emit rename_tool operations from FE when pre-existing tool name changes
- Sort attached flows to top of flow list in edit mode (FE)
- Fix FE sending unsupported existing_app_ids field in update payload
- Add 24 backend + 6 frontend tests covering ownership checks, rename
  safety, name validation, plan building, env var override, and payloads

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* chore(wxo): trim verbose pre-seeding logs, add plan entry/exit logging

- Condense per-tool pre-seeding debug logs into a single summary line
- Add plan summary log at entry of apply_provider_create_plan_with_rollback
- Add plan summary log at entry of apply_provider_update_plan_with_rollback
- Add agent creation result log in create path

* fix(wxo): resolve mypy, ruff, and lint errors

- Fix dict[str, str] → dict[UUID, str] type annotation for
  raw_name_by_flow_version_id in mapper create/update paths (mypy)
- Move logger assignment after imports in config.py (ruff E402)
- Remove unnecessary result variable in shared.py (ruff TRY300/RET504)
- Add raise-from chain in tools.py _resolve_lfx_requirement (ruff B904)
- Hoist class aliases to module level in tests (ruff N806)

* fix(wxo): resolve mypy, ruff, and lint errors

- Fix dict[str, str] → dict[UUID, str] type annotation for
  raw_name_by_flow_version_id in mapper create/update paths (mypy)
- Use .items() for dict iteration instead of key-only loop (ruff PLC0206)
- Move logger assignment after imports in config.py (ruff E402)
- Remove unnecessary result variable in shared.py (ruff TRY300/RET504)
- Add raise-from chain in tools.py _resolve_lfx_requirement (ruff B904)
- Split long log format string in create.py (ruff E501)
- Hoist class aliases to module level in tests (ruff N806)

---------

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

* fix(deployments): allow watsonx updates without llm
Make PATCH provider_data.llm optional in the Watsonx deployment flow while preserving create-time llm requirements.
- allow missing llm in the API update payload model
- only include llm in mapper-built provider payloads when explicitly provided
- remove adapter update-schema validation that required llm for update operations
- clarify validator docs for empty/no-op provider_data handling
- update mapper/service/schema tests to accept update payloads without llm

* fix(deployments): normalize wxo config list to connection_id/app_id and fix provider_accounts naming
Align the config-list contract end-to-end so that items are keyed by
connection_id + app_id (matching the upstream SDK model) instead of
opaque id/name pairs derived from dict introspection.
Backend:
- Reshape mapper/payloads to emit connection_id/app_id/type.
- Replace loose dict/model_dump parsing with strict ListConfigsResponse
  type checks; add _build_config_list_item factory and
  _normalize_optional_text with documented SDK quirk guards.
- Enrich deployment-scope configs with security_scheme type via
  get_drafts_by_ids.
- Rename DeploymentProviderAccountListResponse.providers to
  provider_accounts for consistency with the entity name.
- Remove leftover debug print/hardcoded requirements in core/tools.
Frontend:
- Migrate DeploymentConfigItem to connection_id/app_id/type and
  unwrap provider_data.connections in the query hook.
- Access provider_accounts instead of providers on the list response.
- Add onBlur confirm for editable tool names; fix overflow/truncation
  in the connection panel.
Tests:
- Use real ListConfigsResponse SDK model in service tests.
- Add scope-shape consistency, type preservation, dict-filtering, and
  mapper contract tests.

* fix(deployments): remove stale-tool fallback in list_snapshots and log unresolved IDs
Replace the phantom-stub fallback that synthesized SnapshotItems for
agent-referenced tool IDs when get_drafts_by_ids returned no results.
Those tools were likely deleted on the provider, and returning stubs
with the ID as the name and empty connections masked stale references
and risked corrupting downstream attachment sync.
Now returns only snapshots that actually resolve from the provider and
logs a warning with the stale tool IDs for observability. Also handles
partial resolution (some tools found, some not).
Update existing test to provide real tool data and add coverage for
all-stale and partial-resolution scenarios.

* fix(deployments): fail fast on invalid wxo config entries and trust provider identifiers
Fail fast when wxO returns unexpected config-list entry types, and preserve provider-provided connection/app identifiers without local normalization or deduplication. Also narrow conflict-detail mapping for connection errors to real conflict messages and update tests to match the new behavior.

* refactor: move tenant_id from top-level into provider_data for provider accounts
tenant_id is a provider-specific concept (e.g., WXO tenant vs Azure AD
tenant vs AWS account_id) and does not have universal semantics across
deployment providers. Moving it into provider_data keeps the top-level
API surface limited to Langflow-universal fields (id, name, provider_key,
url, timestamps) and lets each provider define its own metadata shape.
API schema changes:
- DeploymentProviderAccountCreateRequest: remove top-level tenant_id
  field; tenant_id now arrives inside provider_data alongside api_key
- DeploymentProviderAccountGetResponse: remove top-level tenant_id;
  add provider_data field for non-sensitive provider metadata (e.g.
  {"tenant_id": "..."} for WXO); credentials are excluded
- DeploymentProviderAccountUpdateRequest: unchanged (already uses
  provider_data for credential rotation)
Base mapper (base.py):
- resolve_provider_tenant_id: signature changed from (provider_url,
  tenant_id) to (provider_url, provider_data); delegates to new
  resolve_provider_tenant_id_from_data() for extraction/validation
- shape_provider_account_response: now includes provider_data via new
  shape_provider_account_provider_data() method that returns non-sensitive
  metadata (tenant_id when present)
WXO mapper (watsonx_orchestrate/mapper.py):
- resolve_provider_tenant_id: updated signature; extracts tenant_id
  from provider_data first, falls back to URL extraction
- _validate_provider_data: strips mapper-owned metadata keys (tenant_id)
  before passing to WatsonxVerifyCredentialsPayload slot (extra=forbid)
- New _credential_provider_data() helper for metadata/credential separation
Route + helpers:
- deployments.py create_provider_account: passes payload.provider_data
  (not payload.tenant_id) to resolve_provider_tenant_id
- helpers.py resolve_provider_tenant_id: updated parameter from
  tenant_id to provider_data
Frontend:
- ProviderAccount type: replaced tenant_id with optional provider_data
RULES.md: updated credential flow and defense-in-depth sections to
reflect provider_data as the source for provider metadata.
Tests: updated schema, base mapper, WXO mapper, and route handler tests
to use provider_data for tenant_id. Added tests for tenant metadata
passthrough, credential field filtering, and top-level tenant_id
rejection. Fixed two pre-existing test stubs missing resource_key.
No DB model or migration changes -- provider_tenant_id column remains;
the mapper extracts it from provider_data and stores it as before.

* refactor: move url from top-level into provider_data for provider accounts
url is a provider-specific concept (e.g., WXO regional endpoint vs
future provider base URLs) and does not have universal validation
semantics at the API schema level. Moving it into provider_data keeps
the top-level API surface limited to Langflow-universal fields (id,
name, provider_key, timestamps) and lets each provider mapper own URL
validation, normalization, and allowlist enforcement.
API schema changes:
- DeploymentProviderAccountCreateRequest: remove top-level url field;
  url now arrives inside provider_data alongside api_key and tenant_id
- DeploymentProviderAccountGetResponse: remove top-level url; url is
  returned inside provider_data (e.g. {"url": "...", "tenant_id": "..."})
- Remove schema-level check_provider_url_allowed model validator;
  URL allowlist enforcement moves to the mapper layer
Base mapper (base.py):
- New validate_provider_url method using field_name= kwarg on
  validate_provider_url util (replaces synthetic ValidationInfo hack)
- New resolve_provider_account_create (abstract): provider mappers
  must override to assemble the full DB model for create
- New _guard_provider_data_for_update: shared null-guard + immutability
  check for url/tenant_id; used by both resolve_provider_account_update
  and WxO resolve_verify_credentials_for_update (eliminates duplication)
- Rename resolve_credential_fields → resolve_credentials
- Rename shape_provider_account_response → resolve_provider_account_response
- Rename shape_provider_account_provider_data →
  resolve_provider_account_provider_data; now always includes url
- DeploymentApiPayloads extended with provider_account_create/update slots
WxO mapper (watsonx_orchestrate/mapper.py):
- New _parse_create_provider_data: single parse + URL allowlist check
  shared by resolve_verify_credentials, resolve_provider_account_create,
  and validate_provider_url (eliminates triple-parse on create path)
- New resolve_provider_account_create: assembles DeploymentProviderAccount
  model with parsed url, tenant_id, api_key from provider_data
- resolve_verify_credentials_for_update: delegates immutability guard
  to _guard_provider_data_for_update instead of duplicating inline checks
WxO payloads (watsonx_orchestrate/payloads.py):
- New WatsonxApiProviderAccountCreate: url (required), tenant_id
  (optional), api_key (required), extra=forbid
- New WatsonxApiProviderAccountUpdate: api_key only, extra=forbid
  (url and tenant_id are immutable after create)
Routes (deployments.py):
- create_provider_account: delegates to resolve_provider_account_create +
  create_provider_account_from_model (no more manual kwarg assembly)
- All response shaping goes through resolve_provider_account_response
  on the mapper instance
Helpers (helpers.py):
- Remove dead resolve_provider_tenant_id and to_provider_account_response
Utils (utils.py):
- validate_provider_url accepts optional field_name kwarg for
  non-Pydantic callers; removes validate_non_empty_string dependency
CRUD (crud.py):
- New create_provider_account_from_model accepting DeploymentProviderAccount;
  shared _create_provider_account_internal implementation
Frontend:
- ProviderAccount type: remove top-level url; read from provider_data.url
  via getProviderAccountUrl helper (no backward-compat shim)
- Create payload: url moved into provider_data in request type,
  modal, and stepper context
Tests: updated schema, base mapper, WxO mapper, and route handler tests
for url-in-provider_data contract. Added immutability rejection tests
for url/tenant_id on update path. Added resolve_provider_account_create
coverage. Error expectations updated for slot-based validation (HTTPException
422 with structured messages).
No DB model or migration changes -- provider_url column remains; the
mapper extracts it from provider_data and stores it as before.

* post-merge cleanup

* refactor: tighten provider-account create and flow-version item contracts
Require tenant_id at create time for wxO provider accounts (fail-fast
via _resolve_required_provider_tenant_id), move tenant_id response
shaping to the wxO mapper override, enforce non-empty tool_name on
flow-version items, consolidate snapshot resolution into a single
_resolve_flow_version_item_data_by_snapshot_id method, and remove the
resolve_verify_credentials backward-compat alias and dead base
shape_deployment_flow_version_item_data hook.

* fix(deployments): align API payload contracts and deployment query semantics
- backend(api): remove redundant flow-id normalization helpers in deployment routes and rely on validated query params directly, while keeping mutual-exclusion and load_from_provider guards.
- backend(schema): switch flow_version_ids query typing/validation to UUID-based semantics to match flow_ids and simplify downstream filtering.
- backend(executions): preserve nullable provider execution fields by removing exclude_none in watsonx execution result shaping (service + mapper) for passthrough fidelity.
- backend(mapper): register watsonx config_item_data payload slot for explicit config-item payload validation.
- frontend(queries): move provider account url into provider_data, send flow_ids as repeatable array params, and use paramsSerializer(indexes=null) for correct repeated-key query serialization.
- frontend(types/ui): migrate deployment/provider consumers from provider_account_id/provider_url to provider_id/provider_data.url across deployments page, stepper, details modal, tables, and deploy-choice dialog.
- tests: update API query tests and deployments UI tests to match new provider payload shape, provider_id usage, and repeated flow_ids param behavior.
This aligns backend and frontend deployment contracts and keeps execution provider payloads faithful to provider responses.

* get rid of redundant strip

* harden validation for provider account responses

* refactor(deployments): clean up mapper validation, fix stale FE tests, and show env selector when empty
- backend(mapper): combine _parse_create_provider_data + _resolve_required_provider_tenant_id
  into _validate_create_provider_data; verify-credentials path now skips unnecessary tenant
  extraction by calling _parse_create_provider_data directly.
- backend(mapper): remove _guard_provider_data_for_update from base mapper; inline null check
  in resolve_provider_account_update and resolve_verify_credentials_for_update; immutable field
  rejection (url, tenant_id) now handled by WatsonxApiProviderAccountUpdate extra='forbid'.
- backend(schema): remove dead _validate_str_id_list (superseded by _validate_uuid_list).
- backend(mapper): add docstring clarifying plaintext api_key in resolve_provider_account_create.
- frontend(fix): show environment selector when providers > 1 regardless of deployment count,
  fixing catch-22 where users couldn't switch accounts when default had no deployments.
- frontend(tests): fix stale use-post-deployment test payload (spec/operations/op:bind →
  name/type/add_flows), fix providers-table and step-provider fixtures (url → provider_data.url),
  update create-mode test descriptions.
- frontend(types): tighten DeploymentFlowVersionItem.tool_name to required string; update JSDoc.
- frontend(comments): replace adapter-internal 'bind/bindings' terminology with 'attach/assignments'.

* fix(mapper): tighten user_id to UUID and remove silent falsy fallback in execution results
- Narrow resolve_provider_account_create user_id from UUID | str to UUID
  in base mapper and wxo override; callers always pass UUID.
- Remove `model_dump() or None` in shape_execution_create_result and
  shape_execution_status_result; the models have required fields so
  model_dump() never returns an empty dict — the fallback was dead code
  that would silently mask a bug.

* refactor(wxo-mapper): unify payload-slot error messaging with operation context

- mapper: replace per-callsite missing/malformed detail strings in
  `_parse_required_payload_slot` with a single `operation` parameter.
- mapper: introduce provider-aware, neutral 500 error messages that add context
  without blaming wxO vs adapter implementation.
- mapper: add `_PROVIDER_LABEL` and use it to keep error wording consistent.
- mapper: enhance `_parse_api_payload_slot` messaging to include provider context
  and field-specific 422 errors.
- mapper: update all payload-slot call sites (provider account response, create/update
  results, llm list, execution create/status, config item data) to pass operation labels.
- tests: update watsonx mapper unit tests to match the new error message patterns.

* fix: harden WXO tenant ID extraction to require terminal path segment
The tenant ID in WXO instance URLs (/instances/{tenant_id}) must be the
last path segment. Previously the extractor accepted URLs with trailing
segments (e.g. /instances/id/agents), which could silently extract the
wrong tenant from a full API endpoint URL. Updated all test fixtures to
use realistic 36-char UUID tenant IDs matching the real WXO URL format.

* add comment

* docstrings for payload validators

* clean up some stuff

* refactor: improve mapper payload slot error handling and logging
- Log slot_name on all error paths for debugging without exposing it
  in user-facing HTTP responses
- Remove unused `field` parameter from _parse_api_payload_slot (always
  "provider_data")
- Default `operation` to "this operation" in _parse_required_payload_slot
  so callers aren't forced to provide one
- Add docstrings clarifying inbound (422) vs outbound (500) roles and
  the slot_name logging convention
- Rename _parse_create_provider_data to _parse_and_check_url
- Use model_dump() in resolve_credentials instead of manual field
  extraction

* refactor: tighten deployment mapper base contracts

Remove dead tenant resolver methods from the base and WXO deployment mappers,
and make provider-specific create-path hooks in the base mapper fail fast via
NotImplementedError. Update mapper tests and deployment mapper rules docs to
match the new contract and current tenant extraction flow.

* docs correction

* tighten up filtering logic and improve docs

* fix playwright tests

---------

Co-authored-by: Viktor Avelino <viktor.avelino@gmail.com>
Co-authored-by: Viktor Avelino <64113566+viktoravelino@users.noreply.github.com>
Co-authored-by: Jordan Frazier <jordan.frazier@datastax.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jordan Frazier <122494242+jordanrfrazier@users.noreply.github.com>
2026-04-10 21:36:39 +00:00
0b6269df6e docs: policies component (#12628)
cleanup-docs-and-add-to-sidebars-and-release-note
2026-04-10 21:27:03 +00:00
f0f0681962 fix: handle read-only filesystem when updating starter project files (#12606)
* fix: handle read-only filesystem when updating starter project files (#11145)

When running Langflow in containerized environments with
readOnlyRootFilesystem: true, the update_project_file() function would
fail when trying to write updated project data back to the package
installation directory.

This fix catches OSError and logs it as debug instead of failing, since
the database is the source of truth for project data - file updates are
optional convenience for development environments.

Fixes #11145

* Update test_security_cors.py

* Revert "Update test_security_cors.py"

This reverts commit 04b3b9be49.

---------

Co-authored-by: DevByteAI <abud6673@gmail.com>
2026-04-10 20:44:09 +00:00
83f9b86d2a feat: watsonx Orchestrate deployment UI polish (#12621)
* feat: add credentials help link to deployment stepper and add-provider modal

Add a descriptive hint below the watsonx Orchestrate provider card in both
the deployment stepper and the add-provider modal, linking users to the IBM
docs to find their credentials.

* feat: add Beta badge to deployments tab and provider card

* fix: keep provider selector visible when selected provider has no deployments

The environment dropdown was hidden whenever deployments.length was 0,
stranding users on the empty state with no way to switch providers.

* feat: use watsonx Orchestrate logo in deployment provider UI

Replaces the generic Bot icon with a dedicated WatsonxOrchestrate SVG in
the deployment stepper and add-environment modal, wired through the
existing IBM icon barrel and the eager/lazy icon registries.

* fix: tighten Beta badge styling in main page header

Constrain height, padding, font size and color so the Beta badge
renders consistently alongside the tab label instead of inheriting
oversized default sizing.

* fix: rename "Deployment Providers" tab to "Deployment Environments"

Aligns the sub-tab label with the environment-centric terminology
introduced in #12551.
2026-04-10 19:58:16 +00:00
1ddea3a0ff fix(models): Stop returning 'Custom' for Azure and Watsonx LLMs (#12608) 2026-04-10 19:23:14 +00:00
fc91e392d7 fix(mcp): Preserve nested dict arguments sent to MCP tools (#12601)
* fix msg dict on mcp server

* add more test coverage

* fix on input schema

---------

Co-authored-by: Antônio Alexandre Borges Lima <104531655+AntonioABLima@users.noreply.github.com>
2026-04-10 19:22:55 +00:00
9dad1965c9 ci: add component index sync on label addition (#12590)
Add component index sync on label addition

Adds a job that attempts to sync comp index with
manual addition of label on PR
2026-04-10 17:54:08 +00:00
3077850fd5 fix: use startswith for safe path traversal and parsing (#12559)
* Fix use of path in flow helpers

* use safe startswith for path construction
2026-04-10 17:41:33 +00:00
6585fe6617 fix: Remove ddl_if from session_metadata indexes in MessageTable (#12623)
The .ddl_if(dialect="postgresql") on the session_metadata indexes
hides them from alembic's autogenerate metadata comparison. On
PostgreSQL, the migration creates the indexes in the database but
autogenerate doesn't see them in the model, so command.check()
reports remove_index operations and the app crashes on startup.

Removing ddl_if lets autogenerate see the indexes. The
postgresql_using parameter already ensures they're only created on
PostgreSQL. Verified: 1.8.1 -> 1.9.0 upgrade on PostgreSQL now
works; SQLite is unaffected.
2026-04-10 17:29:53 +00:00
678da97976 fix: allow spacebar in chat input textarea (#12612)
fix: allow spacebar in chat input textarea
2026-04-10 16:02:33 +00:00
767c18bf3a docs: flow devops toolkit SDK manage multiple environments (#12479)
* flow-devops-sdk-basic-usage

* multiple-environments
2026-04-10 15:56:53 +00:00
954bc8065d fix: Make sure we don't toggle models on hover (#12599)
* fix: Make sure we don't toggle models on hover

* Revert to switch with stop prop event

* global stopPropogation property for switches
2026-04-10 15:22:44 +00:00
e245d05f62 docs: langflow assistant feature (#12439)
* initial-content

* add-release-note

* move-page-to-flows

* fix-link-error

* table-format

* peer-review

* sidebar-title

* Apply suggestions from code review

Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>

---------

Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
2026-04-10 15:12:24 +00:00
cab9ba80da fix: Add os catch error to prevent windows failure installation on desktop on lfx lazy import (#12617) 2026-04-10 10:28:25 -03:00
296c148cbb fix: convert MCP image content to LangChain multimodal format (#12610)
* fix: convert MCP image content to LangChain multimodal format (#11812)

When an MCP tool returns content of type 'image', Langflow was passing
the raw CallToolResult object (as a Python string representation) to the
LLM instead of a proper multimodal message. This meant vision-capable
LLMs never received the actual image data in a format they could process.

Adds _convert_mcp_result() and wires it into both the async
(create_tool_coroutine) and sync (create_tool_func) execution paths.

* [autofix.ci] apply automated fixes

* test: add regression tests for _convert_mcp_result (#11812)

Covers all cases of the new helper:
- None / empty content → empty string
- Text-only → plain string (backward compat)
- Single image → image_url block list
- Mixed text + image → ordered list
- Missing mimeType → defaults to image/png
- Multiple images → all converted

* [autofix.ci] apply automated fixes

* fix: convert MCP image content to LangChain multimodal format (#11812)

Addresses reviewer feedback from PR #12610:

[P1] Move conversion out of create_tool_coroutine/create_tool_func so
mcp_component.py (line 685) still receives a raw CallToolResult via
exec_tool.coroutine() directly.

[P2] Avoid dropping structuredContent: ToolInvoker calls ainvoke
without tool_call_id and continues to receive the raw CallToolResult.
Defensive ToolMessage.artifact branch added for future-proofing.

Conversion now happens only at the LangChain tool boundary inside
MCPStructuredTool.run() / arun(), branching on tool_call_id:
- tool_call_id absent  → raw CallToolResult returned (programmatic callers)
- tool_call_id present → tool_call_id is popped before super() to prevent
  BaseTool from stringifying the result (base.py:1272/1274), then a
  ToolMessage is returned with the converted multimodal content and the
  original CallToolResult preserved as artifact.

Tests use update_tools() with a mocked stdio client to exercise the real
MCPStructuredTool class instead of a local copy. Existing TestMCPStructuredTool
fixture updated to stay in sync with the new run()/arun() logic.

* [autofix.ci] apply automated fixes

* fix: preserve unsupported MCP block types and fix ruff docstring

- _convert_mcp_result() no longer silently drops resource, resource_link,
  audio, or any unknown block types. Unsupported blocks are serialised as
  {"type": "text", "text": json.dumps(block.model_dump())} so no content
  is lost on the agent path. Falls back to str(block) when model_dump()
  is unavailable.
- Collapse-to-plain-string logic now triggers only when every block is
  plain text (not just when there are no images).
- Fix D205/D209 ruff docstring violations in test_tool_invoker.py.
- Add tests: resource-only result, mixed image+resource, unknown block
  without model_dump.

* [autofix.ci] apply automated fixes

* fix: Address lost tool call id after pop

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Eric Hare <ericrhare@gmail.com>
2026-04-09 23:32:20 +00:00
34886de048 fix: Updated Pillow minimum version (#12609)
* fix(frontend): enforce brace-expansion override

* fix: enforce handlebars version >=4.7.9 in frontend overrides

* fix: update Pillow minimum version to 12.1.1

---------

Co-authored-by: Janardan S Kavia <janardanskavia@Janardans-MacBook-Pro.local>
2026-04-09 20:32:58 +00:00
adc94310e7 fix: add message table indexes for PostgreSQL to model (#12572)
* add index to model identical to the migration ef4b036b585d

* add line

* test(alembic): remove stale message index diff suppression

The message session_metadata expression indexes are now defined in SQLModel metadata.
Remove the old Postgres-only suppression so migration checks can surface real index drift.

---------

Co-authored-by: Himavarsha <40851462+HimavarshaVS@users.noreply.github.com>
2026-04-09 19:53:32 +00:00