Skip to content

fix: check ollama url by probing Langflow validate#1099

Merged
lucaseduoli merged 13 commits into
mainfrom
fix/ollama_checks
Mar 15, 2026
Merged

fix: check ollama url by probing Langflow validate#1099
lucaseduoli merged 13 commits into
mainfrom
fix/ollama_checks

Conversation

@lucaseduoli

Copy link
Copy Markdown
Collaborator

This pull request introduces significant improvements to how Ollama endpoints are resolved and passed as global variables to Langflow and MCP services, ensuring more reliable container-to-container connectivity. The main theme is replacing static localhost transformations with dynamic endpoint resolution using the new FlowsService.resolve_ollama_url method. The changes also update several service constructors to accept a flows_service instance, enabling consistent endpoint resolution across the codebase.

Ollama endpoint resolution improvements:

  • Added FlowsService.resolve_ollama_url, which dynamically probes candidate container hosts and caches the resolved Ollama endpoint for improved reliability when running in containerized environments.
  • Updated transform_localhost_url in utils/container_utils.py to simplify its logic and remove container-specific arguments, delegating advanced resolution to FlowsService.
  • The Ollama endpoint is now resolved using FlowsService.resolve_ollama_url in global variable updates, MCP server updates, and header construction, replacing the previous static transformation. [1] [2]

Service constructor and dependency updates:

  • Modified constructors for ChatService and LangflowFileService to accept an optional flows_service parameter, enabling them to use the new dynamic endpoint resolution. [1] [2]
  • Updated initialize_services in main.py to instantiate and pass flows_service to dependent services, ensuring consistent endpoint resolution throughout the application.

Global variable and credential propagation:

  • Changed all relevant update and onboarding functions to accept and propagate flows_service, ensuring Ollama endpoint resolution is performed consistently whenever global variables or provider credentials are set. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

Configuration enhancements:

  • Added a resolved_endpoint field to the OllamaConfig class to cache the resolved Ollama endpoint, reducing redundant network probing and improving performance.

These changes collectively make Ollama connectivity more robust and maintainable, especially in containerized deployments, by centralizing and automating endpoint resolution logic.

@lucaseduoli lucaseduoli self-assigned this Mar 11, 2026
@github-actions github-actions Bot added backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) bug 🔴 Something isn't working. labels Mar 11, 2026
Comment thread src/services/flows_service.py Outdated
Comment thread src/utils/container_utils.py
Comment thread src/utils/container_utils.py Outdated
@github-actions github-actions Bot added frontend 🟨 Issues related to the UI/UX bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Mar 13, 2026
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Mar 13, 2026
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Mar 13, 2026
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Mar 13, 2026

@ricofurtado ricofurtado left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Minor things.

Comment thread src/services/chat_service.py Outdated
Comment thread src/services/chat_service.py Outdated
Comment thread src/utils/langflow_headers.py
Comment thread src/utils/langflow_headers.py
Comment thread src/services/flows_service.py

@mpawlow mpawlow left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@lucaseduoli

Code Review 1

  • LGTM / Approved (conditional)
  • See PR comment: (1a)

@github-actions github-actions Bot added the lgtm label Mar 14, 2026
@github-actions github-actions Bot removed the bug 🔴 Something isn't working. label Mar 14, 2026
@github-actions github-actions Bot added the bug 🔴 Something isn't working. label Mar 14, 2026
@lucaseduoli lucaseduoli requested a review from ricofurtado March 14, 2026 01:07

@ricofurtado ricofurtado left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looking good for me.

@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Mar 14, 2026
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Mar 14, 2026
@github-actions github-actions Bot added docker bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Mar 15, 2026
@lucaseduoli lucaseduoli merged commit 9ab663e into main Mar 15, 2026
10 of 11 checks passed
@github-actions github-actions Bot deleted the fix/ollama_checks branch March 15, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend 🔷 Issues related to backend services (OpenSearch, Langflow, APIs) bug 🔴 Something isn't working. docker frontend 🟨 Issues related to the UI/UX lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants