Skip to content

fix: apikey lock issue and add option to disable tracking#8361

Merged
italojohnny merged 3 commits into
mainfrom
fix/apikey-lock-usage-tracking
Jun 4, 2025
Merged

fix: apikey lock issue and add option to disable tracking#8361
italojohnny merged 3 commits into
mainfrom
fix/apikey-lock-usage-tracking

Conversation

@italojohnny
Copy link
Copy Markdown
Contributor

@italojohnny italojohnny commented Jun 4, 2025

Fixes a database lock issue by removing the use of asyncio.create_task when updating API key usage.
Adds the LANGFLOW_DISABLE_TRACK_APIKEY_USAGE environment variable to optionally disable usage tracking.

Default behavior is unchanged.

Summary by CodeRabbit

  • New Features

    • Added support for a new environment variable to optionally disable API key usage tracking, helping reduce database contention in high-concurrency scenarios.
  • Documentation

    • Updated environment variables documentation to include details about the new option for disabling API key usage tracking.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 4, 2025

## Walkthrough

A new environment variable, `LANGFLOW_DISABLE_TRACK_APIKEY_USAGE`, has been introduced and documented. In the API key checking logic, the update of API key usage metrics is now gated by this variable and is performed synchronously rather than as a background task. No public APIs or signatures were changed.

## Changes

| File(s)                                                      | Change Summary                                                                                      |
|--------------------------------------------------------------|---------------------------------------------------------------------------------------------------|
| docs/docs/Configuration/environment-variables.md             | Documented the new `LANGFLOW_DISABLE_TRACK_APIKEY_USAGE` environment variable and its behavior.    |
| src/backend/base/langflow/services/settings/base.py          | Added `disable_track_apikey_usage` boolean field to `Settings` class with default `False`.         |
| src/backend/base/langflow/services/database/models/api_key/crud.py | Removed async task usage; added conditional synchronous awaited update of API key usage metrics based on setting. |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant Client
    participant API
    participant Database

    Client->>API: Send request with API key
    API->>API: Check LANGFLOW_DISABLE_TRACK_APIKEY_USAGE
    alt Tracking enabled
        API->>Database: Update API key usage metrics (awaited)
    else Tracking disabled
        API-->>Database: Skip usage metrics update
    end
    API-->>Client: Respond to request

<!-- walkthrough_end -->


---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between f7cb0018bf07cf694ff4d75f9d5aebb65d82b4d9 and 58cb1b28ca1b1e16a5cd9c2e813cb60d56759b3f.

</details>

<details>
<summary>📒 Files selected for processing (2)</summary>

* `src/backend/base/langflow/services/database/models/api_key/crud.py` (2 hunks)
* `src/backend/base/langflow/services/settings/base.py` (1 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (2)</summary>

* src/backend/base/langflow/services/settings/base.py
* src/backend/base/langflow/services/database/models/api_key/crud.py

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (1)</summary>

* GitHub Check: Optimize new Python code in this PR

</details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNwSPbABsvkCiQBHbGlcSHFcLzpIACIAM3gADy40bngAaxJ5L3wGNJREBw9MejRaenxucXwsAkhaJBVIsKpc+AwiABpo+2wBZnUaejlIbERKFFw0bKF8WAwMeTRkW0gMRwFxgA4AZgA2AEYO9DL/AukwgHd8SGZtLAZYTFJEDUgAMXgKRFwj9Uh4hLnNB1agqJYebK5fKFSDDfzMfASNpEMKwDyjDz4WKQAAGS1kGAY8HwGgY/moJAA+pNEGkcZALmisNhuLRqMjIABBKwASUgGXkozQpFeAGVRNVaL9Qm1cBRFNgGEDViQLpAyEj5Rg2BhQhJnPBGiQjjiADKcgByAHE3qaAPIAdUpABEeaLOQAhU0AUUp0BsnIAwgBpSncnnB70ATUpAFV3VbvTijoz4A90D58BdkBivmFrhU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bG0CUYELsNjtA1MCG83RkTOGICQFU7Z/YAhFObDXEl/YJB9jmbYwwbjDBlObF07Z0zbHdi+bo1R7E2GYO/vUAhpDKGSDbiJu9cCImgA=== -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---



<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=langflow-ai/langflow&utm_content=8361):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Jun 4, 2025
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jun 4, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2025

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

@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jun 4, 2025
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9aaca68 and d7a7048.

