From 4a10c322185cd604997ca4cbf563064a99f351fb Mon Sep 17 00:00:00 2001 From: dradis-bot <286253174+dradis-bot@users.noreply.github.com> Date: Thu, 16 Jul 2026 08:39:39 +0100 Subject: [PATCH 1/4] Echo: retire the legacy Roslin one-shot interaction path Slice 5 repurposed InteractionsController#index/#preview into the sessions landing, leaving #create/#show and InteractionJob as the last remnants of the Roslin one-shot prototype. Remove them now that ReplyJob-backed sessions are live, so the record panel keeps only the sessions entry point. --- .../echo/projects/interactions_controller.rb | 21 +----- .../dradis/plugins/echo/interaction_job.rb | 32 --------- engines/dradis-echo/config/routes.rb | 2 +- .../plugins/echo/interaction_job_spec.rb | 70 ------------------- .../echo/projects/interactions_spec.rb | 21 ++++++ 5 files changed, 24 insertions(+), 122 deletions(-) delete mode 100644 engines/dradis-echo/app/jobs/dradis/plugins/echo/interaction_job.rb delete mode 100644 engines/dradis-echo/spec/jobs/dradis/plugins/echo/interaction_job_spec.rb diff --git a/engines/dradis-echo/app/controllers/dradis/plugins/echo/projects/interactions_controller.rb b/engines/dradis-echo/app/controllers/dradis/plugins/echo/projects/interactions_controller.rb index 317c74837..22448d791 100644 --- a/engines/dradis-echo/app/controllers/dradis/plugins/echo/projects/interactions_controller.rb +++ b/engines/dradis-echo/app/controllers/dradis/plugins/echo/projects/interactions_controller.rb @@ -5,8 +5,8 @@ class Projects::InteractionsController < AuthenticatedController before_action :check_turbo_config, only: [:index] before_action :set_type - before_action :set_prompt, only: [:preview, :show] - before_action :set_record, except: [:create] + before_action :set_prompt, only: [:preview] + before_action :set_record def index Prompt.seed_default_prompts(current_user) if current_user.prompts.empty? @@ -17,23 +17,6 @@ def index def preview; end - def show - @prompt_content = params[:prompt] - @interaction_id = SecureRandom.hex(20) - @response_id = SecureRandom.hex(10) - end - - def create - InteractionJob.perform_later( - agent_id: Agents::Roslin.id, - prompt: params[:prompt], - interaction_id: params[:interaction_id], - response_id: params[:response_id] - ) - - head :ok - end - private def check_turbo_config diff --git a/engines/dradis-echo/app/jobs/dradis/plugins/echo/interaction_job.rb b/engines/dradis-echo/app/jobs/dradis/plugins/echo/interaction_job.rb deleted file mode 100644 index 0a358f50e..000000000 --- a/engines/dradis-echo/app/jobs/dradis/plugins/echo/interaction_job.rb +++ /dev/null @@ -1,32 +0,0 @@ -module Dradis::Plugins::Echo - class InteractionJob < ApplicationJob - queue_as :dradis_project - - def perform(agent_id:, prompt:, interaction_id:, response_id:) - agent = Agent.find(agent_id) - raise "Agent '#{agent.name}' is not enabled" unless agent.enabled? - - spinner_shown = true - - agent.provider.generate(prompt: prompt, model: agent.model_override) do |chunk| - if spinner_shown - Turbo::StreamsChannel.broadcast_remove_to [interaction_id, 'prompts'], target: "#{response_id}_spinner" - spinner_shown = false - end - - Turbo::StreamsChannel.broadcast_append_to( - [interaction_id, 'prompts'], - target: response_id, - content: ERB::Util.html_escape(chunk) - ) - end - - Turbo::StreamsChannel.broadcast_append_to [interaction_id, 'prompts'], target: 'messages', html: '
Done.
' - rescue => e - msg = '