fix(ui): Add array validation for provider variables mapping#12031
Closed
Cristhianzl wants to merge 7 commits into
Closed
fix(ui): Add array validation for provider variables mapping#12031Cristhianzl wants to merge 7 commits into
Cristhianzl wants to merge 7 commits into
Conversation
Contributor
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (104)
WalkthroughThis PR introduces comprehensive native tracing support to Langflow, enabling collection and visualization of execution traces directly in the database. It includes database schema migrations, new API endpoints for trace management, backend tracing services with formatting and repository layers, and an extensive frontend UI for traces with tree visualization, filtering, and detail panels. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client (Frontend)
participant API as API (traces.py)
participant Repo as Repository
participant DB as Database
participant Cache as ORM Cache
Client->>API: GET /monitor/traces?flow_id=X&page=1
activate API
API->>Repo: fetch_traces(user_id, flow_id, page, size)
activate Repo
Repo->>DB: Query traces with filters
activate DB
DB-->>Cache: Load TraceTable + spans
Cache-->>DB: Returns rows
DB-->>Repo: Trace + span rows
deactivate DB
Repo->>Repo: build_span_tree(spans)
Repo->>Repo: compute_leaf_token_total()
Repo->>Repo: extract_trace_io_from_spans()
Repo-->>API: TraceListResponse
deactivate Repo
API->>API: Validate authorization
API-->>Client: 200 + traces list
deactivate API
Client->>API: GET /monitor/traces/{trace_id}
activate API
API->>Repo: fetch_single_trace(user_id, trace_id)
activate Repo
Repo->>DB: Query trace + spans
DB-->>Repo: Loaded data
Repo->>Repo: build_span_tree(spans)
Repo-->>API: TraceRead (with span tree)
deactivate Repo
API-->>Client: 200 + trace detail
deactivate API
sequenceDiagram
participant Flow as Flow Execution
participant Tracer as NativeTracer
participant Memory as In-Memory State
participant LangChain as LangChain Callback
participant Queue as Async Queue
participant DB as Database
Flow->>Tracer: add_trace(component_name, inputs)
activate Tracer
Tracer->>Memory: Store span metadata
Tracer->>Memory: Set current component context
deactivate Tracer
opt LangChain Integration
LangChain->>Tracer: get_langchain_callback()
activate Tracer
Tracer->>LangChain: Return NativeCallbackHandler
deactivate Tracer
LangChain->>Tracer: on_llm_start(), on_llm_end()
activate Tracer
Tracer->>Memory: add/end_langchain_span()
deactivate Tracer
end
Flow->>Tracer: end_trace(outputs, error)
activate Tracer
Tracer->>Memory: Move span to completed_spans
deactivate Tracer
Flow->>Tracer: end()
activate Tracer
Tracer->>Queue: Schedule async flush
Tracer-->>Flow: Acknowledged
deactivate Tracer
Queue->>Tracer: _flush_to_database()
activate Tracer
Tracer->>DB: Compute total tokens
Tracer->>DB: Insert trace record
Tracer->>DB: Insert all spans
Tracer->>Memory: Clear completed_spans
DB-->>Tracer: Success
deactivate Tracer
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches
🧪 Generate unit tests (beta)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Prevent runtime errors when providerVariablesMapping returns a non-array value for a provider name.
Changes
Summary by CodeRabbit
Release Notes
New Features
Improvements