📒 Files selected for processing (2)
  • docs/docs/Configuration/environment-variables.md (1 hunks)
  • src/backend/base/langflow/services/database/models/api_key/crud.py (2 hunks)
🧰 Additional context used
🪛 Pylint (3.3.7)
src/backend/base/langflow/services/database/models/api_key/crud.py

[convention] 1-1: Missing module docstring

(C0114)

🪛 GitHub Check: Ruff Style Check (3.13)
src/backend/base/langflow/services/database/models/api_key/crud.py

[failure] 1-14: Ruff (I001)
src/backend/base/langflow/services/database/models/api_key/crud.py:1:1: I001 Import block is un-sorted or un-formatted

🪛 GitHub Actions: Ruff Style Check
src/backend/base/langflow/services/database/models/api_key/crud.py

[error] 1-1: Ruff: Import block is un-sorted or un-formatted (I001)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Optimize new Python code in this PR
  • GitHub Check: Update Starter Projects
🔇 Additional comments (2)
src/backend/base/langflow/services/database/models/api_key/crud.py (1)

59-60: LGTM! Environment variable logic and synchronous fix are correct.

The implementation correctly:

  • Checks the environment variable with proper default and case-insensitive comparison
  • Fixes the database lock issue by using synchronous await instead of asyncio.create_task
  • Preserves backward compatibility with tracking enabled by default

Note that this change may slightly increase API response times since validation now waits for the database update to complete, but this trade-off resolves the database contention issue under high concurrency.

docs/docs/Configuration/environment-variables.md (1)

194-194: Excellent documentation for the new environment variable.

The documentation is clear, accurate, and properly formatted. It correctly describes:

  • The variable type and default value
  • The specific functionality it controls (total_uses and last_used_at tracking)
  • The use case (avoiding database contention under high concurrency)

This aligns perfectly with the code implementation in the crud.py file.

Comment thread src/backend/base/langflow/services/database/models/api_key/crud.py Outdated
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jun 4, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2025

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

@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jun 4, 2025
Copy link
Copy Markdown
Collaborator

@mendonk mendonk left a comment

Choose a reason for hiding this comment

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

Approving for docs, thank you @italojohnny

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jun 4, 2025
Comment thread src/backend/base/langflow/services/database/models/api_key/crud.py Outdated
@dosubot dosubot Bot removed the lgtm This PR has been approved by a maintainer label Jun 4, 2025
@italojohnny italojohnny requested a review from ogabrielluiz June 4, 2025 13:00
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jun 4, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2025

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

@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jun 4, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2025

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 78e0361 and f7cb001.

