Skip to content

Commit 64aaacd

Browse files
committed
Fix linter warnings
- Simplify duplicate branch conditions in TranscriptAdapter - Fix predicate method naming in MCP spec - All rubocop offenses resolved
1 parent e84b876 commit 64aaacd

File tree

4 files changed

+3
-16
lines changed

4 files changed

+3
-16
lines changed

lib/mcp/sse_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def establish_sse_connection
138138
# Process SSE buffer for complete events
139139
def process_sse_buffer
140140
while (idx = @buffer.index("\n\n"))
141-
event_text = @buffer.slice!(0..idx + 1)
141+
event_text = @buffer.slice!(0..(idx + 1))
142142
event_type, event_data = parse_sse_fields(event_text)
143143

144144
case event_type

lib/raix/chat_completion.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def ruby_llm_request(params:, model:, messages:, openai_override: nil)
392392
}
393393
}
394394
end
395-
rescue => e
395+
rescue StandardError => e
396396
warn "RubyLLM request failed: #{e.message}"
397397
raise e
398398
end

lib/raix/transcript_adapter.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,8 @@ def add_message_from_hash(hash)
7373
elsif hash.key?(:assistant) || hash.key?("assistant")
7474
content = hash[:assistant] || hash["assistant"]
7575
@pending_messages << { role: "assistant", content: }
76-
elsif hash[:role] == "tool" || hash["role"] == "tool"
77-
# Tool result message
78-
@pending_messages << hash.with_indifferent_access
79-
elsif hash[:role] == "assistant" && (hash[:tool_calls] || hash["tool_calls"])
80-
# Assistant message with tool calls
81-
@pending_messages << hash.with_indifferent_access
8276
elsif hash[:role] || hash["role"]
83-
# Standard OpenAI format
77+
# Standard OpenAI format (tool messages, assistant with tool_calls, etc.)
8478
@pending_messages << hash.with_indifferent_access
8579
end
8680
end

spec/spec_helper.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@
2424

2525
Dotenv.load
2626

27-
retry_options = {
28-
max: 2,
29-
interval: 0.05,
30-
interval_randomness: 0.5,
31-
backoff_factor: 2
32-
}
33-
3427
RubyLLM.configure do |config|
3528
config.openrouter_api_key = ENV.fetch("OR_ACCESS_TOKEN", nil)
3629
config.openai_api_key = ENV.fetch("OAI_ACCESS_TOKEN", nil)

0 commit comments

Comments
 (0)