Conversation
Introduces Lightning.Channels.SearchParams, an embedded schema that parses and validates channel request filter params from URL query strings. Adds list_channel_requests/3 to the Channels context, returning a paginated Scrivener.Page of ChannelRequest structs with :channel and filtered :channel_events preloaded (source_received and error types only).
Adds a paginated Channel Requests page at /projects/:id/channels/requests with a changeset-backed channel filter dropdown. The page uses SearchParams and list_channel_requests/3 from the Channels context to display request ID, path, channel name, started-at timestamp, status badge, and error message. Also adds a "Channel Requests" nav item in the sidebar (experimental features only) and converts the Requests count and Last Activity cells on the Channels CRUD page into links that navigate to the requests page pre-filtered to that channel.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## channels #4471 +/- ##
============================================
+ Coverage 89.42% 89.52% +0.09%
============================================
Files 425 441 +16
Lines 20221 20868 +647
============================================
+ Hits 18083 18682 +599
- Misses 2138 2186 +48 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Previously these env vars only took effect in production. In dev/test the endpoint URL was hardcoded by config/*.exs, making it impossible to configure via env vars in dev containers (e.g. dev-elixir.local:4000). Move the unified URL config (host, port, scheme) before the prod block so it applies in all environments, with sensible per-env defaults.
Previously, invalid credentials returned 404 while missing credentials returned 401. This was inconsistent and leaked resource existence via the 401 anyway. Simplify authenticate_source into a single function.
The events preload and helper were filtering for :source_received events which are never created — the handler only writes :sink_response or :error events. Also remove em dash fallbacks for empty values.
* support batched logs * Introduce another event run:batch_logs for batch logs * update changelog * refactor to make credo happy --------- Co-authored-by: Frank Midigo <midigofrank@gmail.com>
* fix: store follow_run_id on message meta so logs reach Apollo (#4380) follow_run_id was only stored in session meta during channel JOIN. When a user created a session without a run selected and later picked one, the backend silently dropped follow_run_id from new_message params, so maybe_add_run_logs never found it and context.log was null. Now follow_run_id is stored per-message on message meta (same pattern as unsaved_job), and the Oban worker propagates it to the in-memory session before enrichment. * test: add regression tests for follow_run_id propagation (#4380) Add tests to prevent regression of the bug where logs weren't sent to Apollo when users selected a run mid-session. Tests verify that follow_run_id is properly stored in message.meta and propagated during message processing for log enrichment. * updates changelog * test: fix failing follow_run_id regression test (#4380) The regression test added in 5a22a97 had three setup issues: - Missing workflow and project in test context - Missing required dataclip for run creation - Message lookup found first user message instead of the specific message with follow_run_id Fix by using workflow/project from context, creating a dataclip, and finding the message by content to get the correct one. --------- Co-authored-by: Elias W. BA <eliaswalyba@gmail.com>
The run claim polling generates heavy Ecto debug output in development. Add a LOG_QUEUE_QUERIES env var (default: false) that controls whether queue claim queries are logged, threading the value through all SQL calls in Runs.Queue.
- source_event_path now queries :sink_response events (not :source_received) - Dash placeholder test updated since template renders nil instead of em-dashes
AI assistant tests were leaking error-level log messages into unrelated test output during concurrent async execution. The MessageProcessor Oban worker and AiAssistant module log errors when AI queries fail (e.g. "AI query failed for session", "[MessageProcessor] Failed to process message"), and with Oban configured as `testing: :inline`, these jobs execute synchronously within the test process. While many individual tests had `@tag :capture_log`, this only captures logs from the tagged test's own process. Logs from spawned processes or PubSub callbacks could escape capture and appear in the output of completely unrelated tests running concurrently — such as channel request LiveView tests that have nothing to do with AI. Adding `@moduletag :capture_log` at the module level ensures all logs from every test in these files are captured, preventing cross-test log contamination. Only ai_assistant_test.exs already had this tag.
Move the inline tab switcher styling into a new TabBar component (LightningWeb.Components.TabBar) with a pill_tabs/1 function component. Matches the React Tabs.tsx visual style with slate background and indigo active state. Includes unit tests for rendering, active state styling, patch paths, and multi-tab support.
channel_snapshots.channel_id used on_delete: :restrict which blocked project purging when channels had snapshots. Changed to :delete_all to match the workflow_snapshots pattern.
Move channel request logs from a standalone page to a tab within the History page. Adds ChannelLogsComponent as a live_component with filtering and pagination, a new /history/channels route, and updates links in the channel index to point to the new location.
Remove the separate ChannelRequestLive page and its nav menu item, now that channel request logs are accessible via the History page tab.
- Add @moduledoc to TabBar component - Reorder import before alias in ChannelLive modules - Remove obsolete foreign_key_constraint on channel_snapshots - Replace snapshot deletion error test with cascade delete assertion
The list_channel_requests query correctly filters to :sink_response and :error, but the docstring and test referenced :source_received. Since :source_received and :sink_request are never emitted by production code, remove them from the migration enum, Ecto schema, and test factory.
…T LOCAL
Replace string interpolation in SET LOCAL work_mem with PostgreSQL's
set_config() function and a bind parameter. SET LOCAL doesn't support
$1 placeholders, but set_config('work_mem', $1, true) is equivalent
and eliminates the SQL injection surface.
Guard update/2 to only re-fetch channel requests when params have actually changed. Use assign_new for the channels list so it's only fetched once per component lifecycle.
Split state_pill into a shared base_pill (outer styling) and domain-specific components. Add channel_state_pill with correct mappings for channel request states — notably :pending displays as "In Progress" (blue) instead of "Enqueued" (gray).
Replace the blanket handle_info(_event, socket) with a clause that explicitly matches the four known PubSub events (RunCreated, RunUpdated, WorkOrderCreated, WorkOrderUpdated) on the channel_logs tab, preventing silent swallowing of unexpected messages.
Place CORSPlug before Plug.Telemetry so CORS preflight (OPTIONS) requests are halted before the telemetry span opens, keeping them out of endpoint duration metrics. Channel proxy and webhook requests remain fully captured within the span.
stuartc
approved these changes
Mar 5, 2026
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.
Description
Closes #4408
Validation steps
AI Usage
Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):
You can read more details in our
Responsible AI Policy
Pre-submission checklist
/reviewwith Claude Code)
(e.g.,
:owner,:admin,:editor,:viewer)