📒 Files selected for processing (2)
  • src/backend/base/langflow/services/database/models/api_key/crud.py (2 hunks)
  • src/backend/base/langflow/services/settings/base.py (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/backend/base/langflow/services/settings/base.py
🧰 Additional context used
🪛 Ruff (0.11.9)
src/backend/base/langflow/services/database/models/api_key/crud.py

58-58: Avoid inequality comparisons to True; use if not ...: for false checks

Replace comparison

(E712)

🪛 Pylint (3.3.7)
src/backend/base/langflow/services/database/models/api_key/crud.py

[convention] 58-58: Comparison 'settings_service.settings.disable_track_apikey_usage != True' should be 'settings_service.settings.disable_track_apikey_usage is not True' if checking for the singleton value True, or 'not settings_service.settings.disable_track_apikey_usage' if testing for falsiness

(C0121)

🪛 GitHub Check: Ruff Style Check (3.13)
src/backend/base/langflow/services/database/models/api_key/crud.py

[failure] 58-58: Ruff (E712)
src/backend/base/langflow/services/database/models/api_key/crud.py:58:12: E712 Avoid inequality comparisons to True; use if not ...: for false checks

🪛 GitHub Actions: Ruff Style Check
src/backend/base/langflow/services/database/models/api_key/crud.py

[error] 58-58: Ruff E712: Avoid inequality comparisons to True; use if not ...: for false checks.

🔇 Additional comments (1)
src/backend/base/langflow/services/database/models/api_key/crud.py (1)

12-12: LGTM!

The import of get_settings_service is correctly added to support the new conditional tracking functionality.

Comment on lines +57 to +59
settings_service = get_settings_service()
if settings_service.settings.disable_track_apikey_usage != True:
await update_total_uses(api_key_object.id)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix the boolean comparison style to resolve pipeline failure.

The logic correctly implements conditional API key usage tracking, but the boolean comparison violates Python style conventions and is causing pipeline failures.

Apply this diff to fix the style issue:

-        if settings_service.settings.disable_track_apikey_usage != True:
+        if not settings_service.settings.disable_track_apikey_usage:

Note on performance: The change from async fire-and-forget tasks to synchronous awaited calls addresses the database lock issue but may impact response times since API key validation now waits for usage tracking to complete.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
settings_service = get_settings_service()
if settings_service.settings.disable_track_apikey_usage != True:
await update_total_uses(api_key_object.id)
settings_service = get_settings_service()
if not settings_service.settings.disable_track_apikey_usage:
await update_total_uses(api_key_object.id)
🧰 Tools
🪛 Ruff (0.11.9)

58-58: Avoid inequality comparisons to True; use if not ...: for false checks

Replace comparison

(E712)

🪛 Pylint (3.3.7)

[convention] 58-58: Comparison 'settings_service.settings.disable_track_apikey_usage != True' should be 'settings_service.settings.disable_track_apikey_usage is not True' if checking for the singleton value True, or 'not settings_service.settings.disable_track_apikey_usage' if testing for falsiness

(C0121)

🪛 GitHub Check: Ruff Style Check (3.13)

[failure] 58-58: Ruff (E712)
src/backend/base/langflow/services/database/models/api_key/crud.py:58:12: E712 Avoid inequality comparisons to True; use if not ...: for false checks

🪛 GitHub Actions: Ruff Style Check

[error] 58-58: Ruff E712: Avoid inequality comparisons to True; use if not ...: for false checks.

🤖 Prompt for AI Agents
In src/backend/base/langflow/services/database/models/api_key/crud.py around
lines 57 to 59, the boolean comparison uses '!= True', which violates Python
style conventions and causes pipeline failures. Replace the condition
'settings_service.settings.disable_track_apikey_usage != True' with 'not
settings_service.settings.disable_track_apikey_usage' to fix the style issue.
Also, ensure that the call to update_total_uses is properly awaited to handle
the database lock issue, accepting the potential impact on response times.

@italojohnny italojohnny force-pushed the fix/apikey-lock-usage-tracking branch from f7cb001 to 58cb1b2 Compare June 4, 2025 14:05
@italojohnny italojohnny removed the request for review from cbornet June 4, 2025 14:06
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jun 4, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2025

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

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jun 4, 2025
@italojohnny italojohnny added this pull request to the merge queue Jun 4, 2025
Merged via the queue into main with commit 227a091 Jun 4, 2025
43 of 45 checks passed
@italojohnny italojohnny deleted the fix/apikey-lock-usage-tracking branch June 4, 2025 17:31
ogabrielluiz pushed a commit that referenced this pull request Jun 5, 2025
* fix(api-key): avoid row-level locks by disabling usage tracking

* [autofix.ci] apply automated fixes

* chore: move parameter handling to settings service

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
ogabrielluiz pushed a commit that referenced this pull request Jun 5, 2025
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
fix: apikey lock issue and add option to disable tracking (#8361)
ogabrielluiz pushed a commit that referenced this pull request Jun 9, 2025
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
fix: apikey lock issue and add option to disable tracking (#8361)
ogabrielluiz pushed a commit that referenced this pull request Jun 9, 2025
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
fix: apikey lock issue and add option to disable tracking (#8361)
ogabrielluiz pushed a commit that referenced this pull request Jun 10, 2025
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
fix: apikey lock issue and add option to disable tracking (#8361)
github-merge-queue Bot pushed a commit that referenced this pull request Jun 11, 2025
…nnections settings page (#8388)

* Added mcpinput to the backend

* Fixed list selection component to contain descriptions

* Added mcp component in the frontend with mock values

* Added mcp rendering on Parameter Render Component

* Changed input to be more concise and to have dynamic placeholder

* Added header search placeholder

* Fixed styling to match new input

* Removed unused params

* Adds AddMcpServerModal's first mock version

* Adds Add button on mcp component and list selection component

* First pass at mcp api

* Add PATCH endpoint

* Add DELETE endpoint

* fix: Bump version numbers for langflow and langflow-base to 1.4.3 and 0.4.3 respectively

* fix: Remove Igor Carvalho from maintainers list in pyproject.toml

* fix(agent): reset model list when provider changes

Switching the provider in the Agent component sometimes left models from
the previous provider visible/selected.
We now filter  against the new , ensuring only
models that belong to the active provider remain.

* src/frontend/src/components/core/dropdownComponent/index.tsx
  – add  guard when rebuilding

* tests/extended/regression/general-bugs-dropdown-select-not-in-list.spec.ts
  – expand coverage for “model not in list” edge-cases

Co-authored-by: Cristian Lousa <cristian.lousa@gmail.com>

* fix: Update Pokédex Agent template (#8373)

* Implement adding and getting MCP servers, implemented addMcpServerModal

* Added sse and stdio ways of adding a server

* Added no actions handling

* added new mcp type to constants

* Added headers to add mcp server modal

* Changed mcp component to allow persistent mcp servers

* fix input list component gradient

* fix add server modal to patch when initial data is present, and to clean variables when switching tabs

* changed message on add mcp server

* Added required mutations for mcp page

* Added mcp servers page

* Changed design of page

* Fixed delete problems and added delete confirmation

* fixed wrong error parsing

* changed padding

* Made added server be used on mcp component

* refactor: remove references to the langflow store (#8354)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
fix: apikey lock issue and add option to disable tracking (#8361)

* Fixed search on sidebar

* fixed infinite use effect

* Fixed error handling

* Fixed tool mode disappearing

* fixed key pair button submitting form

* Fixed bugs

* Added required

* Changed message

* Disabled other tabs when modifying

* Removed tool dropdown if the mcp server is empty

* parsed name

* fixed data test id not applying

* fixed mcp component

* Fixed component not working when only stdio command is present

* refactored tests

* Updated mcp_component to remove old non default keys

* Added data-testids

* Modified tests to include settings page functionality

* [autofix.ci] apply automated fixes

* Refactor out the core part of the mcp

* [autofix.ci] apply automated fixes

* Added placeholders on frontend components for errors

* Fixed bugs with mcp component

* updated bug

* fix: made empty project appear instead of empty flows list when mcp is enabled (#8336)

* try to fix

* Fix MCP persistence

* Update mcp_component.py

* Update mcp.py

* [autofix.ci] apply automated fixes

* fix: Bump version numbers for langflow and langflow-base to 1.4.3 and 0.4.3 respectively

* fix: Remove Igor Carvalho from maintainers list in pyproject.toml

* fix(agent): reset model list when provider changes

Switching the provider in the Agent component sometimes left models from
the previous provider visible/selected.
We now filter  against the new , ensuring only
models that belong to the active provider remain.

* src/frontend/src/components/core/dropdownComponent/index.tsx
  – add  guard when rebuilding

* tests/extended/regression/general-bugs-dropdown-select-not-in-list.spec.ts
  – expand coverage for “model not in list” edge-cases

Co-authored-by: Cristian Lousa <cristian.lousa@gmail.com>

* refactor: remove references to the langflow store (#8354)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
fix: apikey lock issue and add option to disable tracking (#8361)

* fix: made empty project appear instead of empty flows list when mcp is enabled (#8336)

* fix mcp client async problems

* fixed mcp sse access

* [autofix.ci] apply automated fixes

* Made values be maintained when refreshing page

* Fixed bugs with tool mode and switching from tool mode to not tool mode

* Update mcp_component.py

* Update test_mcp_component.py

* Don't expose file by name as external endpoint

* Update files.py

* Update files.py

* Add checks for id

* Refactor tests

* Update test_mcp_component.py

* Update test_mcp_component.py

* Update test_mcp_component.py

* updated tests

* re-added placeholder on input for tests to not fail

* updated session selector in order for tests to work

---------

Co-authored-by: Eric Hare <ericrhare@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Mike Fortman <michael.fortman@datastax.com>
Co-authored-by: Cristian Lousa <cristian.lousa@gmail.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Deon Sanchez <69873175+deon-sanchez@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
ogabrielluiz pushed a commit to bkatya2001/langflow that referenced this pull request Jun 24, 2025
…i#8361)

* fix(api-key): avoid row-level locks by disabling usage tracking

* [autofix.ci] apply automated fixes

* chore: move parameter handling to settings service

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
ogabrielluiz added a commit to bkatya2001/langflow that referenced this pull request Jun 24, 2025
…nnections settings page (langflow-ai#8388)

* Added mcpinput to the backend

* Fixed list selection component to contain descriptions

* Added mcp component in the frontend with mock values

* Added mcp rendering on Parameter Render Component

* Changed input to be more concise and to have dynamic placeholder

* Added header search placeholder

* Fixed styling to match new input

* Removed unused params

* Adds AddMcpServerModal's first mock version

* Adds Add button on mcp component and list selection component

* First pass at mcp api

* Add PATCH endpoint

* Add DELETE endpoint

* fix: Bump version numbers for langflow and langflow-base to 1.4.3 and 0.4.3 respectively

* fix: Remove Igor Carvalho from maintainers list in pyproject.toml

* fix(agent): reset model list when provider changes

Switching the provider in the Agent component sometimes left models from
the previous provider visible/selected.
We now filter  against the new , ensuring only
models that belong to the active provider remain.

* src/frontend/src/components/core/dropdownComponent/index.tsx
  – add  guard when rebuilding

* tests/extended/regression/general-bugs-dropdown-select-not-in-list.spec.ts
  – expand coverage for “model not in list” edge-cases

Co-authored-by: Cristian Lousa <cristian.lousa@gmail.com>

* fix: Update Pokédex Agent template (langflow-ai#8373)

* Implement adding and getting MCP servers, implemented addMcpServerModal

* Added sse and stdio ways of adding a server

* Added no actions handling

* added new mcp type to constants

* Added headers to add mcp server modal

* Changed mcp component to allow persistent mcp servers

* fix input list component gradient

* fix add server modal to patch when initial data is present, and to clean variables when switching tabs

* changed message on add mcp server

* Added required mutations for mcp page

* Added mcp servers page

* Changed design of page

* Fixed delete problems and added delete confirmation

* fixed wrong error parsing

* changed padding

* Made added server be used on mcp component

* refactor: remove references to the langflow store (langflow-ai#8354)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
fix: apikey lock issue and add option to disable tracking (langflow-ai#8361)

* Fixed search on sidebar

* fixed infinite use effect

* Fixed error handling

* Fixed tool mode disappearing

* fixed key pair button submitting form

* Fixed bugs

* Added required

* Changed message

* Disabled other tabs when modifying

* Removed tool dropdown if the mcp server is empty

* parsed name

* fixed data test id not applying

* fixed mcp component

* Fixed component not working when only stdio command is present

* refactored tests

* Updated mcp_component to remove old non default keys

* Added data-testids

* Modified tests to include settings page functionality

* [autofix.ci] apply automated fixes

* Refactor out the core part of the mcp

* [autofix.ci] apply automated fixes

* Added placeholders on frontend components for errors

* Fixed bugs with mcp component

* updated bug

* fix: made empty project appear instead of empty flows list when mcp is enabled (langflow-ai#8336)

* try to fix

* Fix MCP persistence

* Update mcp_component.py

* Update mcp.py

* [autofix.ci] apply automated fixes

* fix: Bump version numbers for langflow and langflow-base to 1.4.3 and 0.4.3 respectively

* fix: Remove Igor Carvalho from maintainers list in pyproject.toml

* fix(agent): reset model list when provider changes

Switching the provider in the Agent component sometimes left models from
the previous provider visible/selected.
We now filter  against the new , ensuring only
models that belong to the active provider remain.

* src/frontend/src/components/core/dropdownComponent/index.tsx
  – add  guard when rebuilding

* tests/extended/regression/general-bugs-dropdown-select-not-in-list.spec.ts
  – expand coverage for “model not in list” edge-cases

Co-authored-by: Cristian Lousa <cristian.lousa@gmail.com>

* refactor: remove references to the langflow store (langflow-ai#8354)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
fix: apikey lock issue and add option to disable tracking (langflow-ai#8361)

* fix: made empty project appear instead of empty flows list when mcp is enabled (langflow-ai#8336)

* fix mcp client async problems

* fixed mcp sse access

* [autofix.ci] apply automated fixes

* Made values be maintained when refreshing page

* Fixed bugs with tool mode and switching from tool mode to not tool mode

* Update mcp_component.py

* Update test_mcp_component.py

* Don't expose file by name as external endpoint

* Update files.py

* Update files.py

* Add checks for id

* Refactor tests

* Update test_mcp_component.py

* Update test_mcp_component.py

* Update test_mcp_component.py

* updated tests

* re-added placeholder on input for tests to not fail

* updated session selector in order for tests to work

---------

Co-authored-by: Eric Hare <ericrhare@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Mike Fortman <michael.fortman@datastax.com>
Co-authored-by: Cristian Lousa <cristian.lousa@gmail.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Deon Sanchez <69873175+deon-sanchez@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants