Skip to content

Commit 8b5b759

Browse files
Fix deployment failure by updating outdated references (#96)
Issue #46 Production deployments were failing because `ConversationDetector` was trying to load a file that no longer exists. When I renamed the digest feature to feed, I missed updating the references in `conversation_detector.rb`. This fixes the `LoadError` by: - Removing require for `digest_prompts.rb` and using `feed_prompts.rb` instead - Updating all `DigestPrompts` module references to `FeedPrompts` - Renaming `digested_count` variable to `in_feed_count` for consistency - Cleaning up outdated comments that still referenced digest terminology The container health checks were failing because Rails couldn't load the `ConversationDetector` service. This should allow the application to start successfully in production. Tested locally with Docker.
1 parent ea4375f commit 8b5b759

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

app/models/message.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,6 @@ def broadcast_parent_message_to_threads
184184
end
185185

186186
def deactivate_copied_messages_on_deactivation
187-
# When an original message is deactivated/reactivated, sync the state to all copied messages
188-
# This ensures digest/conversation rooms reflect the current state of messages in the source room
189187
if saved_change_to_attribute?(:active) && copied_messages.any?
190188
copied_messages.update_all(active: active)
191189
end

app/services/automated_feed/scanner.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def excluded_room_ids
127127

128128
def log_scan(messages)
129129
if room.present?
130-
digested_count = messages.count(&:in_feed?)
130+
in_feed_count = messages.count(&:in_feed?)
131131
recent_count = messages.count { |m| m.created_at >= room_scan_lookback_start }
132132
old_count = messages.size - recent_count
133133

@@ -137,7 +137,7 @@ def log_scan(messages)
137137
Rails.logger.info "[AutomatedFeed::Scanner] Scanning #{messages.size} messages from room ##{room.id} (#{room.name})"
138138
Rails.logger.info "[AutomatedFeed::Scanner] - Recent (last 12h): #{recent_count} messages"
139139
Rails.logger.info "[AutomatedFeed::Scanner] - Backlog/context: #{old_count} messages"
140-
Rails.logger.info "[AutomatedFeed::Scanner] - Already in feed: #{digested_count} messages"
140+
Rails.logger.info "[AutomatedFeed::Scanner] - Already in feed: #{in_feed_count} messages"
141141
Rails.logger.info "[AutomatedFeed::Scanner] - Time range: #{oldest_msg&.created_at&.strftime('%Y-%m-%d %H:%M')} to #{newest_msg&.created_at&.strftime('%Y-%m-%d %H:%M')}" if oldest_msg && newest_msg
142142
else
143143
Rails.logger.info "[AutomatedFeed::Scanner] Scanning #{messages.size} non-feed messages from last #{@config.lookback_hours} hours"

app/services/conversation_detector.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require_relative "ai_gateway"
2-
require_relative "digest_prompts"
32
require_relative "feed_prompts"
43

54
class ConversationDetector
@@ -148,7 +147,7 @@ def format_messages_for_ai
148147
- "thread-reply-to-X" = reply in thread under message X
149148
150149
TASK:
151-
#{DigestPrompts.conversation_completeness_instructions}
150+
#{FeedPrompts.conversation_completeness_instructions}
152151
153152
OUTPUT FORMAT (JSON):
154153
{
@@ -277,13 +276,13 @@ def generate_title_and_summary
277276
278277
REQUIREMENTS:
279278
280-
#{DigestPrompts.title_guidelines}
279+
#{FeedPrompts.title_guidelines}
281280
282-
#{DigestPrompts.summary_guidelines}
281+
#{FeedPrompts.summary_guidelines}
283282
284-
#{DigestPrompts.key_insight_guidelines}
283+
#{FeedPrompts.key_insight_guidelines}
285284
286-
#{DigestPrompts.preview_message_guidelines}
285+
#{FeedPrompts.preview_message_guidelines}
287286
288287
TONE GUIDE:
289288
- Write like a human, not a corporate blog

test/services/automated_feed/deduplicator_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class DeduplicatorTest < ActiveSupport::TestCase
131131
creator: @user1
132132
)
133133

134-
# Create digest cards for each
134+
# Create feed cards for each
135135
card_from_room_1 = AutomatedFeedCard.create!(
136136
room: conv_room_1,
137137
title: "Card from room 1",

0 commit comments

Comments
 (0)