Handle current OpenCode stream completion
Some checks failed
Test / test (3.2) (push) Failing after 1s
Test / test (3.3) (push) Failing after 1s
Test / test (3.4) (push) Failing after 0s

This commit is contained in:
2026-07-12 01:53:59 -07:00
parent 8dbd3de81c
commit 2e866a618b
6 changed files with 125 additions and 16 deletions

View File

@@ -27,7 +27,7 @@ module Opencode
def self.extract_tool_summary(response_body)
parts = response_body[:parts] || []
parts
.select { |p| p[:type] == "tool" && p.dig(:state, :status).in?(TERMINAL_STATUSES) }
.select { |p| p[:type] == "tool" && TERMINAL_STATUSES.include?(p.dig(:state, :status)) }
.map { |p| build_tool_summary(p) }
end
@@ -42,7 +42,7 @@ module Opencode
{ "type" => "reasoning", "content" => part[:text] }
when "tool"
status = part.dig(:state, :status)
next unless status.in?(TERMINAL_STATUSES)
next unless TERMINAL_STATUSES.include?(status)
build_tool_summary(part)
else